Skip to content

Instantly share code, notes, and snippets.

@kurokikaze
Last active December 22, 2015 08:49
Show Gist options
  • Save kurokikaze/6447504 to your computer and use it in GitHub Desktop.
Save kurokikaze/6447504 to your computer and use it in GitHub Desktop.
Получает текущий CPS по номеру варианта (0 - курсор, 1 - бабушка и т.д.) и цену следующего айтема по номеру.
var getCPS = function(num) {
var text = document.getElementById('rowInfoContent' + num.toString()).innerText.split('\n');
var count = parseInt(text[0].replace(/,/g, '').match(/\s(\d+)\s/)[1]);
var production = parseFloat(text[1].replace(/,/g, '').match(/\s([\d,.]+)\s/)[1]);
return production/count;
}
var getPrice = function(num) {
return parseInt(document.getElementById('product' + num.toString()).children[1].children[1].innerText.replace(/,/g,''))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment