1
0
mirror of https://github.com/TheFunny/ArisuAutoSweeper synced 2025-12-16 19:55:12 +00:00

Compare commits

...

5 Commits

Author SHA1 Message Date
RedDeadDepresso
3b2701a408
Merge a766829469 into 2cad7ebbac 2024-01-12 14:01:40 +00:00
RedDeadDepresso
a766829469 fix: ui 2024-01-12 11:50:41 +00:00
RedDeadDepresso
2da192e417 fix: distinguish task and campaign in zht 2024-01-12 01:55:37 +00:00
RedDeadDepresso
d47226cf35 chore: added comments in ui 2024-01-11 22:36:32 +00:00
RedDeadDepresso
fbf27025a8 fix: ui 2024-01-11 21:17:44 +00:00
3 changed files with 27 additions and 19 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -573,10 +573,10 @@ WORK_CHECK = ButtonWrapper(
),
zht=Button(
file='./assets/zht/base/page/WORK_CHECK.png',
area=(102, 6, 169, 41),
search=(82, 0, 189, 61),
color=(184, 194, 203),
button=(102, 6, 169, 41),
area=(668, 402, 774, 442),
search=(648, 382, 794, 462),
color=(182, 199, 224),
button=(668, 402, 774, 442),
),
)
WORK_GO_TO_BOUNTY = ButtonWrapper(

View File

@ -1,6 +1,7 @@
from module.base.button import ButtonWrapper
from module.base.decorator import run_once, Config
from module.base.timer import Timer
from module.base.utils import get_color
from module.exception import GameNotRunningError, GamePageUnknownError, RequestHumanTakeover
from module.logger import logger
from module.ocr.ocr import Ocr, Digit
@ -97,6 +98,7 @@ class UI(MainPage):
timeout.reset()
continue
logger.info("Unknown page, try to back")
# allows TooManyClicks to be triggered in case something goes wrong
if u2_back:
self.device.back()
u2_back = False
@ -130,7 +132,7 @@ class UI(MainPage):
self.interval_clear(list(Page.iter_check_buttons()))
# loading_timer = Timer(0.5)
#back_timer = Timer(10, 10)
back_timer = Timer(15,15)
logger.hr(f"UI goto {destination}")
while 1:
if skip_first_screenshot:
@ -177,14 +179,18 @@ class UI(MainPage):
if self.ui_additional():
continue
#back_timer.start()
#if back_timer.reached_and_reset():
# if self.match_color(LOGIN_LOADING, interval=5, threshold=80) or self.appear_trademark_year():
# from tasks.login.login import Login
# Login(self.config, self.device).handle_app_login()
# continue
# self.device.back()
# logger.info("Unknown page, try to back")
back_timer.start()
if back_timer.reached():
if self.match_color(LOGIN_LOADING, interval=5, threshold=80) or self.appear_trademark_year():
from tasks.login.login import Login
Login(self.config, self.device).handle_app_login()
# don't click back when screen is black.
# Useful for loading screen after switching between pages
elif [x for x in get_color(self.device.image, BACK.area) if x > 50]:
self.device.back()
logger.info("Unknown page, try to back")
back_timer.reset()
# Reset connection
Page.clear_connection()
@ -380,12 +386,14 @@ class UI(MainPage):
return True
if self.handle_new_student():
return True
if self.handle_ap_exceed():
return True
if self.handle_insufficient_inventory():
return True
if self.handle_item_expired():
return True
# disabled because will exit the game if quit appears
#if self.handle_ap_exceed():
# return True
#if self.handle_insufficient_inventory():
# return True
#if self.handle_item_expired():
# return True
return False