Last active
January 1, 2016 06:29
-
-
Save jason-s13r/8105640 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
javascript:window.setInterval(function(){$("#clickers, #sellers, #upgrades, #banks").find('[id$="_cst"]').each(function(){var b=$(this),a=b.text().replace(/[\$,]/g,""),c=a.replace(/[0-9\.]/g,""),a=1*a.replace(/[A-Z]/,""),c={Q:1E15,T:1E12,B:1E9,M:1E6}[c]||1,a=a*c,d=$("#seller_rps"),c=$("#sell_amt"),d=d.text().replace(/,/g,""),c=c.text().replace(/,/g,""),a=(a-c)/d,b="#"+b.attr("id").replace("_cst","_btn"),b=$(b);0<a?(a="Purchase in "+a.toFixed(0)+" seconds",b.html(a)):b.html("Purchase")})},1E3); |
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
window.setInterval(function () { | |
$('#clickers, #sellers, #upgrades, #banks').find('[id$="_cst"]').each(function () { | |
var multipliers = { | |
Qt: 1E18, | |
Q: 1E15, | |
T: 1E12, | |
B: 1E9, | |
M: 1E6 | |
}; | |
var $this = $(this); | |
var price = $this.text().replace(/[\$,]/g, ""); | |
var multiplier = price.replace(/[0-9\.]/g, ""); | |
price = price.replace(/[A-Z]/gi, "") * 1; | |
multiplier = multipliers[multiplier] || 1; | |
price = price * multiplier; | |
var $income = $("#seller_rps"); | |
var $cash = $("#sell_amt"); | |
var income = $income.text() | |
.replace(/,/g, ""); | |
var cash = $cash.text() | |
.replace(/,/g, ""); | |
var seconds = (price - cash) / income; | |
var buybtn = "#" + $this.attr("id") | |
.replace("_cst", "_btn"); | |
var $buybtn = $(buybtn); | |
if (seconds > 0) { | |
var text = "Purchase in " + seconds.toFixed(0) + " seconds"; | |
$buybtn.html(text); | |
} else { | |
$buybtn.html('Purchase'); | |
} | |
}); | |
}, 1E3); |
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
window.setInterval(function () { | |
$('#clickers, #sellers, #upgrades, #banks').find('[id$="_cst"]').each(function () { | |
var multipliers = { | |
Qt: 1E18, | |
Q: 1E15, | |
T: 1E12, | |
B: 1E9, | |
M: 1E6 | |
}; | |
var $this = $(this); | |
var price = $this.text().replace(/[\$,]/g, ""); | |
var multiplier = price.replace(/[0-9\.]/g, ""); | |
price = price.replace(/[A-Z]/gi, "") * 1; | |
multiplier = multipliers[multiplier] || 1; | |
price = price * multiplier; | |
var $income = $("#seller_rps"); | |
var $cash = $("#sell_amt"); | |
var income = $income.text() | |
.replace(/,/g, ""); | |
var cash = $cash.text() | |
.replace(/,/g, ""); | |
var seconds = (price - cash) / income; | |
var buybtn = "#" + $this.attr("id") | |
.replace("_cst", "_btn"); | |
var $buybtn = $(buybtn); | |
if (seconds > 0) { | |
var text = "Purchase in " + seconds.toFixed(0) + " seconds"; | |
$buybtn.html(text); | |
} else { | |
$buybtn.html('Purchase'); | |
} | |
}); | |
}, 1E3); |
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
name: Clicking bad bookmarklet | |
description: Clicking bad thing | |
authors: | |
- Jason Schwarzenberger | |
resources: | |
normalize_css: no |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment