1
0
mirror of https://github.com/TheFunny/ArisuAutoSweeper synced 2026-01-20 01:05:40 +00:00

Compare commits

..

1 Commits

Author SHA1 Message Date
RedDeadDepresso
e06c86ecf7
Merge 7aeccc9d96 into 2cad7ebbac 2024-01-10 23:23:03 +00:00
3 changed files with 19 additions and 27 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

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

View File

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