-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbot-proxy.py
125 lines (99 loc) · 4.32 KB
/
bot-proxy.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
import sys
sys.dont_write_bytecode = True
from smart_airdrop_claimer import base
from core.info import get_info
from core.task import process_check_in, process_do_project_task, process_do_normal_task
from core.mine import process_claim
from core.spin import process_spin
from core.upgrade import process_upgrade
import time
import json
class TabiZoo:
def __init__(self):
# Get file directory
self.data_file = base.file_path(file_name="data-proxy.json")
self.config_file = base.file_path(file_name="config.json")
# Initialize line
self.line = base.create_line(length=50)
# Initialize banner
self.banner = base.create_banner(game_name="TabiZoo")
# Get config
self.auto_check_in = base.get_config(
config_file=self.config_file, config_name="auto-check-in"
)
self.auto_do_task = base.get_config(
config_file=self.config_file, config_name="auto-do-task"
)
self.auto_claim = base.get_config(
config_file=self.config_file, config_name="auto-claim"
)
self.auto_spin = base.get_config(
config_file=self.config_file, config_name="auto-spin"
)
self.auto_upgrade = base.get_config(
config_file=self.config_file, config_name="auto-upgrade"
)
def main(self):
while True:
base.clear_terminal()
print(self.banner)
accounts = json.load(open(self.data_file, "r"))["accounts"]
num_acc = len(accounts)
base.log(self.line)
base.log(f"{base.green}Numer of accounts: {base.white}{num_acc}")
for no, account in enumerate(accounts):
base.log(self.line)
base.log(f"{base.green}Account number: {base.white}{no+1}/{num_acc}")
data = account["acc_info"]
proxy_info = account["proxy_info"]
parsed_proxy_info = base.parse_proxy_info(proxy_info)
if parsed_proxy_info is None:
break
actual_ip = base.check_ip(proxy_info=proxy_info)
proxies = base.format_proxy(proxy_info=proxy_info)
try:
# Info
get_info(data=data, proxies=proxies)
# Check in
if self.auto_check_in:
base.log(f"{base.yellow}Auto Check-in: {base.green}ON")
process_check_in(data=data, proxies=proxies)
else:
base.log(f"{base.yellow}Auto Check-in: {base.red}OFF")
# Do task
if self.auto_do_task:
base.log(f"{base.yellow}Auto Do Task: {base.green}ON")
process_do_project_task(data=data, proxies=proxies)
process_do_normal_task(data=data, proxies=proxies)
else:
base.log(f"{base.yellow}Auto Do Task: {base.red}OFF")
# Claim
if self.auto_claim:
base.log(f"{base.yellow}Auto Claim: {base.green}ON")
process_claim(data=data, proxies=proxies)
else:
base.log(f"{base.yellow}Auto Claim: {base.red}OFF")
# Spin
if self.auto_spin:
base.log(f"{base.yellow}Auto Spin: {base.green}ON")
process_spin(data=data, multiplier=1, proxies=proxies)
else:
base.log(f"{base.yellow}Auto Spin: {base.red}OFF")
# Upgrade
if self.auto_upgrade:
base.log(f"{base.yellow}Auto Upgrade: {base.green}ON")
process_upgrade(data=data, proxies=proxies)
else:
base.log(f"{base.yellow}Auto Upgrade: {base.red}OFF")
except Exception as e:
base.log(f"{base.red}Error: {base.white}{e}")
print()
wait_time = 60 * 60
base.log(f"{base.yellow}Wait for {int(wait_time/60)} minutes!")
time.sleep(wait_time)
if __name__ == "__main__":
try:
tabi = TabiZoo()
tabi.main()
except KeyboardInterrupt:
sys.exit()