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

Commit 3ebd156

Browse files
adding _location
adding a _location function to travel back when using auto_fight module.
1 parent 24f11cf commit 3ebd156

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Help_functions/_bot_functions.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,3 +219,13 @@ def _fighting(server, battle_id, side, wep, session=""):
219219
except Exception as e:
220220
print(e)
221221
time.sleep(randint(2, 5))
222+
223+
224+
def _location(server):
225+
"""getting current location"""
226+
URL = f"https://{server}.e-sim.org/"
227+
nick = get_nick_and_pw(server)[0]
228+
time.sleep(randint(1,2))
229+
apiCitizen = requests.get(f"{URL}apiCitizenByName.html?name={nick.lower()}").json()
230+
currentLocationRegionId = apiCitizen['currentLocationRegionId']
231+
return currentLocationRegionId

0 commit comments

Comments
 (0)