diff --git a/src/main.py b/src/main.py index 6bb75fb..ca45870 100644 --- a/src/main.py +++ b/src/main.py @@ -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 diff --git a/src/utils.py b/src/utils.py index 652b65d..3e4650f 100644 --- a/src/utils.py +++ b/src/utils.py @@ -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)