This repository has been archived by the owner on Mar 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.js
337 lines (287 loc) · 9.69 KB
/
index.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
//@ts-nocheck
const express = require("express");
const app = express();
app.get("/", function (req, res) {
res.send("Dank Grinder Running !!");
});
app.listen(3000);
const schedule = require("node-schedule");
var colors = require("colors");
var convertTime = require("convert-time");
require("dotenv").config();
const { Client } = require("discord.js-selfbot-v13");
const client = new Client();
var moment = require("moment-timezone");
client.on("ready", () => {
console.log(`\nLogged in as ` + client.user.tag.underline.brightRed);
client.user.setStatus("invisible");
});
var channelid = process.env.channelID;
var storageac = process.env.storageAccount;
var begin = moment.tz(process.env.startTime, "H", process.env.timezone);
var beginTime = begin.utc().format("H");
var end = moment.tz(process.env.endTime, "H", process.env.timezone);
var ceaseTime = end.utc().format("H");
if (parseInt(process.env.endTime) > 24) {
console.log("You cannot put a value above 24 in endTime !".red);
return;
}
if (parseInt(process.env.startTime) > 24) {
console.log("You cannot put a value above 24 in startTime !".red);
return;
}
if (parseInt(process.env.startTime) >= parseInt(process.env.endTime)) {
console.log(
`Invald Format !!!\nEnd Time should be greater than start time !!`.red
.underline.bold
);
return;
}
var begin_m = moment.tz("00", "mm", process.env.timezone);
var beginTime_m = begin_m.utc().format("mm");
var end_m = moment.tz("00", "mm", process.env.timezone);
var endTime_m = end_m.utc().format("mm");
console.log(
"Start Time : ".red +
convertTime(`${process.env.startTime}:${beginTime_m}`, "hh:mm A".blue)
);
console.log(
"End Time : ".red +
convertTime(`${process.env.endTime}:${endTime_m}`, "hh:mm A".blue)
);
console.log(
"Runtime : ".red,
`${process.env.endTime - process.env.startTime} hrs`.blue
);
///////////////////
//// Auto Buy ////
/////////////////
if (process.env.autoBuy === "true") {
console.log("\nAuto Buy Running !".magenta);
client.on("messageCreate", (message) => {
if (
message.author.id !== "270904126974590976" &&
message.channel.id !== channelid
)
return;
if (!message.mentions.has(client.user.id)) return;
if (message.content.indexOf("You don't have a shovel") > -1) {
const dankChannel = client.channels.cache.get(channelid);
dankChannel.sendTyping();
dankChannel.send("pls with 25000");
setTimeout(function () {
dankChannel.send("pls buy shovel");
}, 3000);
console.log(">".green + " bought" + " a shovel !".yellow);
}
if (message.content.indexOf("You don't have a hunting rifle") > -1) {
const dankChannel = client.channels.cache.get(channelid);
dankChannel.sendTyping();
dankChannel.send("pls with 25000");
setTimeout(function () {
dankChannel.send("pls buy rifle");
}, 3000);
console.log(">".green + " bought" + " a hunting rifle !".yellow);
}
if (message.content.indexOf("You don't have a fishing pole") > -1) {
const dankChannel = client.channels.cache.get(channelid);
dankChannel.sendTyping();
dankChannel.send("pls with 25000");
setTimeout(function () {
dankChannel.send("pls buy pole");
}, 3000);
console.log(">".green + " bought" + " a fishing rod !".yellow);
}
});
}
/////////////////////////
//// Grind Commands ////
///////////////////////
setInterval(() => {
global.now;
global.now = new Date().getUTCHours();
global.datetime = moment(new Date());
}, 5000);
client.on("ready", () => {
setTimeout(function () {
/*
Pls dep all
*/
setInterval(() => {
if (global.now >= beginTime && global.now <= ceaseTime) {
const dankChannel = client.channels.cache.get(channelid);
dankChannel.sendTyping();
dankChannel.send("pls dep all");
console.log(">".green + " sent" + " pls dep all".red);
} else {
console.log(">".green + " Resting...".red);
console.log(
global.datetime.tz(process.env.timezone).format("DD/MM # hh:mm A")
.green
);
}
}, 60000);
/*
Pls hunt
*/
setInterval(() => {
if (global.now >= beginTime && global.now <= ceaseTime) {
const dankChannel = client.channels.cache.get(channelid);
dankChannel.sendTyping();
dankChannel.send("pls hunt");
console.log(">".green + " sent" + " pls hunt".red);
} else {
console.log(">".green + " Resting...".red);
console.log(
global.datetime.tz(process.env.timezone).format("DD/MM # hh:mm A")
.green
);
}
}, 41000);
/*
Pls dig
*/
setInterval(() => {
if (global.now >= beginTime && global.now <= ceaseTime) {
const dankChannel = client.channels.cache.get(channelid);
dankChannel.sendTyping();
dankChannel.send("pls dig");
console.log(">".green + " sent" + " pls dig".red);
} else {
console.log(">".green + " Resting...".red);
console.log(
global.datetime.tz(process.env.timezone).format("DD/MM # hh:mm A")
.green
);
}
}, 42000);
/*
Pls fish
*/
setInterval(() => {
if (global.now >= beginTime && global.now <= ceaseTime) {
const dankChannel = client.channels.cache.get(channelid);
dankChannel.sendTyping();
dankChannel.send("pls fish");
console.log(">".green + " sent" + " pls fish".red);
} else {
console.log(">".green + " Resting...".red);
console.log(
global.datetime.tz(process.env.timezone).format("DD/MM # hh:mm A")
.green
);
}
}, 43000);
/*
Pls beg
*/
setInterval(() => {
if (global.now >= beginTime && global.now <= ceaseTime) {
const dankChannel = client.channels.cache.get(channelid);
dankChannel.sendTyping();
dankChannel.send("pls beg");
console.log(">".green + " sent" + " pls beg".red);
} else {
console.log(">".green + " Resting...".red);
console.log(
global.datetime.tz(process.env.timezone).format("DD/MM # hh:mm A")
.green
);
}
}, 46000);
//////////////////////
/// Auto Transfer ///
////////////////////
client.on("messageCreate", async (message) => {
if (message.author.id != storageac) return;
if (message.content.toLowerCase().startsWith("-trade")) {
message.channel.sendTyping();
message.channel.send("pls with all");
setTimeout(function () {
message.channel.sendTyping();
message.channel.send("pls taxcalc all");
}, 1000);
setTimeout(function () {
message.channel.messages.fetch({ limit: 1 }).then((messages) => {
let lastMessage = messages.first();
if (lastMessage.author.id != "270904126974590976") return;
if (!lastMessage.embeds[0]) return;
let lastMsgContent = lastMessage.embeds[0].description;
let balance = lastMsgContent.match(
/(?<= send \*\*`⏣ )(.*)(?=`\*\*\*)/gm
);
let balanceStr = balance.toString();
message.channel.send(
"pls trade " + balanceStr + ` <@${storageac}>`
);
});
setTimeout(function () {
message.channel.messages.fetch({ limit: 1 }).then((messages) => {
let lastMessage = messages.first();
if (lastMessage.author.id != "270904126974590976") return;
if (!lastMessage.embeds[0]) return;
if (!lastMessage.embeds[0].title) return;
if (!lastMessage.mentions.has(client.user.id)) return;
if (
lastMessage.embeds[0].title.startsWith("Pending Confirmation")
) {
let custom_id =
lastMessage.components[0].components[1].customId;
lastMessage.clickButton(custom_id);
}
}, 1000);
}, 2000);
}, 2000);
}
});
/////////////////////
//// Auto Daily ////
///////////////////
schedule.scheduleJob("5 0 * * *", () => {
const dankChannel = client.channels.cache.get(channelid);
dankChannel.sendTyping();
dankChannel.send("pls daily");
console.log(">".green + " sent" + " pls daily".red);
});
////////////////////
//// Auto Sell ////
//////////////////
if (process.env.autoSell === "true") {
console.log("\nAuto Sell Running !".magenta);
client.on("messageCreate", async (message) => {
if (
message.author.id !== "270904126974590976" &&
message.channel.id !== channelid
)
return;
if (!message.embeds[0]) return;
if (!message.embeds[0].title) return;
if (!message.mentions.has(client.user.id)) return;
if (
message.embeds[0].title.startsWith("Pending Confirmation") &&
message.embeds[0].description.startsWith(
"Would you like to sell all your"
)
) {
let custom_id = message.components[0].components[1].customId;
await message.clickButton(custom_id);
console.log("Sold all the Sellable items".red);
}
});
schedule.scheduleJob("0 */3 * * *", () => {
if (global.now >= beginTime && global.now <= ceaseTime) {
const dankChannel = client.channels.cache.get(channelid);
dankChannel.sendTyping();
dankChannel.send("pls sell");
} else {
console.log(">".green + " Resting...".red);
console.log(
global.datetime.tz(process.env.timezone).format("DD/MM # hh:mm A")
.green
);
}
});
}
}, 10000);
});
client.login(process.env.token);