Last active
October 12, 2017 16:27
-
-
Save teeparham/78ba8027a266c49cb1f29ecf1c9c37c3 to your computer and use it in GitHub Desktop.
Win Paperclip
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
// moved to https://github.com/teeparham/win-paperclip | |
// http://www.decisionproblem.com/paperclips/index2.html | |
function click (id) { | |
document.querySelector(id).click(); | |
} | |
function multiClick (id, n) { | |
for (i = 0; i < n; i++) { | |
click(id); | |
} | |
} | |
function delayedClick (id, delay) { | |
setTimeout(function () { click(id); }, delay); | |
} | |
function timeClick (id, delay, nTimes) { | |
for (i = 0; i < nTimes; i++) { | |
delayedClick(id, i * delay); | |
} | |
} | |
var bMakePaperclip = '#btnMakePaperclip', | |
bAutoClipper = '#btnMakeClipper', | |
bWire = '#btnBuyWire', | |
bMarketing = '#btnExpandMarketing', | |
bProcessors = '#btnAddProc', | |
bMemory = '#btnAddMem', | |
bRaise = '#btnRaisePrice'; | |
// example usage: | |
multiClick(bMakePaperClip, 100) | |
timeClick(bAutoClipper, 15000, 25) | |
timeClick(bProcessors, 120000, 20) | |
timeClick(bMemory, 120000, 20) | |
timeClick(bMarketing, 500000, 20) | |
// cheats | |
wire = 9999999 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
moved to https://github.com/teeparham/win-paperclip