-
Notifications
You must be signed in to change notification settings - Fork 0
/
modmenu.js
131 lines (108 loc) · 3.75 KB
/
modmenu.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
// CC-DMM
var DmmModObject = {};
var Othershit = {};
var Version = 1;
// you should probably remove this part if your forking XD
Othershit.ticker = () => {
return ['you dirty little hacker!!', 'this man is using hacks what a loser', 'cookie clicker is meant to be fun, yet this man hacks', 'grandma knows your hacking.', 'https://www.github.com/dumorando/CC-DMM'] // /hj
}
Game.registerHook("ticker", Othershit.ticker);
// //
DmmModObject.init = () => {
if (!"CCDMM-WelcomeAlert" in localStorage) {
Game.Notify('Welcome!', 'Welcome to CC-DumosModMenu. you can find all the shit by pressing E on your keybored. have fun!');
localStorage.setItem("CCDMM-WelcomeAlert", "done");
}
};
//just incase..
if (!"CCDMM-WelcomeAlert" in localStorage) {
Game.Notify('Welcome!', 'Welcome to CC-DumosModMenu. you can find all the shit by pressing E on your keybored. have fun!');
}
// actual mod menu
let revertamt = null;
let ccdmm = document.createElement("div");
ccdmm.style.position="absolute";
ccdmm.style.zIndex=10000;
ccdmm.style.width="100%";
ccdmm.style.height="100%";
ccdmm.style.backgroundColor = "dodgerblue";
ccdmm.hidden = true;
let htext = document.createElement("h1");
htext.innerText = `CC-DMM v${Version}`
let scbtn = document.createElement("button");
scbtn.innerText = "Set Cookies";
scbtn.addEventListener("click", () => {
let prmpt = prompt("Enter the amount of cookies you want! (you can also type Infinity, if you relaly want to.)");
if (!parseInt(prmpt) == NaN) {
revertamt = Game.cookies;
Game.cookies = Number(prmpt);
} else {
alert("Thats not an integer!")
}
});
let acbtn = document.createElement("button");
acbtn.innerText = "Add Cookies";
acbtn.addEventListener("click", () => {
let amount = prompt("Enter the amount of cookies you want to add!");
if (!parseInt(amount) == NaN) {
revertamt = Game.cookies;
Game.cookies += Number(amount);
} else {
alert("Thats not an integer!")
}
});
let sscbtn = document.createElement("button");
sscbtn.innerText = "Cookies²";
sscbtn.addEventListener("click", () => {
revertamt = Game.cookies;
Game.cookies = Game.cookies*Game.cookies;
});
let osbtn = document.createElement("button");
osbtn.innerText = "Open sesame";
osbtn.addEventListener("click", () => {
Game.OpenSesame();
});
let aabtn = document.createElement("button");
aabtn.innerText = "Get All achievements";
aabtn.addEventListener("click", () => {
let allachievements = Object.keys(Game.Achievements);
allachievements.forEach((achvement) => {
Game.Win(achvement);
})
});
let sabtn = document.createElement("button");
sabtn.innerText = "Specific Achievement";
sabtn.addEventListener("click", () => {
Game.Win(prompt("Type An Achievmenets name! (it has to be exact)"));
});
let rbtn = document.createElement("button");
rbtn.innerText = "Revert";
rbtn.addEventListener("click", () => {
if (!revertamt === null) {
Game.cookies = revertamt;
} else {
alert("cannot revert.")
}
});
let extrabr = document.createElement("br");
let cbtn = document.createElement("button");
cbtn.style.backgroundColor = "red";
cbtn.style.color = "white";
cbtn.innerText = "Close";
cbtn.addEventListener("click", () => {
ccdmm.hidden = true;
});
let allbuttons = [htext, scbtn, acbtn, sscbtn, osbtn, aabtn, sabtn, rbtn, extrabr, cbtn];
allbuttons.forEach((btn) => {
ccdmm.appendChild(btn);
ccdmm.appendChild(document.createElement("br"));
})
document.body.appendChild(ccdmm);
document.addEventListener("keydown", (e) => {
if (e.isComposing || e.keyCode === 229) {
return;
} //its deprecated but i have to add it -_-
if (e.key == "e") {
ccdmm.hidden = !ccdmm.hidden;
}
});