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

Commit bc732e8

Browse files
authored
Update missions.py
1 parent a60162f commit bc732e8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Time_saver/missions.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from random import choice, randint
1818

1919

20-
def missions(server, missions_to_complete="ALL", action="ALL", session=""):
20+
async def missions(server, missions_to_complete="ALL", action="ALL", session=""):
2121
"""Finish missions.
2222
* Leave "action" parameter empty if you don't need it to do specific action.
2323
* Leave "missions_to_complete" parameter empty if you don't want to complete all missions.
@@ -94,7 +94,7 @@ def missions(server, missions_to_complete="ALL", action="ALL", session=""):
9494
elif num == 46:
9595
restores = "2"
9696
print(f"Hitting {restores} restores, it might take a while")
97-
auto_fight(server, restores="1")
97+
await auto_fight(server, restores="1")
9898
elif num == 6:
9999
session.post(f"{URL}food.html?quality=1")
100100
elif num == 8:
@@ -122,7 +122,7 @@ def missions(server, missions_to_complete="ALL", action="ALL", session=""):
122122
elif num == 14:
123123
i = session.get(URL + 'storage.html?storageType=EQUIPMENT')
124124
tree = fromstring(i.content)
125-
ID = tree.xpath(f'//*[starts-with(@id, "cell")]/a/text()')[0].replace("#", "")
125+
ID = tree.xpath(f'//*[starts-with(@id, "cell")]/a/text()')[0]
126126
payload = {'action': "EQUIP", 'itemId': ID.replace("#", "")}
127127
session.post(URL + "equipmentAction.html", data=payload)
128128
elif num == 15:
@@ -145,7 +145,7 @@ def missions(server, missions_to_complete="ALL", action="ALL", session=""):
145145
elif num == 21:
146146
i = session.get(URL + 'storage.html?storageType=EQUIPMENT')
147147
tree = fromstring(i.content)
148-
ID = tree.xpath(f'//*[starts-with(@id, "cell")]/a/text()')[0]
148+
ID = tree.xpath(f'//*[starts-with(@id, "cell")]/a/text()')[0].replace("#", "")
149149
sell_eqs(server, ID, 0.01, 48, session)
150150
elif num == 22:
151151
Citizen = requests.get(f'{URL}apiCitizenById.html?id={my_id}').json()
@@ -229,7 +229,7 @@ def missions(server, missions_to_complete="ALL", action="ALL", session=""):
229229
session.post(f"{URL}medkit.html")
230230
# if food & gift limits > 10 it won't work.
231231
else:
232-
print("I don't know how to finish this mission. you have few seconds to stop me before i skip it")
232+
print("I don't know how to finish this mission.")
233233
time.sleep(randint(1, 7))
234234
c = session.post(URL + "betaMissions.html?action=COMPLETE", data={"submit": "Receive"})
235235
if "MISSION_REWARD_OK" not in str(c.url) and "?action=COMPLETE" not in str(c.url):

0 commit comments

Comments
 (0)