|
1 | 1 | 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 |
3 | 6 |
|
4 | 7 | from lxml.html import fromstring |
5 | 8 | import requests |
|
8 | 11 | def hunt(server, maxDmgForBh="500000", startTime="30", weaponQuality="5"): |
9 | 12 | """Auto hunt BHs (attack and RWs)""" |
10 | 13 | 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) |
12 | 17 | print(f"Start hunting at {server}.") |
13 | 18 | nick = get_nick_and_pw(server)[0] |
14 | 19 | apiCitizen = requests.get(f"{URL}apiCitizenByName.html?name={nick.lower()}").json() |
@@ -153,3 +158,12 @@ def hunting(side, side_dmg, session): |
153 | 158 | hunting(side, side_dmg, session) |
154 | 159 | else: |
155 | 160 | 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