-
Notifications
You must be signed in to change notification settings - Fork 0
/
blum_claim.user.js
522 lines (454 loc) · 20.1 KB
/
blum_claim.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
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
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
// ==UserScript==
// @name Blum claim
// @version 0.19
// @author IvanAgafonov
// @match https://telegram.blum.codes/*
// @downloadURL https://github.com/IvanAgafonov/test-violentmonkey/raw/main/blum_claim.user.js
// @updateURL https://github.com/IvanAgafonov/test-violentmonkey/raw/main/blum_claim.user.js
// @homepage https://github.com/IvanAgafonov/test-violentmonkey
// @grant none
// ==/UserScript==
function shuffle(array) {
let currentIndex = array.length;
// While there remain elements to shuffle...
while (currentIndex != 0) {
// Pick a remaining element...
let randomIndex = Math.floor(Math.random() * currentIndex);
currentIndex--;
// And swap it with the current element.
[array[currentIndex], array[randomIndex]] = [
array[randomIndex], array[currentIndex]];
}
}
function getRandomDelay(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
function sleep(ms = 0) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function simulateTyping(element, text, delay) {
for (const char of text) {
const event = new KeyboardEvent('keydown', { key: char });
element.dispatchEvent(event);
await new Promise(resolve => setTimeout(resolve, delay));
}
for (const char of text) {
const event = new KeyboardEvent('keypress', { key: char });
element.dispatchEvent(event);
await new Promise(resolve => setTimeout(resolve, delay));
}
for (const char of text) {
const event = new KeyboardEvent('keyup', { key: char });
element.dispatchEvent(event);
await new Promise(resolve => setTimeout(resolve, delay));
}
}
async function connectWallet(){
var up2 = Array.from(document.querySelectorAll("div")).filter(el => el.textContent == "Wallet On")
if (up2.length != 0){
triggerEvents(up2[0]);
await sleep(getRandomDelay(3000, 4100));
up2 = Array.from(document.querySelectorAll("button")).filter(el => el.textContent.includes("Open Wallet in Telegram"))
if (up2.length != 0){
triggerEvents(up2[0]);
await sleep(getRandomDelay(20000, 21000));
}
}
}
async function start_claim() {
var up = Array.from(document.querySelectorAll("button div")).filter(el => el.textContent.includes("Start"));
shuffle(up);
if (up.length != 0){
for (const item of up) {
var need_wait = false;
try {
if (Array.from(item.parentElement.parentElement.parentElement.querySelectorAll("div")).filter(el => el.textContent.includes("Proof of Activity") || el.textContent.includes("Trade any memecoin") || el.textContent.includes("Launch a memecoin")).length > 0)
{
console.log("wait!")
need_wait = true;
}
} catch (error) {}
if (need_wait) {
} else {
item.click();
await sleep(getRandomDelay(2000, 3000));
}
}
}
up = Array.from(document.querySelectorAll("input[type='checkbox'][class='checkbox-legal']"));
if (up.length != 0){
up[0].click();
await sleep(getRandomDelay(2000, 3000));
up = Array.from(document.querySelectorAll("div button div")).filter(el => el.textContent.includes("Go to"));
if (up.length != 0){
up[0].click();
await sleep(getRandomDelay(2000, 3000));
}
}
up = Array.from(document.querySelectorAll("button div")).filter(el => el.textContent.includes("Claim"));
shuffle(up);
if (up.length != 0){
for (const item of up) {
item.click();
await sleep(getRandomDelay(2000, 3000));
}
}
}
async function verify() {
var up = Array.from(document.querySelectorAll("button div")).filter(el => el.textContent.includes("Verify"));
shuffle(up);
if (up.length != 0){
for (const item of up) {
var title = Array.from(item.parentElement.parentElement.querySelectorAll(".title"))
var q_answer = {"Pre-Market Trading?": "WOWBLUM",
"Doxxing? What's that?": "NODOXXING",
"$2.5M+ DOGS Airdrop": "HAPPYDOGS",
"Liquidity Pools Guide": "BLUMERSSS",
"What Are AMMs?": "CRYPTOSMART",
"Say No to Rug Pull!": "SUPERBLUM",
"What are Telegram Mini Apps?": "CRYPTOBLUM",
"Secure your Crypto!": "BEST PROJECT EVER",
"Forks Explained": "GO GET",
"Play track": "Blum - Big City Life",
"How to Analyze Crypto?": "VALUE",
"Navigating Crypto": "HEYBLUM",
"How to Memecoin?": "MEMEBLUM",
"Token Burning: How & Why?": "ONFIRE",
"Bitcoin Rainbow Chart?": "SOBLUM",
"Crypto Terms. Part 1": "BLUMEXPLORER",
"How to trade Perps?": "CRYPTOFAN",
"Sharding Explained": "BLUMTASTIC",
"DeFi Explained": "BLUMFORCE",
"How To Find Altcoins?": "ULTRABLUM",
"Crypto Slang. Part 1": "BLUMSTORM",
"What is On-chain Analysis?": "BLUMEXTRA",
"Pumptober Special": "PUMPIT",
"What's Crypto DEX?": "DEXXX",
"Node Sales in Crypto": "BLUMIFY",
"Choosing a Crypto Exchange": "CRYPTOZONE",
"Crypto Slang. Part 2": "FOMOOO",
"DeFi Risks: Key Insights": "BLUMHELPS",
"Dec 10 News": "ELSALVADOR ",
"Dec 6 Crypto News": "Hundred",
"Crypto Regulations #2": "Blumrules",
"P2P Trading Safety Tips": "BLUMTIPS",
"DEX History": "Godex",
"DEX History #3": "LOVEBLUM",
"Memepad Tutorial": "Memepad",
"Crypto Slang. Part 4": "LAMBOBLUM",
"DEX Evolution": "Blumspark",
"Is Binance a DEX?": "Blumies",
"Crypto Communities": "Blummunity",
"Regulation: Yay or Nay?": "BLUMSSS",
"Crypto Slang. Part 3": "BOOBLUM",
"Smart Contracts 101": "SMARTBLUM",
"What’s Next for DeFi?": "BLUMNOW",
"What is Slippage?": "CRYPTOBUZZ",
"Understanding Gas Fees": "CRYPTOGAS"}
if (title.length != 0) {
for(const [key, value] of Object.entries(q_answer)) {
if (title[0].textContent == key) {
item.click();
await sleep(getRandomDelay(1000, 2000));
var mytext = value;
var verify = document.querySelector("input[placeholder='Keyword']")
verify.click();
verify.value = mytext
simulateTyping(verify, mytext, 500);
verify.dispatchEvent(new Event('input', { bubbles: true }));
verify.dispatchEvent(new Event('change'));
await sleep(getRandomDelay(2000, 3000));
// input.value = text;
// verify.setAttribute('value', mytext);
up = Array.from(document.querySelectorAll("div div div div div div div button div")).filter(el => el.textContent.includes("Verify") && el.parentElement.getAttribute("class").includes("kit-button"));
if (up.length != 0){
up[0].click();
await sleep(getRandomDelay(2000, 4000));
}
break;
}
}
}
}
}
up = Array.from(document.querySelectorAll("button div")).filter(el => el.textContent.includes("Claim"));
shuffle(up);
if (up.length != 0){
for (const item of up) {
item.click();
await sleep(getRandomDelay(2000, 5000));
}
}
}
async function simulateTyping(element, text, delay) {
for (const char of text) {
const event = new KeyboardEvent('keydown', { key: char });
element.dispatchEvent(event);
await new Promise(resolve => setTimeout(resolve, delay));
}
for (const char of text) {
const event = new KeyboardEvent('keypress', { key: char });
element.dispatchEvent(event);
await new Promise(resolve => setTimeout(resolve, delay));
}
for (const char of text) {
const event = new KeyboardEvent('keyup', { key: char });
element.dispatchEvent(event);
await new Promise(resolve => setTimeout(resolve, delay));
element.value += char;
}
}
function triggerEvents(element) {
const events = [
new PointerEvent('pointerdown', { bubbles: true, cancelable: true, isTrusted: true, pointerId: 1, width: 1, height: 1, pressure: 0.5, pointerType: "touch" }),
new MouseEvent('mousedown', { bubbles: true, cancelable: true, isTrusted: true, screenX: 182, screenY: 877 }),
new PointerEvent('pointerup', { bubbles: true, cancelable: true, isTrusted: true, pointerId: 1, width: 1, height: 1, pressure: 0, pointerType: "touch" }),
new MouseEvent('mouseup', { bubbles: true, cancelable: true, isTrusted: true, screenX: 182, screenY: 877 }),
new PointerEvent('click', { bubbles: true, cancelable: true, isTrusted: true, pointerId: 1, width: 1, height: 1, pressure: 0, pointerType: "touch" }),
new PointerEvent('pointerout', { bubbles: true, cancelable: true, isTrusted: true, pointerId: 1, width: 1, height: 1, pressure: 0, pointerType: "touch" }),
new PointerEvent('pointerleave', { bubbles: true, cancelable: true, isTrusted: true, pointerId: 1, width: 1, height: 1, pressure: 0, pointerType: "touch" }),
new MouseEvent('mouseout', { bubbles: true, cancelable: true, isTrusted: true, screenX: 182, screenY: 877 }),
new MouseEvent('mouseleave', { bubbles: true, cancelable: true, isTrusted: true, screenX: 182, screenY: 877 })
];
events.forEach((event, index) => {
setTimeout(() => element.dispatchEvent(event), index * 100);
});
}
async function autoBuy() {
// var up = Array.from(document.querySelectorAll("img[alt='reload']"));
// if (up.length != 0){
// up[0].click();
// await sleep(getRandomDelay(4000, 6000));
// }
var up = Array.from(document.querySelectorAll("label input[type='text']"));
if (up.length != 0){
up[0].click();
triggerEvents(up[0]);
up[0].parentElement.click();
triggerEvents(up[0].parentElement);
var nameList = [
'Time','Past','Future','Dev',
'Fly','Flying','Soar','Soaring','Power','Falling',
'Fall','Jump','Cliff','Mountain','Rend','Red','Blue',
'Green','Yellow','Gold','Demon','Demonic','Panda','Cat',
'Kitty','Kitten','Zero','Memory','Trooper','XX','Bandit',
'Fear','Light','Glow','Tread','Deep','Deeper','Deepest',
'Mine','Your','Worst','Enemy','Hostile','Force','Video',
'Game','Donkey','Mule','Colt','Cult','Cultist','Magnum',
'Gun','Assault','Recon','Trap','Trapper','Redeem','Code',
'Script','Writer','Near','Close','Open','Cube','Circle',
'Geo','Genome','Germ','Spaz','Shot','Echo','Beta','Alpha',
'Gamma','Omega','Seal','Squid','Money','Cash','Lord','King',
'Duke','Rest','Fire','Flame','Morrow','Break','Breaker','Numb',
'Ice','Cold','Rotten','Sick','Sickly','Janitor','Camel','Rooster',
'Sand','Desert','Dessert','Hurdle','Racer','Eraser','Erase','Big',
'Small','Short','Tall','Sith','Bounty','Hunter','Cracked','Broken',
'Sad','Happy','Joy','Joyful','Crimson','Destiny','Deceit','Lies',
'Lie','Honest','Destined','Bloxxer','Hawk','Eagle','Hawker','Walker',
'Zombie','Sarge','Capt','Captain','Punch','One','Two','Uno','Slice',
'Slash','Melt','Melted','Melting','Fell','Wolf','Hound',
'Legacy','Sharp','Dead','Mew','Chuckle','Bubba','Bubble','Sandwich','Smasher','Extreme','Multi','Universe','Ultimate','Death','Ready','Monkey','Elevator','Wrench','Grease','Head','Theme','Grand','Cool','Kid','Boy','Girl','Vortex','Paradox'
];
alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('');
var finalName = nameList[Math.floor( Math.random() * nameList.length )] + nameList[Math.floor( Math.random() * nameList.length )] + alphabet[Math.floor( Math.random() * alphabet.length )];
up[0].value = finalName;
const event = new Event('input');
up[0].dispatchEvent(event);
await sleep(getRandomDelay(4000, 6000));
}
up = Array.from(document.querySelectorAll("button div")).filter(el => el.textContent.includes("Continue"));
if (up.length != 0){
up[0].click();
await sleep(getRandomDelay(4000, 6000));
}
up = Array.from(document.querySelectorAll("button div")).filter(el => el.textContent.includes("Continue"));
if (up.length != 0){
up[0].click();
await sleep(getRandomDelay(4000, 6000));
}
up = Array.from(document.querySelectorAll("div div div div")).filter(el => el.textContent.includes("Compete for rewards"));
if (up.length != 0){
up = Array.from(document.querySelectorAll("div div div a")).filter(el => el.textContent.includes("Open"));
if (up.length != 0){
up[0].click();
await sleep(getRandomDelay(4000, 6000));
up = Array.from(document.querySelectorAll("div div div a.pages-tribe-list-item-template"));
if (up.length != 0){
var item1 = up[Math.floor(Math.random() * up.length)]
item1.click();
await sleep(getRandomDelay(4000, 6000));
up = Array.from(document.querySelectorAll("div button span")).filter(el => el.textContent.includes("Join"));
if (up.length != 0){
up[0].click();
await sleep(getRandomDelay(4000, 6000));
history.back()
await sleep(getRandomDelay(1000, 2000));
history.back()
await sleep(getRandomDelay(1000, 2000));
}
}
}
}
up = Array.from(document.querySelectorAll("div a span")).filter(el => el.textContent.includes("Home"));
if (up.length != 0){
up[0].click();
await sleep(getRandomDelay(3000, 4000));
}
up = Array.from(document.querySelectorAll("button div")).filter(el => el.textContent.includes("Claim"));
if (up.length != 0){
for (const item of up) {
item.click();
await sleep(getRandomDelay(2000, 3000));
}
}
up = Array.from(document.querySelectorAll("div")).filter(el => el.textContent.includes("Claim"));
if (up.length != 0){
up[0].click();
await sleep(getRandomDelay(3000, 4000));
}
up = Array.from(document.querySelectorAll("button div div")).filter(el => el.textContent.includes("Start farming"));
if (up.length != 0){
up[0].click();
await sleep(getRandomDelay(3000, 4000));
}
up = Array.from(document.querySelectorAll(".pass"));
var count_tickets = 0;
if (up.length != 0){
try{
count_tickets = up[0].textContent.trim();
count_tickets = Number(count_tickets);
await sleep(getRandomDelay(3000, 4000));
} catch (error) {}
}
if (getRandomDelay(100, 2600) > 350 && count_tickets > 0) {
up = Array.from(document.querySelectorAll("div div div div a")).filter(el => el.textContent.includes("Play"));
if (up.length != 0){
up[0].click();
await sleep(getRandomDelay(60000000, 140000000));
}
} else {
up = Array.from(document.querySelectorAll("div a span")).filter(el => el.textContent.includes("Frens"));
if (up.length != 0){
up[0].click();
await sleep(getRandomDelay(3000, 4000));
}
up = Array.from(document.querySelectorAll(".claim-button"));
if (up.length != 0){
up[0].click();
await sleep(getRandomDelay(2000, 4000));
}
if (getRandomDelay(100, 2600) > 2000) {
up = Array.from(document.querySelectorAll("div a span")).filter(el => el.textContent.includes("Wallet"));
if (up.length != 0){
up[0].click();
await sleep(getRandomDelay(3000, 4000));
}
up = Array.from(document.querySelectorAll("div button")).filter(el => el.textContent.includes("Connect wallet"));
if (up.length != 0){
up[0].click();
await sleep(getRandomDelay(3000, 4000));
}
await connectWallet();
}
up = Array.from(document.querySelectorAll("div a span")).filter(el => el.textContent.includes("Earn"));
if (up.length != 0){
up[0].click();
await sleep(getRandomDelay(2000, 4000));
}
var up3;
await start_claim();
if (getRandomDelay(100, 2600) > 1000) {
up = Array.from(document.querySelectorAll(".tasks-pill-inline.is-status-not-started.is-light.pages-tasks-pill, .tasks-pill-inline.is-status-not-started.is-dark.pages-tasks-pill"));
if (up.length != 0){
for (const item of up) {
var need_wait = false;
try {
if (Array.from(item.parentElement.parentElement.parentElement.querySelectorAll("div")).filter(el => el.textContent.includes("Proof of Activity")).length > 0){
console.log("wait!")
need_wait = true;
}
} catch (error) {}
if (need_wait) {
} else {
item.click();
await sleep(getRandomDelay(2000, 5000));
}
await start_claim();
up3 = Array.from(document.querySelectorAll("button.close-btn"));
if (up3.length != 0) {
up3[0].click();
await sleep(getRandomDelay(2000, 4000));
}
await verify();
up3 = Array.from(document.querySelectorAll("button.close-btn"));
if (up3.length != 0) {
up3[0].click();
await sleep(getRandomDelay(2000, 4000));
}
}
}
}
await verify();
up3 = Array.from(document.querySelectorAll("button.close-btn"));
if (up3.length != 0) {
up3[0].click();
await sleep(getRandomDelay(2000, 4000));
}
up = Array.from(document.querySelectorAll("div div label span")).filter(el => el.textContent.includes("OnChain"));
if (up.length != 0){
up[0].click();
await sleep(getRandomDelay(2000, 4000));
}
await start_claim();
up = Array.from(document.querySelectorAll("div div label span")).filter(el => el.textContent.includes("Socials"));
if (up.length != 0){
up[0].click();
await sleep(getRandomDelay(2000, 4000));
}
await start_claim();
up = Array.from(document.querySelectorAll("div div label span")).filter(el => el.textContent.includes("Blum Bits"));
if (up.length != 0){
up[0].click();
await sleep(getRandomDelay(2000, 4000));
}
await start_claim();
up = Array.from(document.querySelectorAll("div div label span")).filter(el => el.textContent.includes("Academy"));
if (up.length != 0){
up[0].click();
await sleep(getRandomDelay(2000, 4000));
}
await start_claim();
await verify();
up = Array.from(document.querySelectorAll("div div label span")).filter(el => el.textContent.includes("Frens"));
if (up.length != 0){
up[0].click();
await sleep(getRandomDelay(2000, 4000));
}
await start_claim();
up = Array.from(document.querySelectorAll("div div label span")).filter(el => el.textContent.includes("Farming"));
if (up.length != 0){
up[0].click();
await sleep(getRandomDelay(2000, 4000));
}
await start_claim();
var up = Array.from(document.querySelectorAll("div a span")).filter(el => el.textContent.includes("Home"));
if (up.length != 0){
up[0].click();
await sleep(getRandomDelay(2000, 4000));
}
up = Array.from(document.querySelectorAll("div div div div a")).filter(el => el.textContent.includes("Play"));
if (up.length != 0){
up[0].click();
await sleep(getRandomDelay(60000000, 140000000));
}
}
}
function initializeScript() {
console.log('START Blum claim ver 0.12')
setTimeout(autoBuy, getRandomDelay(12000, 16000));
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', initializeScript);
} else {
initializeScript();
}