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

Commit dd9db8e

Browse files
authored
Update fly.py
1 parent 0bb27a5 commit dd9db8e

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

Basic/fly.py

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,38 @@ def fly(server, region_id, ticket_quality="5", session=""):
1212
print(travel.url)
1313
return session
1414

15-
def flight_set(server, region1, region2, session=""):
15+
def flight_set(server, region1, region2, ticket_quality="5", session=""):
16+
if ticket_quality != "5":
17+
from Help_functions._bot_functions import _random_sleep
18+
ticket_health = {1: 40, 2: 30, 3: 20, 4: 10}
19+
flights_each_restore = int(200 / ticket_health[int(ticket_quality)])
20+
health = 100
21+
food_or_gift = "food"
22+
while 1:
23+
for region_id in (region1, region2):
24+
session = fly(server, region_id, ticket_quality, session=session)
25+
flights_each_restore -= 1
26+
health -= ticket_health[int(ticket_quality)]
27+
if not flights_each_restore:
28+
_random_sleep()
29+
health = 100
30+
flights_each_restore = int(200 / ticket_health[int(ticket_quality)])
31+
32+
if health <= 50:
33+
session = session.post(f"https://{server}.e-sim.org/{food_or_gift}.html?quality=5")
34+
health += 50
35+
food_or_gift = "gift" if food_or_gift == "food" else "food"
1636
while 1:
1737
for region_id in (region1, region2):
18-
session = fly(server, region_id, session=session)
38+
session = fly(server, region_id, ticket_quality, session=session)
1939
# You can add some delay between flights, like "time.sleep(1)"
20-
# (If you do, add also "import time" to the beginning of the file)
40+
# (If you do, add also "import time" at the beginning of the file)
2141

2242

2343
if __name__ == "__main__":
2444
print(fly.__doc__)
2545
server = input("Server: ")
26-
ticket_quality = input("Ticket quality (1-5): ")
46+
ticket_quality = input("Ticket quality (1-5): ").lower().replace("q", "")
2747
region_id = input("Region id: ")
2848
region_id2 = input("Write another region id if you have a flight set (for non-stop flights), otherwise click enter: ")
2949
if region_id2:

0 commit comments

Comments
 (0)