├── data.txt ├── proxies.txt ├── wallet.txt ├── tokens.json ├── requirements.txt ├── balance.txt ├── config.json ├── README.md └── bot.py /data.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /proxies.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /wallet.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tokens.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | requests 2 | requests[socks] 3 | colorama -------------------------------------------------------------------------------- /balance.txt: -------------------------------------------------------------------------------- 1 | Time / num_acc / Name / Balance / rank / Result_connect_wallet / Avatar_task / Wallet 2 | 2024-10-29 19:14 / 1 / Елена / 1094171 / Silver II / Successfully connected wallet! / Done / UQAt8ePz1DA_E_ksEC5rng6fhNkchzW5N1PSu_GO7cFOihhO 3 | 2024-10-29 19:14 / total_balance: / 1094171 4 | -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "interval": 1, 3 | "play_game": false, 4 | "change_tomato_to_star": false, 5 | "claim_weekly_airdrop": false, 6 | "complete_task": false, 7 | "use_free_spin": true, 8 | "unlock_levels": false, 9 | "upgrade_max_level": false, 10 | "share_tg_after_upgrade": false, 11 | "connect_wallet": false, 12 | "game_point": { 13 | "low": 100, 14 | "high": 150 15 | }, 16 | 17 | "additional_time": { 18 | "min": 60, 19 | "max": 90 20 | } 21 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Tomarket Bot Telegram Automation Script 2 | 3 | Auto Claim for tomarket Telegram Bot 4 | 5 | [TELEGRAM CHANNEL](https://t.me/cucumber_scripts) 6 | 7 | Update 8 | 9 | # Warning 10 | 11 | All Risks are borne by the user! 12 | 13 | # Updates 14 | ### 10.10.24 add: 15 | - Auto complete tasks 16 | - Auto use free spin 17 | - Auto unlock levels 18 | - Auto upgrade max level 19 | - Auto share tg after upgrade 20 | 21 | ### 20.10.24 add: 22 | - Auto puzzle 23 | 24 | # Features 25 | 26 | - [x] Auto Claim 27 | - [x] Multi Account Support 28 | - [x] Auto Play Game 29 | - [x] Auto complete tasks 30 | - [x] Auto use free spin 31 | - [x] Auto unlock levels 32 | - [x] Auto upgrade max level 33 | - [x] Auto share tg after upgrade 34 | - [x] Proxy Support 35 | - [x] Auto puzzle 36 | 37 | # Register 38 | 39 | Click the following url to register : https://t.me/Tomarket_ai_bot/app?startapp=00019Ome 40 | 41 | # How to Use 42 | 43 | ## About Config 44 | 45 | | Name | Description | 46 | |-----------------------|------------------------------------------------------------------------------| 47 | | interval | downtime between account | 48 | | play_game | value must bool (true/false) set true for enable auto play game after claim | 49 | | complete_task | value must bool (true/false) set true for enable auto complete_task | 50 | | use_free_spin | value must bool (true/false) set true for enable auto use_free_spin | 51 | | change_tomato_to_star | (true/false) | 52 | | claim_weekly_airdrop | (true/false) | 53 | | unlock_levels | value must bool (true/false) set true for enable auto unlock_levels | 54 | | upgrade_max_level | value must bool (true/false) set true for enable auto upgrade_max_level | 55 | | share_tg_after_upgrade | value must bool (true/false) set true for enable auto share_tg_after_upgrade | 56 | | game_point | low : minimum earn from play game
high : maximum earn from play game | 57 | 58 | 59 | 60 | ## About Proxy 61 | 62 | 63 | You can add your proxy list in `proxies.txt` and proxy format is like example below : 64 | 65 | Format : 66 | 67 | ``` 68 | http://host:port 69 | http://user:pass@host:port 70 | ``` 71 | 72 | Example : 73 | 74 | ``` 75 | http://127.0.0.1:6969 76 | http://user:pass@127.0.0.1:6969 77 | socks5://127.0.0.1:6969 78 | socks5://user:pass@127.0.0.1:6969 79 | ``` 80 | 81 | ## Windows 82 | 83 | 1. Make sure you computer was installed python and git. 84 | 85 | python site : [https://python.org](https://python.org) 86 | 87 | git site : [https://git-scm.com/](https://git-scm.com/) 88 | 89 | 2. Clone this repository 90 | ```shell 91 | git clone https://github.com/cucumber-pickle/tomarketCum.git 92 | ``` 93 | 94 | 3. go to tomarketod directory 95 | ``` 96 | cd tomarketCum 97 | ``` 98 | 99 | 4. install the require library 100 | ``` 101 | python -m pip install -r requirements.txt 102 | ``` 103 | 104 | 5. Edit `data.txt`, input you data token in `data.txt` . One line for one data account, if you want add you second account add in new line! 105 | 106 | 6. execute the main program 107 | ``` 108 | python bot.py 109 | ``` 110 | 111 | ## Linux 112 | 113 | 1. Make sure you computer was installed python and git. 114 | 115 | python 116 | ```shell 117 | sudo apt install python3 python3-pip 118 | ``` 119 | git 120 | ```shell 121 | sudo apt install git 122 | ``` 123 | 124 | 2. Clone this repository 125 | 126 | ```shell 127 | git clone https://github.com/cucumber-pickle/tomarketCum.git 128 | ``` 129 | 130 | 3. goto tomarketod directory 131 | 132 | ```shell 133 | cd tomarketCum 134 | ``` 135 | 136 | 4. Install the require library 137 | 138 | ``` 139 | python3 -m pip install -r requirements.txt 140 | ``` 141 | 142 | 5. Edit `data.txt`, input you data token in `data.txt`. One line for one data account, if you want add you second account add in new line! 143 | 144 | 6. execute the main program 145 | ``` 146 | python bot.py 147 | ``` 148 | 149 | 150 | ## How to get tgWebAppData (query_id / user_id) 151 | 152 | 1. Login telegram via portable or web version 153 | 2. Launch the bot 154 | 3. Press `F12` on the keyboard 155 | 4. Open console 156 | 5. Сopy this code in Console for getting tgWebAppData (user= / query=): 157 | 158 | ```javascript 159 | copy(decodeURIComponent(sessionStorage.SourceTarget).split('#tgWebAppData=')[1].split('&tgWebAppVersion=')[0]) 160 | ``` 161 | 162 | 6. you will get data that looks like this 163 | 164 | ``` 165 | query_id=AA.... 166 | user=%7B%22id%.... 167 | ``` 168 | 7. add it to `data.txt` file or create it if you dont have one 169 | 170 | 171 | ## This bot helpfull? Please support me by buying me a coffee: 172 | ``` 0xc4bb02b8882c4c88891b4196a9d64a20ef8d7c36 ``` - BSC (BEP 20) 173 | 174 | ``` UQBiNbT2cqf5gLwjvfstTYvsScNj-nJZlN2NSmZ97rTcvKz0 ``` - TON 175 | 176 | ``` 0xc4bb02b8882c4c88891b4196a9d64a20ef8d7c36 ``` - Optimism 177 | 178 | ``` THaLf1cdEoaA73Kk5yiKmcRwUTuouXjM17 ``` - TRX (TRC 20) 179 | 180 | ## License 181 | This project is licensed under the MIT License - see the LICENSE file for details. 182 | 183 | ## Contact 184 | For questions or support, please contact [CUCUMBER TG CHAT](https://t.me/cucumber_scripts_chat) -------------------------------------------------------------------------------- /bot.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import json 4 | import time 5 | import random 6 | import argparse 7 | import requests 8 | from base64 import b64decode, urlsafe_b64decode 9 | from datetime import datetime 10 | from urllib.parse import parse_qs 11 | from colorama import init, Fore, Style 12 | import http 13 | from platform import system as s_name 14 | from os import system as sys 15 | 16 | merah = Fore.LIGHTRED_EX 17 | kuning = Fore.LIGHTYELLOW_EX 18 | hijau = Fore.LIGHTGREEN_EX 19 | biru = Fore.LIGHTBLUE_EX 20 | putih = Fore.LIGHTWHITE_EX 21 | hitam = Fore.LIGHTBLACK_EX 22 | reset = Style.RESET_ALL 23 | line = putih + "~" * 50 24 | 25 | 26 | class Tomartod: 27 | def __init__(self): 28 | self.headers = { 29 | "host": "api-web.tomarket.ai", 30 | "connection": "keep-alive", 31 | "accept": "application/json, text/plain, */*", 32 | "user-agent": "Mozilla/5.0 (Linux; Android 10; Redmi 4A / 5A Build/QQ3A.200805.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/86.0.4240.185 Mobile Safari/537.36", 33 | "content-type": "application/json", 34 | "origin": "https://mini-app.tomarket.ai", 35 | "x-requested-with": "tw.nekomimi.nekogram", 36 | "sec-fetch-site": "same-site", 37 | "sec-fetch-mode": "cors", 38 | "sec-fetch-dest": "empty", 39 | "referer": "https://mini-app.tomarket.ai/", 40 | "accept-language": "en-US,en;q=0.9", 41 | } 42 | self.marinkitagawa = lambda data: { 43 | key: value[0] for key, value in parse_qs(data).items() 44 | } 45 | 46 | 47 | 48 | def set_proxy(self, proxy=None): 49 | self.ses = requests.Session() 50 | if proxy is not None: 51 | self.ses.proxies.update({"http": proxy, "https": proxy}) 52 | 53 | def set_authorization(self, auth): 54 | self.headers["authorization"] = auth 55 | 56 | def del_authorization(self): 57 | if "authorization" in self.headers.keys(): 58 | self.headers.pop("authorization") 59 | 60 | def login(self, data, acc, un): 61 | url = "https://api-web.tomarket.ai/tomarket-game/v1/user/login" 62 | data = json.dumps( 63 | { 64 | "init_data": data, 65 | "invite_code": "", 66 | } 67 | ) 68 | self.del_authorization() 69 | res = self.http(url, self.headers, data) 70 | if res.status_code != 200: 71 | self.log(f"{merah}failed fetch token authorization, check http.log !") 72 | now = datetime.now().strftime("%Y-%m-%d %H:%M") 73 | open("http.log", "a", encoding="utf-8").write( 74 | f"{now} / {acc} / {un} / res !200\n") 75 | return None 76 | data = res.json().get("data") 77 | token = data.get("access_token") 78 | if token is None: 79 | self.log(f"{merah}failed fetch token authorization, check http.log !") 80 | now = datetime.now().strftime("%Y-%m-%d %H:%M") 81 | open("http.log", "a", encoding="utf-8").write( 82 | f"{now} / {acc} / {un} / failed fetch token authorization \n") 83 | return None 84 | return token 85 | 86 | def start_farming(self): 87 | data = json.dumps({"game_id": "53b22103-c7ff-413d-bc63-20f6fb806a07"}) 88 | url = "https://api-web.tomarket.ai/tomarket-game/v1/farm/start" 89 | res = self.http(url, self.headers, data) 90 | if res.status_code != 200: 91 | self.log(f"{merah}failed start farming!") 92 | return False 93 | 94 | data = res.json().get("data") 95 | if isinstance(data, dict): # Ensure data is a dictionary 96 | end_farming = data.get("end_at") # Use .get() to avoid KeyError 97 | if end_farming is None: 98 | self.log(f"{merah}end_at not found in response!") 99 | return False 100 | format_end_farming = ( 101 | datetime.fromtimestamp(end_farming).isoformat(" ").split(".")[0] 102 | ) 103 | self.log(f"{hijau}success start farming !") 104 | else: 105 | self.log(f"{merah}Unexpected response format: {data}") 106 | 107 | def end_farming(self): 108 | data = json.dumps({"game_id": "53b22103-c7ff-413d-bc63-20f6fb806a07"}) 109 | url = "https://api-web.tomarket.ai/tomarket-game/v1/farm/claim" 110 | res = self.http(url, self.headers, data) 111 | if res.status_code != 200: 112 | self.log(f"{merah}failed start farming!") 113 | return False 114 | 115 | poin = res.json()["data"]["claim_this_time"] 116 | self.log(f"{hijau}success claim farming !") 117 | self.log(f"{hijau}reward : {putih}{poin}") 118 | 119 | def daily_claim(self): 120 | url = "https://api-web.tomarket.ai/tomarket-game/v1/daily/claim" 121 | data = json.dumps({"game_id": "fa873d13-d831-4d6f-8aee-9cff7a1d0db1"}) 122 | res = self.http(url, self.headers, data) 123 | if res.status_code != 200: 124 | self.log(f"{merah}failed claim daily sign!") 125 | return False 126 | 127 | data = res.json().get("data") 128 | if isinstance(data, str): 129 | self.log(f"{kuning}maybe already sign in") 130 | return 131 | 132 | poin = data.get("today_points") 133 | self.log( 134 | f"{hijau}success claim {biru}daily sign {hijau}reward : {putih}{poin} !" 135 | ) 136 | return 137 | def get_tasks_list(self, token): 138 | url = "https://api-web.tomarket.ai/tomarket-game/v1/tasks/list" 139 | data = json.dumps({"init_data": token, "language_code":"ru"}) 140 | res = self.http(url, self.headers, data) 141 | if res.status_code != 200: 142 | self.log(f"{merah}failed get_tasks_lis") 143 | return None 144 | tasks = res.json().get("data") 145 | return tasks 146 | 147 | def start_task(self,token, task_id): 148 | url = "https://api-web.tomarket.ai/tomarket-game/v1/tasks/start" 149 | data = json.dumps({"init_data": token, "task_id": task_id}) 150 | res = self.http(url, self.headers, data) 151 | if res.status_code != 200: 152 | self.log(f"{merah}failed start_task!") 153 | return False 154 | return res 155 | 156 | def check_task(self,token, task_id): 157 | url = "https://api-web.tomarket.ai/tomarket-game/v1/tasks/check" 158 | data = json.dumps({"init_data": token, "task_id": task_id}) 159 | res = self.http(url, self.headers, data) 160 | if res.status_code != 200: 161 | self.log(f"{merah}failed check_task!") 162 | return None 163 | return res.json() 164 | 165 | def claim_task(self, task_id): 166 | url = "https://api-web.tomarket.ai/tomarket-game/v1/tasks/claim" 167 | data = json.dumps({"task_id": task_id}) 168 | res = self.http(url, self.headers, data) 169 | if res.status_code != 200: 170 | self.log(f"{merah}failed claim_task!") 171 | return None 172 | return res.json() 173 | 174 | def play_game_func(self, amount_pass): 175 | data_game = json.dumps({"game_id": "59bcd12e-04e2-404c-a172-311a0084587d"}) 176 | start_url = "https://api-web.tomarket.ai/tomarket-game/v1/game/play" 177 | claim_url = "https://api-web.tomarket.ai/tomarket-game/v1/game/claim" 178 | for i in range(amount_pass): 179 | res = self.http(start_url, self.headers, data_game) 180 | if res.status_code != 200: 181 | self.log(f"{merah}failed start game !") 182 | return 183 | 184 | self.log(f"{hijau}success {biru}start{hijau} game !") 185 | self.countdown(30) 186 | point = random.randint(self.game_low_point, self.game_high_point) 187 | data_claim = json.dumps( 188 | {"game_id": "59bcd12e-04e2-404c-a172-311a0084587d", "points": point} 189 | ) 190 | res = self.http(claim_url, self.headers, data_claim) 191 | if res.status_code != 200: 192 | self.log(f"{merah}failed claim game point !") 193 | continue 194 | 195 | self.log(f"{hijau}success {biru}claim{hijau} game point : {putih}{point}") 196 | 197 | 198 | def evaluate_stars(self): 199 | url = "https://api-web.tomarket.ai/tomarket-game/v1/rank/evaluate" 200 | res = self.http(url, self.headers, "") 201 | if res.status_code != 200: 202 | self.log(f"{merah}failed unlock levels!") 203 | return False 204 | return res.json() 205 | 206 | 207 | 208 | def unlocking_levels(self): 209 | url = "https://api-web.tomarket.ai/tomarket-game/v1/rank/create" 210 | res = self.http(url, self.headers, "") 211 | if res.status_code != 200: 212 | self.log(f"{merah}failed unlock levels!") 213 | return False 214 | current_rank = res.json().get('data').get('currentRank').get('name') 215 | return current_rank 216 | 217 | 218 | def rank(self, token): 219 | url = "https://api-web.tomarket.ai/tomarket-game/v1/rank/data" 220 | data = json.dumps({"init_data": token, "language_code": "ru"}) 221 | res = self.http(url, self.headers, data) 222 | 223 | if res.status_code != 200: 224 | self.log(f"{merah}failed get rank!") 225 | return False 226 | if res.json().get('data').get('isCreated') == False: 227 | return None 228 | rank = res.json().get('data').get('currentRank').get('name') 229 | current_lvl = res.json().get('data').get('currentRank').get('level') 230 | unusedStars = res.json().get('data').get('unusedStars') 231 | usedStars = res.json().get('data').get('usedStars') 232 | return [rank, current_lvl, unusedStars, usedStars] 233 | 234 | def count_tickets(self, token): 235 | url = "https://api-web.tomarket.ai/tomarket-game/v1/user/tickets" 236 | data = json.dumps({"init_data": token, "language_code": "ru"}) 237 | res = self.http(url, self.headers, data) 238 | if res.status_code != 200: 239 | self.log(f"{merah}failed get tickets!") 240 | return False 241 | tickets = res.json().get('data').get('ticket_spin_1') 242 | return tickets 243 | 244 | def get_puzzle_status(self, token): 245 | url = "https://api-web.tomarket.ai/tomarket-game/v1/tasks/puzzle" 246 | data = json.dumps({"init_data": token, "language_code": "ru"}) 247 | res = self.http(url, self.headers, data) 248 | if res.status_code != 200: 249 | self.log(f"{merah}failed get tickets!") 250 | return False 251 | return res.json() 252 | 253 | def raffle(self): 254 | url = "https://api-web.tomarket.ai/tomarket-game/v1/spin/raffle" 255 | data = json.dumps({"category": "ticket_spin_1"}) 256 | res = self.http(url, self.headers, data) 257 | if res.status_code != 200: 258 | self.log(f"{merah}failed raffle!") 259 | return False 260 | 261 | amount = res.json().get('data').get('results')[0].get('amount') 262 | amount_type = res.json().get('data').get('results')[0].get('type') 263 | return amount, amount_type 264 | 265 | def max_level(self, unused_stars): 266 | url = "https://api-web.tomarket.ai/tomarket-game/v1/rank/upgrade" 267 | data = json.dumps({"stars": unused_stars}) 268 | res = self.http(url, self.headers, data) 269 | if res.status_code != 200: 270 | self.log(f"{merah}failed update lvl") 271 | return False 272 | return res.json() 273 | 274 | def connection_wallet(self, wallet): 275 | url = "https://api-web.tomarket.ai/tomarket-game/v1/tasks/address" 276 | data = json.dumps({"wallet_address": wallet}) 277 | res = self.http(url, self.headers, data) 278 | if res and res.status_code != 200: 279 | self.log(f"{merah}failed connect_wallet") 280 | return "Failed to connect wallet!" 281 | if res.json().get('status') == 0: 282 | self.log(f"Successfully connected wallet!") 283 | return "Successfully connected wallet!" 284 | elif res.json().get('status') == 500: 285 | self.log(f"Failed! - {res.json().get('message')}") 286 | return f"Failed! - {res.json().get('message')}" 287 | else: 288 | self.log(f"{merah}failed connect_wallet") 289 | return "Failed to connect wallet!" 290 | 291 | def response_data(self, response): 292 | if response.status_code >= 500: 293 | print_timestamp(f"Error {response.status_code}") 294 | return None 295 | elif response.status_code >= 400: 296 | print_timestamp(f"Error {response.status_code} : msg {response.text}") 297 | return None 298 | elif response.status_code >= 200: 299 | return response.json() 300 | else: 301 | return None 302 | 303 | def get_combo_puzzle(self): 304 | url = 'https://raw.githubusercontent.com/boytegar/TomarketBOT/refs/heads/master/combo.json' 305 | response = requests.get(url) 306 | data = self.response_data(response) 307 | return data 308 | 309 | def find_by_id(self, json_data, id): 310 | for key, value in json_data.items(): 311 | if key == id: 312 | return value 313 | return None 314 | 315 | def claim_puzzle(self, task_id): 316 | url = "https://api-web.tomarket.ai/tomarket-game/v1/tasks/puzzleClaim" 317 | list_combo = self.get_combo_puzzle() 318 | combo = self.find_by_id(list_combo, str(task_id)) 319 | answer = combo 320 | self.log(f"{kuning}Trying claim puzzle, answer - {putih}{answer}") 321 | data = json.dumps({"code": answer, 322 | "task_id": task_id}) 323 | res = self.http(url, self.headers, data) 324 | if res.status_code != 200: 325 | self.log(f"{merah}failed claim puzzle") 326 | return None 327 | return res.json() 328 | 329 | def check_airdrop(self, token): 330 | url = "https://api-web.tomarket.ai/tomarket-game/v1/token/check" 331 | data = json.dumps({"init_data": token, "language_code": "ru", "round": "One"}) 332 | res = self.http(url, self.headers, data) 333 | # print(res.status_code) 334 | # print(res.text) 335 | if res.status_code != 200: 336 | self.log(f"{merah}failed check_airdrop") 337 | return None, None 338 | try: 339 | amount = res.json().get('data').get('tomaAirDrop').get("amount") 340 | wallet = res.json().get('data').get('walletAddress') 341 | return amount, wallet 342 | except Exception as e: 343 | self.log(e) 344 | self.log(f"{merah}failed check_airdrop") 345 | return None, None 346 | 347 | def check_balance_now(self, token): 348 | url = "https://api-web.tomarket.ai/tomarket-game/v1/token/balance" 349 | data = json.dumps({"init_data": token, "language_code": "ru"}) 350 | res = self.http(url, self.headers, data) 351 | # print(res.status_code) 352 | # print(res.text) 353 | if res.status_code != 200: 354 | self.log(f"{merah}failed check_balance_now") 355 | return None 356 | try: 357 | amount = res.json().get('data').get('total') 358 | return amount 359 | except Exception as e: 360 | self.log(e) 361 | self.log(f"{merah}failed check_balance_now") 362 | return None 363 | 364 | def claim_weekly(self, token): 365 | url = "https://api-web.tomarket.ai/tomarket-game/v1/token/claim" 366 | data = json.dumps({"round": "Five"}) 367 | res = self.http(url, self.headers, data) 368 | if res.status_code != 200: 369 | self.log(f"{merah}failed claim weekly airdrop") 370 | return None 371 | try: 372 | status = res.json().get('status') 373 | if status == 500: 374 | self.log(f"{merah}Weekly airdrop has already been claimed") 375 | return None 376 | amount = res.json().get('data').get('amount') 377 | return amount 378 | except Exception as e: 379 | self.log(e) 380 | self.log(f"{merah}failed claim weekly airdrop") 381 | return None 382 | 383 | def claim_airdrop(self): 384 | url = "https://api-web.tomarket.ai/tomarket-game/v1/token/claim" 385 | data = json.dumps({"round": "One"}) 386 | res = self.http(url, self.headers, data) 387 | print(res.status_code) 388 | print(res.text) 389 | if res.status_code != 200: 390 | self.log(f"{merah}failed claim_airdrop") 391 | return None 392 | try: 393 | amount = res.json().get('data').get("amount") 394 | return amount 395 | except Exception as e: 396 | self.log(e) 397 | self.log(f"{merah}failed claim_airdrop") 398 | return None 399 | 400 | def claim_launchpad_task(self): 401 | url = "https://api-web.tomarket.ai/tomarket-game/v1/launchpad/taskClaim" 402 | data = json.dumps({"launchpad_id": 3, "task_id": 10074}) 403 | print(data) 404 | res = self.http(url, self.headers, data) 405 | print(res.status_code) 406 | print(res.text) 407 | if res.status_code != 200: 408 | self.log(f"{merah}failed claim_launchpad_task") 409 | try: 410 | result = res.json() 411 | print(result) 412 | except Exception as e: 413 | self.log(e) 414 | self.log(f"{merah}failed claim_launchpad_task") 415 | 416 | def invest_Toma(self, amount): 417 | url = "https://api-web.tomarket.ai/tomarket-game/v1/launchpad/investToma" 418 | data = json.dumps({"launchpad_id": 3, "amount": amount}) 419 | print(data) 420 | res = self.http(url, self.headers, data) 421 | print(res.status_code) 422 | print(res.text) 423 | if res.status_code != 200: 424 | self.log(f"{merah}failed invest_Toma") 425 | try: 426 | result = res.json().get('data').get("success") 427 | print(result) 428 | except Exception as e: 429 | self.log(e) 430 | self.log(f"{merah}failed invest_Toma") 431 | 432 | def claim_duck(self): 433 | url = "https://api-web.tomarket.ai/tomarket-game/v1/launchpad/claimFormInfo" 434 | data = json.dumps({"launchpad_id": 2}) 435 | print(data) 436 | res = self.http(url, self.headers, data) 437 | print(res.status_code) 438 | print(res.text) 439 | if res.status_code != 200: 440 | self.log(f"{merah}failed claim_duck") 441 | try: 442 | result = res.json().get('data') 443 | print(result) 444 | except Exception as e: 445 | self.log(e) 446 | self.log(f"{merah}failed claim_duck") 447 | 448 | def claim_pgc(self, address, market_uid): 449 | url = "https://api-web.tomarket.ai/tomarket-game/v1/launchpad/claimForm" 450 | data = json.dumps({"launchpad_id": 3, 451 | "address": address, 452 | "market":"bitget", 453 | "market_uid":market_uid, 454 | "memo":""}) 455 | 456 | print(data) 457 | res = self.http(url, self.headers, data) 458 | print(res.status_code) 459 | print(res.text) 460 | if res.status_code != 200: 461 | self.log(f"{merah}failed claim pgc") 462 | try: 463 | result = res.json().get('data').get("success") 464 | print(result) 465 | except Exception as e: 466 | self.log(e) 467 | self.log(f"{merah}failed claim pgc") 468 | 469 | def sharetg(self): 470 | url = "https://api-web.tomarket.ai/tomarket-game/v1/rank/sharetg" 471 | res = self.http(url, self.headers, "") 472 | if res.status_code != 200: 473 | self.log(f"{merah}failed share tg") 474 | return False 475 | if res.json().get('status') == 0: 476 | return "ok" 477 | 478 | def tomato_to_star(self): 479 | url = "https://api-web.tomarket.ai/tomarket-game/v1/token/tomatoToStar" 480 | res = self.http(url, self.headers, "") 481 | if res.status_code != 200: 482 | self.log(f"{merah}failed change tomato_to_star") 483 | return False 484 | if res.json().get('status') == 0: 485 | return "ok" 486 | 487 | def answer(self): 488 | url = 'https://raw.githubusercontent.com/Shyzg/answer/refs/heads/main/answer.json' 489 | try: 490 | res = requests.get(url=url) 491 | return res.json() 492 | except: 493 | return None 494 | 495 | 496 | def get_balance(self, token, acc, user_name, wallet): 497 | url = "https://api-web.tomarket.ai/tomarket-game/v1/user/balance" 498 | while True: 499 | res = self.http(url, self.headers, "") 500 | if res.status_code != 200: 501 | self.log(f"{merah}failed fetch balance !") 502 | break 503 | data = res.json().get("data") 504 | if data is None: 505 | self.log(f"{merah}failed get data !") 506 | return None 507 | 508 | timestamp = data["timestamp"] 509 | balance = data["available_balance"] 510 | self.log(f"{hijau}balance : {putih}{balance}") 511 | 512 | if "daily" not in data.keys(): 513 | self.daily_claim() 514 | continue 515 | 516 | if data["daily"] is None: 517 | self.daily_claim() 518 | continue 519 | 520 | next_daily = data["daily"]["next_check_ts"] 521 | if timestamp > next_daily: 522 | self.daily_claim() 523 | 524 | if "farming" not in data.keys(): 525 | self.log(f"{kuning}farming not started !") 526 | result = self.start_farming() 527 | continue 528 | 529 | end_farming = data["farming"]["end_at"] 530 | format_end_farming = ( 531 | datetime.fromtimestamp(end_farming).isoformat(" ").split(".")[0] 532 | ) 533 | if timestamp > end_farming: 534 | self.end_farming() 535 | continue 536 | 537 | self.log(f"{kuning}not time to claim !") 538 | self.log(f"{kuning}end farming at : {putih}{format_end_farming}") 539 | 540 | if self.connect_wallet: 541 | result_connect = self.connection_wallet(wallet) 542 | else: 543 | result_connect = None 544 | 545 | rank_info = self.rank(data) 546 | if rank_info: 547 | rank, current_lvl, unused_stars, used_stars = rank_info 548 | self.log(f"{hijau}current_rank: {putih}{rank}, {current_lvl} lvl") 549 | self.log(f"{hijau}unused_stars: {putih}{unused_stars}, {hijau}used_stars: {putih}{used_stars}") 550 | 551 | 552 | if self.unlock_levels and not rank_info: 553 | evaluate_stars = self.evaluate_stars() 554 | if evaluate_stars.get('status') == 500: 555 | self.log(f"{hijau}Levels already unlock") 556 | if evaluate_stars.get('status') == 0: 557 | self.log(f"{hijau}You have - {putih}{evaluate_stars.get('data').get('stars')} stars") 558 | time.sleep(1) 559 | current_rank = self.unlocking_levels() 560 | if current_rank: 561 | self.log(f"{hijau}Levels unlock, your current_rank - {putih}{current_rank}") 562 | else: 563 | self.log(f"{hijau}Levels already unlock") 564 | 565 | if self.upgrade_max_level and rank_info: 566 | result_up = self.max_level(unused_stars) 567 | if result_up.get('status') == 500 : 568 | self.log(f"{merah}Failed ugrade lvl! - {putih}{result_up.get('message')}") 569 | if result_up.get('status') == 0 and result_up.get('data').get('isUpgrade') == True: 570 | current_rank = result_up.get('data').get('currentRank').get('name') 571 | current_lvl = result_up.get('data').get('currentRank').get('level') 572 | self.log(f"{hijau}Lvl ugrade, your current_rank - {putih}{current_rank}, {current_lvl} lvl") 573 | time.sleep(1) 574 | if self.share_tg_after_upgrade: 575 | share_tg = self.sharetg() 576 | if share_tg == "ok": 577 | self.log(f"{hijau}success share tg. Reward: {putih} 2000!") 578 | 579 | if self.use_free_spin: 580 | tickets = int(self.count_tickets(data)) 581 | self.log(f'{hijau}you have {putih}{tickets} tickets') 582 | if tickets > 0: 583 | for i in range(tickets): 584 | amount, amount_type = self.raffle() 585 | self.log(f"{hijau}success claim {putih}{amount} {amount_type}, {merah} ticket {putih} - {i+1} / {tickets}") 586 | time.sleep(3) 587 | 588 | if self.complete_task: 589 | tasks = self.get_tasks_list(token) 590 | if not tasks: 591 | self.log("No tasks found in the 'data' field.") 592 | return 593 | for category, task_list in tasks.items(): 594 | if category == '3rd': 595 | task_list = task_list.get("default") 596 | if isinstance(task_list, list): 597 | for task in task_list: 598 | # need_tasks = [2055, 311, 53, 310, 3048] 599 | skip_tasks = [308, 309, 4031, 267] 600 | task_id = task.get('taskId') 601 | task_name = task.get('name') 602 | # if task_id not in need_tasks: 603 | # continue 604 | if task_id in skip_tasks: 605 | continue 606 | self.log(kuning + f"Completing {task_name}, id{task_id}?") 607 | try: 608 | check = (self.check_task(token, task_id)) 609 | if check: 610 | status = check.get('data').get('status') 611 | if task_name == "TGE Step 1:": 612 | tom_ava = "Done" 613 | if status == 3: 614 | self.log(hijau + f'task already completed!') 615 | continue 616 | 617 | self.log(biru + f'Task not done. Start {task_name}') 618 | completion_response = self.start_task(token, task_id) 619 | time.sleep(1) 620 | 621 | self.log(kuning + f'try claim {task_name}') 622 | claim = self.claim_task(task_id) 623 | if claim and claim.get('status') == 500: 624 | self.log(merah + f"Can't claim task - {putih}{claim.get('message')}") 625 | if claim and claim.get('status') == 0: 626 | self.log(hijau + f'task done!') 627 | time.sleep(1) 628 | 629 | except http.client.RemoteDisconnected as e: 630 | print(f"RemoteDisconnected error occurred: {e}. Moving to next account.") 631 | return # Exit the current account's task processing 632 | else: 633 | self.log(hijau + f"All possible tasks been completed") 634 | 635 | if self.change_tomato_to_star: 636 | msg = self.tomato_to_star() 637 | if msg == "ok": 638 | self.log(f"{hijau}success change_tomato_to_star!") 639 | 640 | if self.claim_weekly_airdrop: 641 | toma = self.claim_weekly(token) 642 | if toma: 643 | self.log(f"{hijau}success claim: {putih}{toma}") 644 | 645 | puzzle = self.get_puzzle_status(token) 646 | puzzle_task = puzzle.get('data')[0].get('taskId') 647 | puzzle_status = puzzle.get('data')[0].get('status') 648 | if puzzle_status == 0: 649 | msg = self.claim_puzzle(puzzle_task) 650 | if msg and msg.get("data") == {} and msg.get("status") == 0: 651 | self.log(f"{hijau}Sucsess claim puzzle!") 652 | elif msg and msg.get("data").get("message") == "Must complement relation task": 653 | self.log(f"{kuning}Not time to claim puzzle! {merah}Complete the Tomarket Youtube quest first!") 654 | elif msg and msg.get("data").get("message") == "The result is incorrect": 655 | self.log(f"{merah}Puzzle answer is incorrect!") 656 | else: 657 | self.log(f"{merah}Failed claim puzzle!") 658 | 659 | if self.play_game: 660 | self.log(f"{hijau}auto play game is enable!") 661 | play_pass = data.get("play_passes") 662 | self.log(f"{hijau}game ticket : {putih}{play_pass}") 663 | if int(play_pass) > 0: 664 | self.play_game_func(play_pass) 665 | continue 666 | 667 | amount, wallet = self.check_airdrop(token) 668 | if amount: 669 | float_number = float(amount) - 0.01 670 | formatted_float = "{:.2f}".format(float_number) 671 | self.log(f'{hijau}Your amount Round One- {putih}{formatted_float}') 672 | 673 | amount_now = self.check_balance_now(token) 674 | if amount_now: 675 | float_number = float(amount_now) - 0.01 676 | formatted_float = "{:.2f}".format(float_number) 677 | self.log(f'{hijau}Your amount now- {putih}{formatted_float}') 678 | 679 | # self.claim_duck() 680 | # launchpad_tasks = [4, 5, 6] 681 | # 682 | # for task in launchpad_tasks: 683 | # self.claim_launchpad_task() 684 | # time.sleep(1) 685 | # 686 | # self.invest_Toma(formatted_float) 687 | # 688 | # # amount = self.claim_airdrop() 689 | # time.sleep(1) 690 | # self.claim_pgc(adress, uid) 691 | 692 | 693 | 694 | now = datetime.now().strftime("%Y-%m-%d %H:%M") 695 | open("balance.txt", "a", encoding="utf-8").write( 696 | f"{now}/{acc}/{rank}/{amount}/{user_name} \n") 697 | 698 | # _next = end_farming - timestamp 699 | return balance 700 | 701 | 702 | def load_data(self, file): 703 | datas = [i for i in open(file).read().splitlines() if len(i) > 0] 704 | if len(datas) <= 0: 705 | print( 706 | f"{merah}0 account detected from {file}, fill your data in {file} first !{reset}" 707 | ) 708 | sys.exit() 709 | 710 | return datas 711 | 712 | def load_config(self, file): 713 | config = json.loads(open(file).read()) 714 | self.interval = config["interval"] 715 | self.play_game = config["play_game"] 716 | self.complete_task = config["complete_task"] 717 | self.change_tomato_to_star = config["change_tomato_to_star"] 718 | self.claim_weekly_airdrop = config["claim_weekly_airdrop"] 719 | self.use_free_spin = config["use_free_spin"] 720 | self.unlock_levels = config["unlock_levels"] 721 | self.share_tg_after_upgrade = config["share_tg_after_upgrade"] 722 | self.upgrade_max_level = config["upgrade_max_level"] 723 | self.connect_wallet = config["connect_wallet"] 724 | self.game_low_point = config["game_point"]["low"] 725 | self.game_high_point = config["game_point"]["high"] 726 | self.add_time_min = config["additional_time"]["min"] 727 | self.add_time_max = config["additional_time"]["max"] 728 | 729 | 730 | def save(self, id, token): 731 | tokens = json.loads(open("tokens.json").read()) 732 | tokens[str(id)] = token 733 | open("tokens.json", "w").write(json.dumps(tokens, indent=4)) 734 | 735 | def get(self, id): 736 | tokens = json.loads(open("tokens.json").read()) 737 | if str(id) not in tokens.keys(): 738 | return None 739 | 740 | return tokens[str(id)] 741 | 742 | def is_expired(self, token): 743 | header, payload, sign = token.split(".") 744 | deload = urlsafe_b64decode(payload + "==").decode() 745 | jeload = json.loads(deload) 746 | now = int(datetime.now().timestamp()) 747 | if now > jeload["exp"]: 748 | return True 749 | return False 750 | 751 | def get_random_proxy(self, isself, israndom=False): 752 | if israndom: 753 | return random.choice(self.proxies) 754 | return self.proxies[isself % len(self.proxies)] 755 | 756 | def http(self, url, headers, data=None): 757 | while True: 758 | try: 759 | now = datetime.now().isoformat(" ").split(".")[0] 760 | if data is None: 761 | res = self.ses.get(url, headers=headers, timeout=100) 762 | elif data == "": 763 | res = self.ses.post(url, headers=headers, timeout=100) 764 | else: 765 | res = self.ses.post(url, headers=headers, data=data, timeout=100) 766 | return res 767 | except requests.exceptions.ProxyError: 768 | print(f"{merah}bad proxy !") 769 | time.sleep(1) 770 | continue 771 | 772 | except (requests.exceptions.ConnectionError, requests.exceptions.Timeout): 773 | print(f"{merah}connection error / connection timeout !") 774 | time.sleep(1) 775 | continue 776 | 777 | def countdown(self, t): 778 | for i in range(t, 0, -1): 779 | menit, detik = divmod(i, 60) 780 | jam, menit = divmod(menit, 60) 781 | jam = str(jam).zfill(2) 782 | menit = str(menit).zfill(2) 783 | detik = str(detik).zfill(2) 784 | print(f"{putih}waiting {jam}:{menit}:{detik} ", flush=True, end="\r") 785 | time.sleep(1) 786 | print(" ", flush=True, end="\r") 787 | 788 | def log(self, msg): 789 | now = datetime.now().isoformat(" ").split(".")[0] 790 | print(f"{hitam}[{now}]{reset} {msg}{reset}") 791 | 792 | def main(self): 793 | banner = r""" 794 | _____ _ _ _____ _ _ __ __ ____ ______ _____ 795 | / ____| | | | | / ____| | | | | | \/ | | _ \ | ____| | __ \ 796 | | | | | | | | | | | | | | \ / | | |_) | | |__ | |__) | 797 | | | | | | | | | | | | | | |\/| | | _ < | __| | _ / 798 | | |____ | |__| | | |____ | |__| | | | | | | |_) | | |____ | | \ \ 799 | \_____| \____/ \_____| \____/ |_| |_| |____/ |______| |_| \_\ """ 800 | 801 | 802 | arg = argparse.ArgumentParser() 803 | arg.add_argument("--data", default="data.txt") 804 | arg.add_argument("--config", default="config.json") 805 | arg.add_argument("--proxy", default="proxies.txt") 806 | arg.add_argument("--marinkitagawa", action="store_true") 807 | args = arg.parse_args() 808 | if not args.marinkitagawa: 809 | os.system("cls" if os.name == "nt" else "clear") 810 | print(Fore.GREEN + Style.BRIGHT + banner + Style.RESET_ALL) 811 | print() 812 | print(biru + f" Tomarket Telegram Bot") 813 | print(merah + f" FREE TO USE = Join us on {putih}t.me/cucumber_scripts") 814 | print(merah + f" before start please '{hijau}git pull{hijau}' to update bot") 815 | print() 816 | self.load_config(args.config) 817 | datas = self.load_data(args.data) 818 | proxies = open(args.proxy).read().splitlines() 819 | wallets = open(r'wallet.txt').read().splitlines() 820 | # bg_wal = open(r'bg_wal.txt').read().splitlines() 821 | # bg_uid = open(r'bg_uid.txt').read().splitlines() 822 | self.log(f"{biru}total account : {putih}{len(datas)}") 823 | self.log(f"{biru}total proxies detected : {putih}{len(proxies)}") 824 | use_proxy = True if len(proxies) > 0 else False 825 | self.log(f"{hijau}use proxy : {putih}{use_proxy}") 826 | print(line) 827 | while True: 828 | # list_countdown = [] 829 | # _start = int(time.time()) 830 | total_balance = 0 831 | for no, data in enumerate(datas): 832 | if use_proxy: 833 | proxy = proxies[no % len(proxies)] 834 | if self.connect_wallet: 835 | if len(wallets) != len(datas): 836 | self.log(merah + 'the number of wallets should be equal to the number of accounts! connect_wallet = False!') 837 | self.connect_wallet = False 838 | wallet = None 839 | else: 840 | wallet = wallets[no % len(wallets)] 841 | else: 842 | wallet = None 843 | # adress = bg_wal[no % len(bg_wal)] 844 | # uid = bg_uid[no % len(bg_uid)] 845 | self.set_proxy(proxy if use_proxy else None) 846 | parser = self.marinkitagawa(data) 847 | user = json.loads(parser["user"]) 848 | id = user["id"] 849 | account_number = no + 1 850 | user_name = user['username'] 851 | self.log( 852 | f"{hijau}account number : {putih}{no + 1}{hijau}/{putih}{len(datas)}" 853 | ) 854 | self.log(f"{hijau}name : {putih}{user['username']}") 855 | token = self.get(id) 856 | if token is None: 857 | token = self.login(data, account_number, user_name) 858 | if token is None: 859 | continue 860 | self.save(id, token) 861 | 862 | if self.is_expired(token): 863 | token = self.login(data, account_number, user_name) 864 | if token is None: 865 | continue 866 | self.save(id, token) 867 | self.set_authorization(token) 868 | try: 869 | balance = self.get_balance(data, account_number, user_name, wallet) 870 | except: 871 | continue 872 | try: 873 | total_balance += int(balance) 874 | except: 875 | total_balance += 0 876 | print(line) 877 | self.countdown(self.interval) 878 | # list_countdown.append(result) 879 | now = datetime.now().strftime("%Y-%m-%d %H:%M") 880 | open("balance.txt", "a", encoding="utf-8").write( 881 | f"{now} / total_balance: / {total_balance} \n") 882 | self.log(f"total_balance: {total_balance}") 883 | # _end = int(time.time()) 884 | # _tot = _end - _start 885 | # _min = min(list_countdown) - _tot 886 | wait = random.randint(1800, 3600) 887 | self.countdown(wait) 888 | 889 | 890 | if __name__ == "__main__": 891 | try: 892 | if s_name() == 'Windows': 893 | sys(f'cls && title Tomarket') 894 | else: 895 | sys('clear') 896 | app = Tomartod() 897 | app.main() 898 | except KeyboardInterrupt: 899 | sys.exit() 900 | --------------------------------------------------------------------------------