Last active
December 22, 2015 08:49
-
-
Save kurokikaze/6447504 to your computer and use it in GitHub Desktop.
Получает текущий CPS по номеру варианта (0 - курсор, 1 - бабушка и т.д.) и цену следующего айтема по номеру.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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