-
Notifications
You must be signed in to change notification settings - Fork 0
/
GoldenCookieClicker.js
50 lines (38 loc) · 1.33 KB
/
GoldenCookieClicker.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
// Golden Cookie Clicker
// By RainSlide
// Modified By ShiriNmi
// Automatically click golden cookies and reindeers.
// Version 1.0
// Updated 2022-04-19
// Cookie Clicker: https://orteil.dashnet.org/cookieclicker/
"use strict";
if (typeof Game !== "object" || Game === null || !Array.isArray(Game.shimmers)) {
console.error(
"Golden Cookie Clicker: Cookie Clicker API is not ready or invalid.\n" +
"Please make sure you are running this script on a Cookie Clicker webpage, " +
"and the page is fully loaded."
);
} else if (typeof Proxy !== "function") {
console.error(
"Golden Cookie Clicker: JavaScript Proxy API is not available, " +
"either update your browser, or use the ES3 compatible version:\n"+
"https://rainslide.neocities.org/cookieclicker/GoldenCookieClicker.es3.js"
);
} else {
const apply = (target, _this, args) => {
var shimmer = args[0];
console.debug('shimmer', shimmer)
if (shimmer.type === "golden" || shimmer.type === "reindeer") {
setTimeout(() => shimmer.pop(), 500);
}
return Reflect.apply(target, _this, args);
};
Object.defineProperty(Game.shimmers, "push", {
value: new Proxy(Game.shimmers.push, { apply }),
writable: true,
enumerable: false,
configurable: true
});
typeof Game.Win === "function" &&
Game.Win("Third-party");
}