forked from daffa4040/yescoin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyescoin.py
485 lines (433 loc) · 22.2 KB
/
yescoin.py
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
# JOIN TELEGRAM : https://t.me/apsstudiotech
# JOIN DISCORD : https://discord.gg/N9caefVJ7F
import requests
import time
from colorama import Fore, Style, init
import json
init(autoreset=True)
def print_welcome_message():
print(r"""
┏┓┏┓┏┓ ┏┓┏┳┓┳┳┳┓┳┏┓
┣┫┃┃┗┓ ┗┓ ┃ ┃┃┃┃┃┃┃
┛┗┣┛┗┛ ┗┛ ┻ ┗┛┻┛┻┗┛
""")
print(Fore.GREEN + Style.BRIGHT + "YesCoin (Gold) BOT")
print(Fore.GREEN + Style.BRIGHT + "JOIN TELEGRAM : https://t.me/apsstudiotech")
print(Fore.YELLOW + Style.BRIGHT + "JOIN DISCORD : https://discord.gg/N9caefVJ7F")
print(Fore.BLUE + Style.BRIGHT + "JOIN DISCORD UNTUK SCRIP LENGKAP")
print(Fore.RED + Style.BRIGHT + "Developer : Ade Arman Wijaya)\n\n")
# Load tokens from file
def load_tokens(file_path):
with open(file_path, 'r') as file:
tokens = file.read().splitlines()
return tokens
available_colors = [Fore.GREEN, Fore.YELLOW, Fore.BLUE, Fore.MAGENTA, Fore.CYAN]
# Define headers
def get_headers(token):
return {
'accept': 'application/json, text/plain, */*',
'accept-language': 'en-US,en;q=0.9',
'cache-control': 'no-cache',
'content-type': 'application/json',
'origin': 'https://www.yescoin.gold',
'pragma': 'no-cache',
'priority': 'u=1, i',
'referer': 'https://www.yescoin.gold/',
'sec-ch-ua': '"Microsoft Edge";v="125", "Chromium";v="125", "Not.A/Brand";v="24", "Microsoft Edge WebView2";v="125"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': 'Windows',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-site',
'token': token,
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0'
}
def collect_coin(token, amount):
url = 'https://api.yescoin.gold/game/collectCoin'
headers = get_headers(token)
data = json.dumps(amount)
try:
response = requests.post(url, headers=headers, data=data)
response.raise_for_status()
result = response.json()
# print(result)
if result['code'] == 0:
return result
else:
# print(f"Error in response: {result}") # Detailed error logging
return None
except requests.exceptions.HTTPError as http_err:
print(f"HTTP error occurred: {http_err}") # HTTP-specific error logging
# print(f"Response status code: {response.status_code}")
# print(f"Response text: {response.text}")
return None
except Exception as e:
print(f"Error collecting coins: {e}")
return None
def fetch_account_info(token):
try:
url = 'https://api.yescoin.gold/account/getAccountInfo'
headers = get_headers(token)
response = requests.get(url, headers=headers)
response.raise_for_status()
data = response.json()
if data['code'] == 0:
return data
else:
return None
except Exception as e:
print(f"Error fetching account info: {e}")
def fetch_game_info(token):
try:
url = 'https://api.yescoin.gold/game/getGameInfo'
headers = get_headers(token)
response = requests.get(url, headers=headers)
response.raise_for_status()
data = response.json()
if data['code'] == 0:
return data
else:
return None
except Exception as e:
print(f"Error fetching game info: {e}")
def use_special_box(token):
url = 'https://api.yescoin.gold/game/recoverSpecialBox'
headers = get_headers(token)
try:
response = requests.post(url, headers=headers)
response.raise_for_status()
result = response.json()
if result['code'] == 0:
print(f"{Fore.GREEN + Style.BRIGHT}\r[ Chest ] : Activating...", end="", flush=True)
return True
else:
print(f"{Fore.RED + Style.BRIGHT}\r[ Chest ] : Failed to activate", end="", flush=True)
return False
except Exception as e:
print(f"{Fore.RED}\r[ Chest ] : Error", flush=True)
return False
def fetch_special_box_info(token):
try:
url = 'https://api.yescoin.gold/game/getSpecialBoxInfo'
headers = get_headers(token)
response = requests.get(url, headers=headers)
response.raise_for_status()
data = response.json()
if data['code'] == 0:
return data
else:
return None
except Exception as e:
print(f"Error fetching special box info: {e}")
def get_my_user_nick(token):
try:
url = 'https://api.yescoin.gold/account/getRankingList?index=1&pageSize=1&rankType=1&userLevel=1'
headers = get_headers(token)
response = requests.get(url, headers=headers)
response.raise_for_status()
data = response.json()
if 'myUserNick' in data['data'] and data['data']['myUserNick']:
return data['data']['myUserNick']
else:
return "no nickname"
except Exception as e:
print(f"Error fetching my user nick: {e}")
def collect_from_special_box(token, box_type, coin_count):
url = 'https://api.yescoin.gold/game/collectSpecialBoxCoin'
headers = get_headers(token)
data = json.dumps({"boxType": box_type, "coinCount": coin_count})
try:
response = requests.post(url, headers=headers, data=data)
response.raise_for_status()
result = response.json()
if result['code'] == 0:
if result['data']['collectStatus']:
print(f"{random.choice(available_colors) + Style.BRIGHT}\r[ Chest ] : Collected {result['data']['collectAmount']} Coins ", flush=True)
return True, result['data']['collectAmount']
else:
print(f"{Fore.RED + Style.BRIGHT}\r[ Chest ] : Tidak ada chest ", flush=True)
return True, 0
else:
print(f"{Fore.RED + Style.BRIGHT}\r[ Chest ] : Failed to collect coins: {result['message']}", end="", flush=True)
return False, 0
except Exception as e:
print(f"{Fore.RED + Style.BRIGHT}\r[ Chest ] : Error: {e}", flush=True)
return False, 0
def attempt_collect_special_box(token, box_type, initial_coin_count):
coin_count = initial_coin_count
while coin_count > 0:
success, collected_amount = collect_from_special_box(token, box_type, coin_count)
if success:
return collected_amount
coin_count -= 20 # Kurangi jumlah koin jika gagal karena batas
print(f"{Fore.RED + Style.BRIGHT}\r[ Chest ] : Unable to collect any coins after adjustments", flush=True)
return 0
def fetch_account_build_info(token):
try:
url = 'https://api.yescoin.gold/build/getAccountBuildInfo'
headers = get_headers(token)
response = requests.get(url, headers=headers)
response.raise_for_status()
data = response.json()
if data['code'] == 0:
# print(data)
return data
else:
return None
# print(f"Failed to fetch account build info: {data['message']}")
except Exception as e:
print(f"Error fetching account build info: {e}")
def fetch_squad_info(token):
url = 'https://api.yescoin.gold/squad/mySquad'
headers = get_headers(token)
try:
response = requests.get(url, headers=headers)
response.raise_for_status()
data = response.json()
if data['code'] == 0:
return data
else:
return None
except Exception as e:
print(f"Error fetching squad info: {e}")
return None
def join_squad(token, squad_link):
url = 'https://api.yescoin.gold/squad/joinSquad'
headers = get_headers(token)
data = json.dumps({"squadTgLink": squad_link})
try:
response = requests.post(url, headers=headers, data=data)
response.raise_for_status()
result = response.json()
if result['code'] == 0:
return result
else:
return None
except Exception as e:
print(f"Error joining squad: {e}")
return None
def recover_coin_pool(token):
url = 'https://api.yescoin.gold/game/recoverCoinPool'
headers = get_headers(token)
try:
response = requests.post(url, headers=headers)
response.raise_for_status()
result = response.json()
if result['code'] == 0:
print(f"{random.choice(available_colors)+Style.BRIGHT}\r[ Recovery ] : Sukses ", flush=True)
return True
else:
print(f"{Fore.RED + Style.BRIGHT}\r[ Recovery ] : Gagal", flush=True)
return False
except Exception as e:
print(f"{Fore.RED + Style.BRIGHT}\r[ Recovery ] : Error: {e}", flush=True)
return False
def fetch_task_list(token):
url = 'https://api.yescoin.gold/task/getCommonTaskList'
headers = get_headers(token)
try:
response = requests.get(url, headers=headers)
response.raise_for_status()
tasks = response.json()
if tasks['code'] == 0:
return tasks['data']
else:
print(f"{Fore.RED + Style.BRIGHT}\r[ Task ] : Failed to get task list: {tasks['message']}", flush=True)
return None
except Exception as e:
print(f"{Fore.RED + Style.BRIGHT}Error: {e}")
return None
def finish_task(token, task_id):
url = 'https://api.yescoin.gold/task/finishTask'
headers = get_headers(token)
data = json.dumps(task_id)
try:
response = requests.post(url, headers=headers, data=data)
response.raise_for_status()
result = response.json()
if result['code'] == 0:
print(f"{Fore.GREEN + Style.BRIGHT}\r[ Task ] : Task {task_id} finished. Bonus: {result['data']['bonusAmount']}", flush=True)
return True
else:
# JOIN TELEGRAM : https://t.me/apsstudiotech
# JOIN DISCORD : https://discord.gg/N9caefVJ7F
# print(result)
print(f"{Fore.RED + Style.BRIGHT}\r[ Task ] : Failed to finish task {task_id}: {result['message']}", flush=True)
return False
except Exception as e:
print(f"{Fore.RED + Style.BRIGHT}\r[ Task ] : Error: {e}", flush=True)
return False
def process_tasks(token):
tasks = fetch_task_list(token)
if tasks:
for task in tasks:
if task['taskStatus'] == 0: # Jika tugas belum diklaim
finish_task(token, task['taskId'])
else:
print(f"{random.choice(available_colors)+Style.BRIGHT}\r[ Task ] : Task already finished ", flush=True)
import random
def upgrade_level(token, current_level, target_level, upgrade_type):
url = 'https://api.yescoin.gold/build/levelUp'
headers = get_headers(token)
data = json.dumps(upgrade_type)
if upgrade_type == '1':
upgrade_type_name = 'Multi Value'
else:
upgrade_type_name = 'Fill Rate'
# Lakukan upgrade hingga mencapai level target
while current_level < target_level:
response = requests.post(url, headers=headers, data=data)
response.raise_for_status()
result = response.json()
if result['code'] == 0:
current_level += 1
print(f"{random.choice(available_colors)+Style.BRIGHT}\r[ Upgrade ] : {upgrade_type_name} Upgrade to {current_level} ", flush=True)
else:
print(f"{random.choice(available_colors)+Style.BRIGHT}\r[ Upgrade ] : Failed to upgrade: {result['message']} ", flush=True)
break
if current_level == target_level:
print(f"{random.choice(available_colors)+Style.BRIGHT}\r[ Upgrade ] : {upgrade_type_name} already at level {current_level} ", flush=True)
def main():
tokens = load_tokens('tokens.txt')
while True:
print_welcome_message()
for index, token in enumerate(tokens):
nickname = get_my_user_nick(token)
print(f"{Fore.BLUE + Style.BRIGHT}\n========[{Fore.WHITE + Style.BRIGHT} Akun {index + 1} | {nickname} {Fore.BLUE + Style.BRIGHT}]========")
print(f"{random.choice(available_colors)+Style.BRIGHT}\r[ Squad ] : Getting...", end="", flush=True)
squad_info = fetch_squad_info(token)
if squad_info and squad_info['data']['isJoinSquad']:
squad_title = squad_info['data']['squadInfo']['squadTitle']
squad_members = squad_info['data']['squadInfo']['squadMembers']
print(f"{random.choice(available_colors)+Style.BRIGHT}\r[ Squad ] : {squad_title} | {squad_members} Members")
else:
print(f"{Fore.YELLOW + Style.BRIGHT}\r[ Squad ] : Belum Join Squad. Joining APS Studio.", end="", flush=True)
time.sleep(3)
join_result = join_squad(token, "t.me/apsstudiotech")
if join_result:
print(f"{random.choice(available_colors) + Style.BRIGHT}\r[ Squad ] : Welcome Pemulung {nickname} - APS Studio ! ", flush=True)
else:
print(f"{random.choice(available_colors) + Style.BRIGHT}\r[ Squad ] : Failed to join APS Studio.", flush=True)
print(f"{random.choice(available_colors)+Style.BRIGHT}\r[ Balance ] : Getting...", end="", flush=True)
balance = fetch_account_info(token)
if balance is None:
print(f"{Fore.RED}\r[ Balance ] : Failed to get balance", flush=True)
continue
else:
balance = balance.get('data', {}).get('currentAmount', 0)
balance = f"{balance:,}".replace(',', '.')
print(f"{random.choice(available_colors) + Style.BRIGHT}\r[ Balance ] : {balance} ", flush=True)
print(f"{random.choice(available_colors)+Style.BRIGHT}\r[ Game Info ] : Getting...", end="", flush=True)
game_info = fetch_account_build_info(token)
if game_info is None:
print(f"{Fore.RED}\r[ Game Info ] : Failed to get data", flush=True)
continue
else:
special_box_left_recovery_count = game_info['data'].get('specialBoxLeftRecoveryCount', 0)
coin_pool_left_recovery_count = game_info['data'].get('coinPoolLeftRecoveryCount', 0)
single_coin_value = game_info['data'].get('singleCoinValue', 0)
single_coin_level = game_info['data'].get('singleCoinLevel', 0)
coin_pool_recovery_speed = game_info['data'].get('coinPoolRecoverySpeed', 0)
print(f"{random.choice(available_colors)+Style.BRIGHT}\r[ Booster ] : Chest {special_box_left_recovery_count} | Recovery {coin_pool_left_recovery_count}", flush=True)
print(f"{random.choice(available_colors)+Style.BRIGHT}\r[ Multivalue ] : Level {single_coin_value}", flush=True)
print(f"{random.choice(available_colors)+Style.BRIGHT}\r[ Coin Limit ] : Level {single_coin_level}", flush=True)
print(f"{random.choice(available_colors)+Style.BRIGHT}\r[ Fill Rate ] : Level {coin_pool_recovery_speed}", flush=True)
if cek_task_enable == 'y':
print(f"{random.choice(available_colors)+Style.BRIGHT}\r[ Task ] : Trying to finish task..", end="", flush=True)
process_tasks(token)
time.sleep(2)
if upgrade_multi_enable == 'y':
print(f"{random.choice(available_colors)+Style.BRIGHT}\r[ Upgrade ] : Upgrading Multi Value...", end="", flush=True)
upgrade_level(token, single_coin_value, max_level, '1')
time.sleep(2)
if upgrade_fill_enable == 'y':
print(f"{random.choice(available_colors)+Style.BRIGHT}\r[ Upgrade ] : Upgrading Fill Rate...", end="", flush=True)
upgrade_level(token, coin_pool_recovery_speed, max_level, '2')
print(f"{random.choice(available_colors)+Style.BRIGHT}\r[ Game Info ] : Getting...", end="", flush=True)
collect_info = fetch_game_info(token)
if collect_info is None:
print(f"{Fore.RED}\r[ Game Info ] : Failed to get data", flush=True)
continue
else:
single_coin_value = collect_info['data'].get('singleCoinValue', 0)
coin_pool_left_count = collect_info['data'].get('coinPoolLeftCount', 0)
print(f"{random.choice(available_colors) + Style.BRIGHT}\r[ Coin Left ] : {coin_pool_left_count} ", flush=True)
print(f"{random.choice(available_colors)+Style.BRIGHT}\r[ Collect ] : Collecting Coin...", end="", flush=True)
if coin_pool_left_count > 0:
amount = coin_pool_left_count // single_coin_value
collect_result = collect_coin(token, amount)
if collect_result and collect_result.get('code') == 0:
collected_amount = collect_result['data']['collectAmount']
print(f"{random.choice(available_colors) + Style.BRIGHT}\r[ Collect ] : Collected {random.choice(available_colors)+Style.BRIGHT}{collected_amount} ", flush=True)
else:
print(f"{random.choice(available_colors)+Style.BRIGHT}\r[ Collect ] : Failed to collect coins", flush=True)
print(f"{random.choice(available_colors)+Style.BRIGHT}\r[ Chest ] : Trying to activate...", end="", flush=True)
if game_info and game_info['data'].get('specialBoxLeftRecoveryCount', 0) > 0:
if use_special_box(token):
print(f"{random.choice(available_colors)+Style.BRIGHT}\r[ Chest ] : Collecting...", end="", flush=True)
collected_amount = attempt_collect_special_box(token, 2, 240) # Contoh: box_type=2, coin_count=250
else:
print(f"{random.choice(available_colors)+Style.BRIGHT}\r[ Chest ] : No chest available ", flush=True)
time.sleep(2)
print(f"{random.choice(available_colors)+Style.BRIGHT}\r[ Recovery ] : Trying to recover...", end="", flush=True)
game_info = fetch_account_build_info(token)
if game_info and game_info['data'].get('coinPoolLeftRecoveryCount', 0) > 0:
if recover_coin_pool(token):
# Setelah pemulihan, coba kumpulkan koin lagi
# JOIN TELEGRAM : https://t.me/apsstudiotech
# JOIN DISCORD : https://discord.gg/N9caefVJ7F
collect_info = fetch_game_info(token)
if collect_info:
coin_pool_left_count = collect_info['data'].get('coinPoolLeftCount', 0)
if coin_pool_left_count > 0:
amount = coin_pool_left_count // game_info['data'].get('singleCoinValue', 1)
collect_result = collect_coin(token, amount)
if collect_result and collect_result.get('code') == 0:
collected_amount = collect_result['data']['collectAmount']
print(f"{Fore.GREEN + Style.BRIGHT}\r[ Collect ] : Berhasil mengumpulkan {collected_amount} koin", flush=True)
else:
print(f"{Fore.RED + Style.BRIGHT}\r[ Collect ] : Gagal mengumpulkan koin", flush=True)
else:
print(f"{random.choice(available_colors)+Style.BRIGHT}\r[ Recovery ] : No recovery available", flush=True)
time.sleep(2)
print(f"{random.choice(available_colors)+Style.BRIGHT}\r[ Free Chest ] : Trying to collect..", end="", flush=True)
collected_amount = attempt_collect_special_box(token, 1, 200)
time.sleep(2)
print(f"\n{random.choice(available_colors)+Style.BRIGHT}========={Fore.WHITE+Style.BRIGHT}Semua akun berhasil di proses{Fore.GREEN+Style.BRIGHT}=========", end="", flush=True)
import sys
waktu_tunggu = 15 # 5 menit dalam detik
for detik in range(waktu_tunggu, 0, -1):
sys.stdout.write(f"\r{Fore.CYAN}Menunggu waktu claim berikutnya dalam {Fore.CYAN}{Fore.WHITE}{detik // 60} menit {Fore.WHITE}{detik % 60} detik")
sys.stdout.flush()
time.sleep(1)
sys.stdout.write("\rWaktu claim berikutnya telah tiba! \n")
import argparse
def parse_arguments():
parser = argparse.ArgumentParser(description='Blum BOT')
parser.add_argument('--task', type=str, choices=['y', 'n'], help='Cek and Claim Task (y/n)')
parser.add_argument('--multi', type=str, choices=['y', 'n'], help='Upgrade Multi Value (y/n)')
parser.add_argument('--fill', type=str, choices=['y', 'n'], help='Upgrade Fill Rate (y/n)')
parser.add_argument('--max-level', type=int, help='Level maksimum untuk upgrade (default: 5)')
args = parser.parse_args()
if args.task is None:
task_input = input("Apakah Anda ingin cek dan claim task? (y/n, default n): ").strip().lower()
args.task = task_input if task_input in ['y', 'n'] else 'n'
if args.multi is None:
multi_input = input("Apakah Anda ingin upgrade multi value? (y/n, default n): ").strip().lower()
args.multi = multi_input if multi_input in ['y', 'n'] else 'n'
if args.fill is None:
fill_input = input("Apakah Anda ingin upgrade fill rate? (y/n, default n): ").strip().lower()
args.fill = fill_input if fill_input in ['y', 'n'] else 'n'
if (args.multi == 'y' or args.fill == 'y') and args.max_level is None:
max_level_input = input("Masukkan level maksimum untuk upgrade (default: 5): ").strip()
args.max_level = int(max_level_input) if max_level_input else 5
elif args.max_level is None:
args.max_level = 5 # Default value if max_level is not provided and neither multi nor fill is 'y'
return args
args = parse_arguments()
cek_task_enable = args.task
upgrade_multi_enable = args.multi
upgrade_fill_enable = args.fill
max_level = args.max_level
if __name__ == '__main__':
main()