Skip to content

Instantly share code, notes, and snippets.

@teeparham
Last active October 12, 2017 16:27
Show Gist options
  • Save teeparham/78ba8027a266c49cb1f29ecf1c9c37c3 to your computer and use it in GitHub Desktop.
Save teeparham/78ba8027a266c49cb1f29ecf1c9c37c3 to your computer and use it in GitHub Desktop.
Win Paperclip
// 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
@teeparham
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment