Skip to content
This repository was archived by the owner on Mar 11, 2022. It is now read-only.

Commit 5aab972

Browse files
authored
Update hunt.py
1 parent c7b6018 commit 5aab972

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

Fight/hunt.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
from login import login, get_nick_and_pw
2-
from fly import fly
2+
if __name__ == "__main__":
3+
from fly import fly
4+
else:
5+
from .fly import fly
36

47
from lxml.html import fromstring
58
import requests
@@ -8,7 +11,9 @@
811
def hunt(server, maxDmgForBh="500000", startTime="30", weaponQuality="5"):
912
"""Auto hunt BHs (attack and RWs)"""
1013
URL = f"https://{server}.e-sim.org/"
11-
maxDmgForBh, startTime = int(maxDmgForBh), int(startTime)
14+
if "t" in startTime.lower():
15+
startTime = float(startTime.lower().replace("t", "")) * 60
16+
maxDmgForBh, startTime = int(maxDmgForBh.replace("k", "000")), int(startTime)
1217
print(f"Start hunting at {server}.")
1318
nick = get_nick_and_pw(server)[0]
1419
apiCitizen = requests.get(f"{URL}apiCitizenByName.html?name={nick.lower()}").json()
@@ -153,3 +158,12 @@ def hunting(side, side_dmg, session):
153158
hunting(side, side_dmg, session)
154159
else:
155160
continue
161+
162+
if __name__ == "__main__":
163+
print(hunt.__doc__)
164+
server = input("Server: ")
165+
max_dmg_for_bh = input("Max dmg for bh: ")
166+
start_time = input("When to start? (If you input 60, it means t1) ")
167+
weapon_quality = input("Weapon quality (0-5): ")
168+
hunt(server, max_dmg_for_bh, start_time, weapon_quality)
169+
input("Press any key to continue")

0 commit comments

Comments
 (0)