Skip to main content

bookmarklet.js

gist link

Attachment Type Size
bookmarklet.js application/javascript 498.0B
clickingbad_seconds_info.js application/javascript 912.0B
fiddle.js application/javascript 912.0B
fiddle.manifest text/cache-manifest 126.0B

bookmarklet.js – application/javascript, 498.0B

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);

clickingbad_seconds_info.js – application/javascript, 912.0B

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);

fiddle.js – application/javascript, 912.0B

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);

fiddle.manifest – text/cache-manifest, 126.0B

name: Clicking bad bookmarklet
description: Clicking bad thing
authors:
  - Jason Schwarzenberger
resources:
normalize_css: no