fi: des trucs

This commit is contained in:
gdamms 2022-03-26 16:52:02 +01:00
parent 0831202fa3
commit 710ae34c2b
2 changed files with 5 additions and 5 deletions

View file

@ -7,7 +7,7 @@ import utils
NB_ETA = 25
NB_ROTATIONS = 1
NB_ROTATIONS = 5
N_START = 9984
N_STOP = 0
@ -66,7 +66,7 @@ if __name__ == "__main__":
for x_rotation in range(NB_ROTATIONS):
uuid = utils.screenshot()
utils.insert(db, uuid, loadout, x_rotation, 0)
# garage.rotate(130, 0)
garage.rotate(130, 0)
# tac
elapsed = time.time() - elapsed

View file

@ -91,11 +91,11 @@ def start_game(device: ppadb.device.Device, users: UserList) -> None:
logging.debug("game activity started")
def detect_zen_mode(device: ppadb.device.Device) -> bool:
def is_zen_mode(device: ppadb.device.Device) -> bool:
return device.shell("settings get global zen_mode") != "1\n"
def detect_focus(device: ppadb.device.Device) -> bool:
def is_focused(device: ppadb.device.Device) -> bool:
activity_dump = device.shell("dumpsys activity activities")
result = REGEX_FOCUS.search(activity_dump)
@ -116,7 +116,7 @@ def startup() -> None:
users = detect_game(device, users)
start_game(device, users)
while not (detect_zen_mode(device) or detect_focus(device)):
while not (is_zen_mode(device) and is_focused(device)):
time.sleep(DELAY_DETECT)
time.sleep(DELAY_DETECT)