-
Notifications
You must be signed in to change notification settings - Fork 0
/
in_city_enter.py
39 lines (33 loc) · 1.17 KB
/
in_city_enter.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from routine import Routine
from routine import RoutineException
from __init__ import *
import pyautogui
class InCityEnter(Routine):
BATTLE = 0x00
SMELT = 0x01
FRIEND = 0x02
STORE = 0x03
MARKET = 0x04
def __init__(self, button):
if (button == InCityEnter.BATTLE):
self.btn = pvp_enter
elif (button == InCityEnter.SMELT):
self.btn = smith
elif (button == InCityEnter.FRIEND):
self.btn = friend
elif (button == InCityEnter.STORE):
self.btn = store
elif (button == InCityEnter.MARKET):
self.btn = market
def execute(self) -> int:
__btn_city__ = self._clickOn_(self.btn)
if (__btn_city__ == None):
raise RoutineException("Could not find the in city button")
for _ in range(Routine._command_retries_):
if (self._disablePauseFor_(lambda: pyautogui.locateOnScreen(city_maid)) != None):
pyautogui.click(__btn_city__)
else:
__btn_city__ = None
if (__btn_city__ != None):
raise RoutineException("Could not click in city button")
return 0