-
Notifications
You must be signed in to change notification settings - Fork 0
/
cookieclicker.user.js
68 lines (59 loc) · 3.04 KB
/
cookieclicker.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// ==UserScript==
// @name Auto Cookie Clicker
// @namespace https://waa.ai/spinpy
// @version 1.4
// @description Automate Cookie Clicker and have it do the work for you!
// @author Spinfal
// @match http://orteil.dashnet.org/cookieclicker/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
async function click() {
setInterval(function() { document.getElementById('bigCookie').click() }, 0);
}
async function upgrades(delay) {
if (isNaN(parseInt(delay))) {
alert('that wasnt a number.');
upgrades(parseInt(prompt('enter an interval to auto buy upgrades (in seconds)')));
} else {
console.log(`upgrade delay set to: ${delay}`);
setInterval(function() { document.getElementById('upgrade0').click() }, parseInt(delay) * 1000);
// products
setInterval(function() { document.getElementById('product0').click() }, delay * 1000);
setInterval(function() { document.getElementById('product1').click() }, delay * 1000);
setInterval(function() { document.getElementById('product2').click() }, delay * 1000);
setInterval(function() { document.getElementById('product3').click() }, delay * 1000);
setInterval(function() { document.getElementById('product4').click() }, delay * 1000);
setInterval(function() { document.getElementById('product5').click() }, delay * 1000);
setInterval(function() { document.getElementById('product6').click() }, delay * 1000);
}
}
async function products(delay) {
if (isNaN(parseInt(delay))) {
alert('that wasnt a number.');
upgrades(parseInt(prompt('enter an interval to auto buy products (in seconds)')));
} else {
console.log(`product delay set to: ${delay}`);
setInterval(function() { document.getElementById('product0').click() }, delay * 1000);
setInterval(function() { document.getElementById('product1').click() }, delay * 1000);
setInterval(function() { document.getElementById('product2').click() }, delay * 1000);
setInterval(function() { document.getElementById('product3').click() }, delay * 1000);
setInterval(function() { document.getElementById('product4').click() }, delay * 1000);
setInterval(function() { document.getElementById('product5').click() }, delay * 1000);
setInterval(function() { document.getElementById('product6').click() }, delay * 1000);
}
}
setTimeout(function() {
if (confirm('start autoclicker?')) {
click();
}
if (confirm('auto buy upgrades?')) {
upgrades(parseInt(prompt('enter an interval to auto buy upgrades (in seconds)')));
}
if (confirm('auto buy products?')) {
upgrades(parseInt(prompt('enter an interval to auto buy products (in seconds)')));
}
}, 3000);
setInterval(function() { Game.toSave=true;PlaySound('snd/tick.mp3') }, 10000);
})();