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

Commit 00dfd66

Browse files
fixes
Adding travel back to last region after work
1 parent 3ebd156 commit 00dfd66

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Fight/auto_fight.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from login import login, double_click
22
import __init__
3-
from Help_functions._bot_functions import _fighting, _random_sleep, _get_battle_id
4-
3+
from Help_functions._bot_functions import _fighting, _random_sleep, _get_battle_id, _location
4+
from Basic.fly import fly
55

66
from random import randint
77
import requests
@@ -26,7 +26,9 @@ def auto_fight(server, battle_id="", side="attacker", wep="0", food="", gift="",
2626
check = tree.xpath('//*[@id="taskButtonWork"]//@href') # checking if you can work
2727
A = randint(1, 4)
2828
if check and A == 2: # Don't work as soon as you can (suspicious)
29+
current_loc = _location(server)
2930
double_click(server, session)
31+
fly(server, current_loc, session=session)
3032
apiBattles = requests.get(f"{URL}apiBattles.html?battleId={battle_id}").json()[0]
3133
if 8 in (apiBattles['attackerScore'], apiBattles['defenderScore']):
3234
print("Battle has finished, i will search for another one")

0 commit comments

Comments
 (0)