-
Notifications
You must be signed in to change notification settings - Fork 125
/
main.py
59 lines (55 loc) · 2.62 KB
/
main.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
import subprocess
import time
import sys,ccxt
import os
from colorama import Style, init, Fore
init()
from exchange_config import *
sys.stdin.reconfigure(encoding="utf-8")
sys.stdout.reconfigure(encoding="utf-8")
print('''
VMA""YMM `7MM"""Yp, db `7MM"""Mq. `7MM"""Yp, .g8""8q. MMP""MM""YMM `7MMF'`7MN. `7MF'`7MM"""YMM
VMA `7 MM Yb ;MM: MM `MM. MM Yb .dP' `YM.P' MM `7 MM MMN. M MM `7
VMA MM dP ,V^MM. MM ,M9 MM dP dM' `MM MM MM M YMb M MM d
XV MM"""bg. ,M `MM MMmmdM9 MM"""bg. MM MM MM MM M `MN. M MMmmMM
AV , MM `Y AbmmmqMA MM YM. MM `Y MM. ,MP MM MM M `MM.M MM Y ,
AV ,M MM ,9 A' VML MM `Mb. MM ,9 `Mb. ,dP' MM MM M YMM MM ,M
AMMMMMMMF .JMMmmmd9 .AMA. .AMMA..JMML. .JMM..JMMmmmd9 `"bmmd"' .JMML. .JMML..JML. YM .JMMmmmmMMM
''')
print(f" \n{Fore.BLUE}{Style.BRIGHT}DEMO VERSION{Style.RESET_ALL}\n \n\nTwitter: @thebarbotine\nDiscord: https://barbotine.xyz/discord\n")
args = sys.argv
mode = args[1]
if renewal:
balance = args[3]
pair=args[4]
renew=args[2]
ex_list=args[5]
else:
balance = args[2]
pair=args[3]
renew="525600"
ex_list=args[4]
i=0
if mode!='fake-money':
real_balance=0
for ex_str in ex_list.split(','):
bal = ex[ex_str].fetchBalance()
real_balance+=float(bal[pair.split('/')[1]]['total'])
with open(f"real_balance.txt","w") as f:
f.write(str(real_balance))
else:
with open(f"real_balance.txt","w") as f:
f.write(str(balance))
while True:
with open(f"real_balance.txt","r") as f:
balance = str(f.read())
if i>=1 and p.returncode==1:
sys.exit(1)
if mode == "fake-money":
p=subprocess.run([python_command,"bot-fake-money.py",pair,balance,renew,pair,ex_list])
elif mode == "real":
p=subprocess.run([python_command,"bot.py",pair,balance,renew,pair,ex_list])
else:
printerror(m=f"mode input is incorrect.")
sys.exit(1)
i+=1