-
-
Save tatsuru/6571789 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 c = function(){ $('div#bigCookie').click(); }; | |
setInterval(c, 1); | |
var g = function(){$('div#goldenCookie').click();}; | |
setInterval(g, 5000); | |
var u0 = function(){$('div#upgrade0').click();}; | |
setInterval(u0, 1000); | |
var calculator = function() { | |
var efficiency = new Array(10); | |
var max = -1; | |
var maxidx = 0; | |
for(i=0; i<10; i++) { | |
var info = $('div#rowInfoContent' + i).innerText.split(/\n/); | |
var num = parseInt(info[0].replace(/^.* ([0-9,.]+) .*$/, "$1").split(",").join("")); | |
var produce = parseInt(info[1].replace(/^.* ([0-9,.]+) .*$/, "$1").split(",").join("")); | |
var price = parseInt($('div#product' + i).textContent.replace(/^[^0-9]+([0-9|,]+)$/, "$1").split(",").join("")); | |
var efficiency = 1.0 * produce / num / price; | |
if (efficiency > max) { | |
maxidx = i; | |
max = efficiency; | |
} | |
} | |
console.log("buy: " + maxidx + " efficiency: " + max); | |
$('div#product' + maxidx).click(); | |
} | |
setInterval(calculator, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment