├── requirements.txt ├── queries.txt ├── proxies.txt ├── README.md └── main.py /requirements.txt: -------------------------------------------------------------------------------- 1 | requests 2 | colorama 3 | -------------------------------------------------------------------------------- /queries.txt: -------------------------------------------------------------------------------- 1 | #JUST EXAMPLE PLEASE DELETE 2 | query_id=XXX 3 | query_id=XXX 4 | -------------------------------------------------------------------------------- /proxies.txt: -------------------------------------------------------------------------------- 1 | #JUST EXAMPLE PLEASE DELETE 2 | http://host:port 3 | http://user:pass@host:port 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Node Wars Auto 2 | Automate script Node Wars game on the NodePay network. It supports multiple accounts and features proxy support, custom logging, and threading for parallel operations. 3 | - Auto Claim Daily 4 | - Auto Play Game 5 | - Auto Clear Tasks Coming Soon! 6 | ## Tools and components required 7 | 1. Nodepay Account | Register: [https://app.nodepay.ai/register](https://app.nodepay.ai/register?ref=ZUCBuJaIoBXLE6J) 8 | 2. Telegram and Nodewars Account | Register: [Node Wars](https://t.me/nodewars_bot?start=6465178420) 9 | 3. VPS (OPTIONAL) and Python3 10 | 4. Proxies 11 | 5. Query Hash 12 | ## Buy Proxies 13 | - Free Proxies Static Residental: 14 | 1. [WebShare](https://www.webshare.io/?referral_code=p7k7whpdu2jg) 15 | 2. [ProxyScrape](https://proxyscrape.com/?ref=odk1mmj) 16 | 3. [MonoSans](https://github.com/monosans/proxy-list) 17 | - Paid Premium Static Residental: 18 | 1. [922proxy](https://www.922proxy.com/register?inviter_code=d03d4fed) 19 | 2. [Proxy-Cheap](https://app.proxy-cheap.com/r/JysUiH) 20 | 3. [Infatica](https://dashboard.infatica.io/aff.php?aff=544) 21 | 22 | - Place proxies to ``proxies.txt`` perlines 23 | ## How to Get Telegram QUERY HASH 24 | - Get Telegram Query Hash: [YouTube](https://www.youtube.com/watch?v=RrGDPdhoAYI&ab_channel=CryptoFarmers%F0%9F%91%A8%E2%80%8D%F0%9F%8C%BE) 25 | - Paste hash to file ``queries.txt`` perlines 26 | # Setup Tutorial 27 | _*WINDOWS*_: 28 | - Install Python For Windows: [Python](https://www.python.org/ftp/python/3.13.0/python-3.13.0-amd64.exe) 29 | - Download this script Manually: [Node Wars Auto](https://github.com/im-hanzou/nodewars-auto/archive/refs/heads/main.zip) 30 | - If you want to use Git, Please download Git first: [Git Windows](https://github.com/git-for-windows/git/releases/download/v2.47.1.windows.1/Git-2.47.1-64-bit.exe), Then run in cmd: 31 | ```bash 32 | git clone https://github.com/im-hanzou/nodewars-auto 33 | ``` 34 | - Make sure you are in this script directory: ``cd nodewars-auto`` 35 | - Installing requirements: 36 | ```bash 37 | python -m pip install -r requirements.txt 38 | ``` 39 | _*LINUX*_: 40 | - Open Terminal, install Python3 and Git: 41 | ```bash 42 | apt update; apt upgrade -y; apt install git python3 python3-pip -y 43 | ``` 44 | - Download this script using Git: 45 | ```bash 46 | git clone https://github.com/im-hanzou/nodewars-auto 47 | ``` 48 | - Make sure you are in this script directory: ``cd nodewars-auto`` 49 | - Installing requirements: 50 | ```bash 51 | python3 -m pip install -r requirements.txt 52 | ``` 53 | _*TERMUX*_: 54 | - For Termux Android [Download Here](https://f-droid.org/repo/com.termux_1020.apk) [F-Droid Version] and Allow Permission Storage On Setting Termux 55 | - Open Termux, install Python3 and Git: 56 | ```bash 57 | pkg update; pkg upgrade -y; pkg install git python python-pip -y 58 | ``` 59 | - Download this script using Git: 60 | ```bash 61 | git clone https://github.com/im-hanzou/nodewars-auto 62 | ``` 63 | - Make sure you are in this script directory: ``cd nodewars-auto`` 64 | - Installing requirements: 65 | ```bash 66 | python -m pip install -r requirements.txt 67 | ``` 68 | # Run the Script 69 | - Important! Don't forget to place queries to ``queries.txt`` and proxies to ``proxies.txt`` 70 | - _*WINDOWS and TERMUX*_: 71 | ```bash 72 | python main.py 73 | ``` 74 | - _*LINUX*_: 75 | ```bash 76 | python3 main.py 77 | ``` 78 | # Notes 79 | - Run this script use my invite code if you don't have one. 80 | - If you run the script and still got error, please use paid proxies cause every free proxies not all supported. 81 | - Run this script at your own risk, I'm not responsible for any loss or damage caused by this script. This script is for educational purposes only. 82 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import time 3 | import logging 4 | import random 5 | from datetime import datetime, timedelta 6 | from typing import Dict, Optional, Any 7 | import re 8 | import threading 9 | 10 | from colorama import Fore, Style, init 11 | 12 | API_URL = "https://nodewars.nodepay.ai" 13 | HEADER = { 14 | "Content-Type": "application/json", 15 | "Accept": "*/*", 16 | "Accept-Encoding": "gzip, deflate, br, ztsd", 17 | "Accept-Language": "en-GB,en;q=0.9,en-US;q=0.8", 18 | "Priority": "u=1, i", 19 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0", 20 | "Origin": "https://minigame-nw.nodepay.ai", 21 | "Referer": "https://minigame-nw.nodepay.ai/", 22 | "Sec-CH-Ua": 'Microsoft Edge";v="131", "Chromium";v="131", "Not_A_Brand";v="24", "Microsoft Edge WebView2";v="131', 23 | "Sec-CH-Ua-Mobile": "?0", 24 | "Sec-CH-Ua-Platform": "Windows", 25 | } 26 | 27 | def read_proxies_from_file(file_path: str = 'proxies.txt') -> list: 28 | try: 29 | with open(file_path, 'r') as file: 30 | return [line.strip() for line in file if line.strip()] 31 | except FileNotFoundError: 32 | print(f"{Fore.RED}Proxy file {file_path} not found! Running without proxies.{Fore.RESET}") 33 | return [] 34 | 35 | def extract_username_from_query(query_string: str) -> str: 36 | try: 37 | match = re.search(r'username%22%3A%22([^%"]+)', query_string) 38 | username = match.group(1) if match else query_string[:15] 39 | 40 | if len(username) > 15: 41 | username = username[:15] 42 | 43 | elif len(username) < 15: 44 | padding = 15 - len(username) 45 | left_pad = padding // 2 46 | right_pad = padding - left_pad 47 | username = ' ' * left_pad + username + ' ' * right_pad 48 | 49 | return username 50 | except Exception: 51 | return ' ' * 15 52 | 53 | def setup_logging(username: str) -> logging.Logger: 54 | logger = logging.getLogger(username) 55 | logger.setLevel(logging.INFO) 56 | logger.handlers.clear() 57 | 58 | formatter = logging.Formatter( 59 | f'{Fore.LIGHTWHITE_EX}%(asctime)s{Fore.RESET} - {Fore.CYAN}[{username}]{Fore.RESET} - %(levelname)s: %(message)s', 60 | datefmt='[%d-%m-%Y %H:%M:%S]' 61 | ) 62 | 63 | console_handler = logging.StreamHandler() 64 | console_handler.setFormatter(formatter) 65 | logger.addHandler(console_handler) 66 | 67 | return logger 68 | 69 | def generate_action_logs(base_prefix: str = '10') -> list: 70 | action_logs = [] 71 | current_timestamp = int(time.time() * 1000000) 72 | 73 | possible_prefixes = ['10', '31', '53', '43', '10', '10', '10'] 74 | 75 | for _ in range(24): 76 | prefix = random.choice(possible_prefixes) 77 | unique_number = random.randint(1000, 9999) 78 | current_timestamp += random.randint(100, 1000) 79 | action_log = f"{prefix}{unique_number}{current_timestamp}" 80 | action_logs.append(action_log) 81 | 82 | return action_logs 83 | 84 | def generate_random_tokens(tokens: list) -> Dict[str, int]: 85 | return {token: random.randint(1, 3) for token in tokens} 86 | 87 | def read_query_strings_from_file(file_path: str = 'queries.txt') -> list: 88 | try: 89 | with open(file_path, 'r') as file: 90 | return [line.strip() for line in file if line.strip()] 91 | except FileNotFoundError: 92 | print(f"{Fore.RED}File {file_path} not found!{Fore.RESET}") 93 | return [] 94 | 95 | def login_with_query_string(query_string: str, logger: logging.Logger, proxy: str = None) -> Optional[Dict[str, Any]]: 96 | url = f"{API_URL}/users/profile" 97 | headers = {**HEADER, "Authorization": f"Bearer {query_string}"} 98 | 99 | proxies = {'http': proxy, 'https': proxy} if proxy else {} 100 | 101 | try: 102 | response = requests.get(url, headers=headers, proxies=proxies, timeout=30) 103 | response.raise_for_status() 104 | 105 | logger.info(f"{Fore.YELLOW}Proxy Used: {proxy or 'Direct Connection'}{Fore.RESET}") 106 | logger.info(f"{Fore.GREEN}Login successful!{Fore.RESET}") 107 | 108 | return response.json()["data"] 109 | except requests.exceptions.RequestException as e: 110 | logger.error(f"{Fore.RED}Login failed: {e}{Fore.RESET}") 111 | return None 112 | 113 | def claim_daily(query_string: str, logger: logging.Logger, proxy: str = None, last_claim: Optional[datetime] = None) -> Optional[Dict[str, Any]]: 114 | if last_claim and datetime.now() - last_claim < timedelta(hours=24): 115 | logger.info(f"{Fore.YELLOW}Not time for daily claim yet. Wait 24 hours.{Fore.RESET}") 116 | return None 117 | 118 | url = f"{API_URL}/missions/daily/claim" 119 | headers = {**HEADER, "Authorization": f"Bearer {query_string}"} 120 | mission_id = "66c4b006c767c2cee0afe806" 121 | payload = {"missionId": mission_id} 122 | 123 | proxies = {'http': proxy, 'https': proxy} if proxy else {} 124 | 125 | try: 126 | response = requests.post(url, json=payload, headers=headers, proxies=proxies, timeout=30) 127 | 128 | if response.status_code == 200: 129 | logger.info(f"{Fore.GREEN}Daily claim successful!{Fore.RESET}") 130 | return response.json() 131 | elif response.status_code == 400: 132 | logger.warning(f"{Fore.YELLOW}Daily reward already claimed!{Fore.RESET}") 133 | return None 134 | else: 135 | logger.error(f"{Fore.RED}Unexpected response: {response.status_code}{Fore.RESET}") 136 | return None 137 | except requests.exceptions.RequestException as e: 138 | logger.error(f"{Fore.RED}Daily claim failed: {e}{Fore.RESET}") 139 | return None 140 | 141 | def start_game(level: int, query_string: str, logger: logging.Logger, proxy: str = None) -> Optional[Dict[str, Any]]: 142 | url = f"{API_URL}/game/start" 143 | headers = {**HEADER, "Authorization": f"Bearer {query_string}"} 144 | payload = {"level": level} 145 | 146 | proxies = {'http': proxy, 'https': proxy} if proxy else {} 147 | 148 | try: 149 | response = requests.post(url, json=payload, headers=headers, proxies=proxies, timeout=30) 150 | response.raise_for_status() 151 | logger.info(f"{Fore.GREEN}Game started at level {level}!{Fore.RESET}") 152 | return response.json()["data"] 153 | except requests.exceptions.RequestException as e: 154 | logger.error(f"{Fore.RED}Failed to start game: {e}{Fore.RESET}") 155 | return None 156 | 157 | def finish_game( 158 | session_id: str, 159 | game_log_id: str, 160 | query_string: str, 161 | logger: logging.Logger, 162 | proxy: str = None 163 | ) -> Optional[Dict[str, Any]]: 164 | url = f"{API_URL}/game/finish" 165 | headers = {**HEADER, "Authorization": f"Bearer {query_string}"} 166 | 167 | token_list = [ 168 | "nodewars", "shiba", "nodepay", "pepe", "polkadot", 169 | "babydoge", "bnb", "avax", "eth", "usdt", "solana", 170 | "aptos", "ton", "bonk", "bomb", "doge", "floki", 171 | "chainlink", "uniswap", "trx", "lido", "xrp", "ltc", 172 | "ada", "sui", "dogwifhat", "near", "bitcoin" 173 | ] 174 | 175 | collected_tokens = generate_random_tokens(token_list) 176 | action_logs = generate_action_logs() 177 | score = random.randint(45, 60) 178 | time_spent = random.randint(25000, 30000) 179 | 180 | payload = { 181 | "sessionId": session_id, 182 | "gameLogId": game_log_id, 183 | "isCompleted": True, 184 | "timeSpent": time_spent, 185 | "actionLogs": action_logs, 186 | "score": score, 187 | "collectedTokens": collected_tokens 188 | } 189 | 190 | proxies = {'http': proxy, 'https': proxy} if proxy else {} 191 | 192 | try: 193 | response = requests.post(url, json=payload, headers=headers, proxies=proxies, timeout=30) 194 | response.raise_for_status() 195 | response_data = response.json() 196 | response_score = response_data.get('data', {}).get('score', score) 197 | logger.info(f"{Fore.GREEN}Game completed! {Fore.RESET}{Fore.LIGHTYELLOW_EX}Score: {response_score}{Fore.RESET}") 198 | token_str = ", ".join([f"{token}: {amount}" for token, amount in collected_tokens.items()]) 199 | logger.info(f"{Fore.CYAN}Tokens collected: {Fore.RESET}{Fore.LIGHTYELLOW_EX}{token_str}{Fore.RESET}") 200 | 201 | return response_data 202 | except requests.exceptions.RequestException as e: 203 | logger.error(f"{Fore.RED}Failed to complete game: {e}{Fore.RESET}") 204 | return None 205 | 206 | def process_account(query_string: str, proxies: list): 207 | username = extract_username_from_query(query_string) 208 | logger = setup_logging(username) 209 | last_claim_time = None 210 | delay = random.randint(30, 60) 211 | 212 | proxy = random.choice(proxies) if proxies else None 213 | 214 | while True: 215 | try: 216 | user_data = login_with_query_string(query_string, logger, proxy) 217 | if not user_data: 218 | break 219 | 220 | logger.info(f"{Fore.LIGHTMAGENTA_EX}UserID: {user_data.get('userId')}{Fore.RESET}") 221 | logger.info(f"{Fore.LIGHTMAGENTA_EX}Name: {user_data.get('name')}{Fore.RESET}") 222 | logger.info(f"{Fore.LIGHTMAGENTA_EX}Level: {user_data.get('level')}{Fore.RESET}") 223 | logger.info(f"{Fore.LIGHTMAGENTA_EX}Humanity: {user_data.get('humanity')}{Fore.RESET}") 224 | logger.info(f"{Fore.LIGHTMAGENTA_EX}Points: {user_data.get('points')}{Fore.RESET}") 225 | logger.info(f"{Fore.LIGHTMAGENTA_EX}Coins: {user_data.get('coins')}{Fore.RESET}") 226 | 227 | claim_response = claim_daily(query_string, logger, proxy, last_claim_time) 228 | if claim_response: 229 | last_claim_time = datetime.now() 230 | logger.info(f"{Fore.CYAN}Claim Data: {claim_response}{Fore.RESET}") 231 | 232 | while True: 233 | user_level = user_data.get("level", 1) 234 | game_data = start_game(user_level, query_string, logger, proxy) 235 | 236 | if not game_data: 237 | logger.error(f"{Fore.RED}Failed to start game. Stopping loop.{Fore.RESET}") 238 | break 239 | 240 | session_id = game_data["sessionId"] 241 | game_log_id = game_data["gameLogId"] 242 | 243 | logger.info(f"{Fore.BLUE}Game in progress...{Fore.RESET}") 244 | time.sleep(delay) 245 | 246 | finish_response = finish_game( 247 | session_id, 248 | game_log_id, 249 | query_string=query_string, 250 | logger=logger, 251 | proxy=proxy 252 | ) 253 | 254 | if finish_response: 255 | if finish_response.get("data", {}).get("isLevelUp"): 256 | user_data["level"] += 1 257 | logger.info(f"{Fore.GREEN}Leveled Up!{Fore.RESET}") 258 | 259 | logger.info(f"{Fore.BLUE}Delay {delay} seconds before next game...{Fore.RESET}") 260 | time.sleep(delay) 261 | 262 | except Exception as e: 263 | logger.error(f"{Fore.RED}Error on account: {e}{Fore.RESET}") 264 | time.sleep(delay) 265 | 266 | def main(): 267 | init(autoreset=True) 268 | banner = """ 269 | \\ | | \\ \\ / 270 | \\ | _ \\ _` | _ \\ \\ \\ \\ / _` | __| __| 271 | |\\ | ( | ( | __/ \\ \\ \\ / ( | | \\__ \\ 272 | _| \\_| \\___/ \\__,_| \\___| \\_/\\_/ \\__,_| _| ____/ 273 | 274 | Node Wars Bot - Multi Account 275 | Part of NodePay Network 276 | Github: IM-Hanzou 277 | """ 278 | print(f'{Fore.LIGHTCYAN_EX}{banner}{Fore.RESET}') 279 | print(f"{Fore.YELLOW}Starting bot...{Fore.RESET}") 280 | query_strings = read_query_strings_from_file() 281 | proxies = read_proxies_from_file() 282 | 283 | if not query_strings: 284 | print(f"{Fore.RED}No query strings found!{Fore.RESET}") 285 | return 286 | 287 | threads = [] 288 | for query_string in query_strings: 289 | thread = threading.Thread(target=process_account, args=(query_string, proxies)) 290 | thread.start() 291 | threads.append(thread) 292 | time.sleep(5) 293 | 294 | for thread in threads: 295 | thread.join() 296 | 297 | if __name__ == "__main__": 298 | main() 299 | --------------------------------------------------------------------------------