-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheternal.js
320 lines (293 loc) · 11.1 KB
/
eternal.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
const num_of_map=2;
function sleep(milliseconds) {
var start = new Date().getTime();
for (var i = 0; i < 1e7; i++) {
if ((new Date().getTime() - start) > milliseconds){
break;
}
}
}
async function delay(ms = 1000) {
return new Promise(resolve => setTimeout(resolve, ms))
}
async function connect() {
const longin_btn = document.getElementsByClassName('bnt-login-nav')[0];
const connect_btn = document.getElementsByClassName('subtitle-small btn-register')[0];
if (longin_btn && longin_btn.innerText === 'Login') {
longin_btn.click();
console.log(`Login Pressed`);
}
await delay(3000);
if (connect_btn && connect_btn.innerText === 'Connect') {
connect_btn.click();
console.log(`Connect Pressed`);
}
}
async function claim_crystal(){
if(document.getElementsByClassName('number-frags')[0]){
if(document.getElementsByClassName('number-frags')[0].innerText==='0.00')
{}
else{
document.getElementsByClassName('d-flex content-coin-token align-items-center justify-content-between')[0].click();
await delay(3000);
document.getElementsByClassName('d-flex content-frag-modal-shop align-items-center justify-content-center border-content-modal-shop-one')[0].click();
await delay(3000);
document.getElementsByClassName('btn-max-change-frags title-smaller-blue')[0].click();
await delay(3000);
document.getElementsByClassName('text-subtitle-regular-white btn-buy-modal-shop w-100 mt-3')[0].click();
}
}
}
async function claim_crystal1(){
for (let i = 0; i < 6; i++) {
if(document.getElementsByClassName('number-frags')[i].innerText==='0.00')
{}
else{
document.getElementsByClassName('d-flex content-coin-token align-items-center justify-content-between')[0].click();
await delay(3000);
switch(i){
case '0':
document.getElementsByClassName('d-flex content-frag-modal-shop align-items-center justify-content-center border-content-modal-shop-one')[0].click();
await delay(3000);
document.getElementsByClassName('btn-max-change-frags title-smaller-blue')[0].click();
await delay(3000);
document.getElementsByClassName('text-subtitle-regular-white btn-buy-modal-shop w-100 mt-3')[0].click();
break;
case '1':
document.getElementsByClassName('d-flex content-frag-modal-shop align-items-center justify-content-center border-content-modal-shop-two')[0].click();
await delay(3000);
document.getElementsByClassName('btn-max-change-frags title-smaller-blue')[0].click();
await delay(3000);
document.getElementsByClassName('text-subtitle-regular-white btn-buy-modal-shop w-100 mt-3')[0].click();
break;
case '2':
document.getElementsByClassName('d-flex content-frag-modal-shop align-items-center justify-content-center border-content-modal-shop-three')[0].click();
await delay(3000);
document.getElementsByClassName('btn-max-change-frags title-smaller-blue')[0].click();
await delay(3000);
document.getElementsByClassName('text-subtitle-regular-white btn-buy-modal-shop w-100 mt-3')[0].click();
break;
case '3':
document.getElementsByClassName('d-flex content-frag-modal-shop align-items-center justify-content-center border-content-modal-shop-four')[0].click();
await delay(3000);
document.getElementsByClassName('btn-max-change-frags title-smaller-blue')[0].click();
await delay(3000);
document.getElementsByClassName('text-subtitle-regular-white btn-buy-modal-shop w-100 mt-3')[0].click();
break;
case '4':
document.getElementsByClassName('d-flex content-frag-modal-shop align-items-center justify-content-center border-content-modal-shop-five')[0].click();
await delay(3000);
document.getElementsByClassName('btn-max-change-frags title-smaller-blue')[0].click();
await delay(3000);
document.getElementsByClassName('text-subtitle-regular-white btn-buy-modal-shop w-100 mt-3')[0].click();
break;
case '5':
document.getElementsByClassName('d-flex content-frag-modal-shop align-items-center justify-content-center border-content-modal-shop-six')[0].click();
await delay(3000);
document.getElementsByClassName('btn-max-change-frags title-smaller-blue')[0].click();
await delay(3000);
document.getElementsByClassName('text-subtitle-regular-white btn-buy-modal-shop w-100 mt-3')[0].click();
break;
}
}
}
}
async function claim_common(){
const i=0;
const checking_time=num_of_map;
for (let i = 0; i < checking_time; i++) {
const btn = document.getElementsByClassName('btn-claim-expedition subtitle-smaller')[i];
if (btn && btn.innerText === 'Claim') {
btn.click();
await delay(3000);
console.log("claim button clicked");
document.getElementsByClassName('number-one')[0].click();
await delay(3000);
console.log("number 1 reward selected");
document.getElementsByClassName('btn-claim text-subtitle-big-white')[0].click();
await delay(3000);
console.log("reward claimed");
document.getElementsByClassName('btn-claim text-subtitle-big-white')[0].click();
await delay(3000);
console.log("reward page closed");
}
}
}
async function deposite_common(){
const checking_time=num_of_map;
for (let i = 0; i < checking_time; i++) {
if(document.getElementsByClassName('btn-active-card-deposit text-subtitle-regular-white mt-3')[i]){
await delay(3000);
if (document.getElementsByClassName('text-subtitle-big-white content-accent-title-deposit')[i].innerText === 'Common deposit')
{if(Common_map>0){
document.getElementsByClassName('btn-active-card-deposit text-subtitle-regular-white mt-3')[i].click();
await delay(3000);
document.getElementsByClassName('btn-plus')[0].click();
await delay(3000);
document.getElementsByClassName('btn-continue-material text-subtitle-regular-white')[0].click();
await delay(3000);
console.log('common deposite activated');
await tools_inventory();
}else{
document.querySelector("#shop").click();
await delay(3000);
document.getElementsByClassName('w-100 btn-buy-item-shop')[6].click();
await delay(3000);
document.getElementsByClassName('btn-arrow-top-unds')[0].click();
await delay(3000);
document.getElementsByClassName('text-subtitle-regular-white btn-buy-modal-shop w-100 mt-3')[0].click();
await tools_inventory();
console.log('common map purchased');
await deposite();
}
}
}
}
}
async function remove_monticle() {
const checking_time=num_of_map;
for (let i = 0; i < checking_time; i++) {
const btn_no_peak = document.getElementsByClassName('btn-claim-expedition subtitle-smaller btn-disabled')[i];
if (btn_no_peak && btn_no_peak.innerText === 'Not enought peaks') {
document.querySelector("#shop").click();
await delay(3000);
document.getElementsByClassName('w-100 btn-buy-item-shop')[1].click();
await delay(3000);
document.getElementsByClassName('btn-arrow-top-unds')[0].click();
await delay(3000);
document.getElementsByClassName('text-subtitle-regular-white btn-buy-modal-shop w-100 mt-3')[0].click();
await tools_inventory();
console.log('Peak purchased');
await delay(3000);
document.querySelector("#expedition").click();
await delay(3000);
}
const btn_monticle = document.getElementsByClassName('btn-claim-expedition subtitle-smaller')[i];
if (btn_monticle && btn_monticle.innerText === 'Remove monticle') {
btn_monticle.click();
console.log(`Removed monticle`);
await delay(3000);
const btn_monticle_yes = document.getElementsByClassName('swal2-confirm swal2-styled')[0];
if (btn_monticle_yes && btn_monticle_yes.innerText === 'Yes') {
btn_monticle_yes.click();
console.log(`Confirmed removal`);
await delay(3000);
}
} else {
console.log(`Checking monticle`);
await delay(3000);
}
}
}
async function deposite() {
if (document.querySelector("#deposit")) {
document.querySelector("#deposit").click();
} else {
console.log("Logged out, trying to reconnect");
await connect();
}
}
async function expedition() {
if (document.querySelector("#expedition")) {
document.querySelector("#expedition").click();
} else {
console.log("Logged out");
await connect();
await delay(3000);
}
}
async function expedition_compass(){
const checking_time=num_of_map;
for (let i = 0; i < checking_time; i++) {
if(document.getElementsByClassName('subtitle-smaller d-flex align-items-center accent-red')[i])
{
if(Compass>0)
{
document.getElementsByClassName('content-compass-expedition d-flex justify-content-center align-items-center')[i].click();
await tools_inventory();
}
else{
document.querySelector("#shop").click();
await delay(3000);
document.getElementsByClassName('w-100 btn-buy-item-shop')[0].click();
await delay(3000);
document.getElementsByClassName('btn-arrow-top-unds')[0].click();
await delay(3000);
document.getElementsByClassName('text-subtitle-regular-white btn-buy-modal-shop w-100 mt-3')[0].click();
await tools_inventory();
console.log('Compass purchased');}
}
else{}
}
}
let Peak = 0 ;
let Compass = 0 ;
let Legendary_map = 0 ;
let Rare_map = 0 ;
let Uncommon_map = 0 ;
let Mythical_map = 0 ;
let Common_map = 0 ;
let Epic_map = 0 ;
async function tools_inventory(){
try{
for (let i = 0; i < 8; i++) {
switch(document.getElementsByClassName('text-subtitle-big-white mb-2 title-nav-materials')[i].innerText){
case 'Peak':
Peak= document.getElementsByClassName('input-quantity-material position-absolute text-center')[i].value;
break;
case 'Compass':
Compass= document.getElementsByClassName('input-quantity-material position-absolute text-center')[i].value;
break;
case 'Legendary map':
Legendary_map= document.getElementsByClassName('input-quantity-material position-absolute text-center')[i].value;
break;
case 'Rare map':
Rare_map= document.getElementsByClassName('input-quantity-material position-absolute text-center')[i].value;
break;
case 'Uncommon map':
Uncommon_map= document.getElementsByClassName('input-quantity-material position-absolute text-center')[i].value;
break;
case 'Mythical map':
Mythical_map= document.getElementsByClassName('input-quantity-material position-absolute text-center')[i].value;
break;
case 'Common map':
Common_map= document.getElementsByClassName('input-quantity-material position-absolute text-center')[i].value;
break;
case 'Epic map':
Epic_map= document.getElementsByClassName('input-quantity-material position-absolute text-center')[i].value;
break;
}
}
}catch{}
}
async function tools_inventory_print(){
console.log('Peak: '+Peak);
console.log('Compass: '+Compass);
console.log('Legendary_map: '+Legendary_map);
console.log('Rare_map: '+Rare_map);
console.log('Uncommon_map: '+Uncommon_map);
console.log('Mythical_map: '+Mythical_map);
console.log('Common_map: '+Common_map);
console.log('Epic_map: '+Epic_map);
}
await tools_inventory();
await tools_inventory_print();
while(true) {
try{
await connect();
await delay(3000);
await claim_crystal();
await delay(3000);
await claim_common();
await delay(3000);
await expedition();
await delay(3000);
await expedition_compass();
await delay(3000);
await remove_monticle();
await delay(3000);
await deposite();
await delay(3000);
await deposite_common();
}catch{}
}