From d34120358a569d313e32e639f8d64170c2d7696b Mon Sep 17 00:00:00 2001 From: Zebartin <16185081+Zebartin@users.noreply.github.com> Date: Tue, 21 May 2024 18:48:12 +0800 Subject: [PATCH 1/3] Fix: Clear content of ASSIGNMENT_ENTRY_LIST if needed --- tasks/assignment/assignment.py | 3 ++- tasks/assignment/ui.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tasks/assignment/assignment.py b/tasks/assignment/assignment.py index 995b0309f..c75e157d8 100644 --- a/tasks/assignment/assignment.py +++ b/tasks/assignment/assignment.py @@ -5,7 +5,7 @@ from tasks.assignment.claim import AssignmentClaim from tasks.assignment.keywords import (KEYWORDS_ASSIGNMENT_GROUP, AssignmentEntry, AssignmentEventEntry, AssignmentEventGroup) -from tasks.assignment.ui import AssignmentStatus +from tasks.assignment.ui import ASSIGNMENT_ENTRY_LIST, AssignmentStatus from tasks.base.page import page_assignment, page_menu from tasks.daily.keywords import KEYWORDS_DAILY_QUEST from tasks.daily.synthesize import SynthesizeUI @@ -33,6 +33,7 @@ class Assignment(AssignmentClaim, SynthesizeUI): self.dispatched = dict() self.has_new_dispatch = False + ASSIGNMENT_ENTRY_LIST.cur_buttons = [] self.ensure_scroll_top(page_menu) self.ui_ensure(page_assignment) event_ongoing = next(( diff --git a/tasks/assignment/ui.py b/tasks/assignment/ui.py index a3d2b3a9b..94e4b4db5 100644 --- a/tasks/assignment/ui.py +++ b/tasks/assignment/ui.py @@ -244,8 +244,9 @@ class AssignmentUI(UI): if timeout.reached(): logger.warning('Wait correct entry loaded timeout') break - if self.appear(EVENT_FINISHED): - logger.info('Event finished') + if isinstance(group, AssignmentEventGroup) and self.appear(EVENT_FINISHED): + logger.info('Correct entry loaded') + ASSIGNMENT_ENTRY_LIST.cur_buttons = [] break ASSIGNMENT_ENTRY_LIST.load_rows(self) From 8b00515fb8a7dd0c761ce16247edbbe999c5a5fe Mon Sep 17 00:00:00 2001 From: Zebartin <16185081+Zebartin@users.noreply.github.com> Date: Tue, 21 May 2024 19:02:45 +0800 Subject: [PATCH 2/3] Upd: [EN] EVENT_COMPLETED --- .../{EVENT_FINISHED.png => EVENT_COMPLETED.png} | Bin assets/en/assignment/ui/EVENT_COMPLETED.png | Bin 0 -> 8738 bytes tasks/assignment/assets/assets_assignment_ui.py | 14 ++++++++++---- tasks/assignment/claim.py | 6 +++--- tasks/assignment/ui.py | 8 ++++---- 5 files changed, 17 insertions(+), 11 deletions(-) rename assets/cn/assignment/ui/{EVENT_FINISHED.png => EVENT_COMPLETED.png} (100%) create mode 100644 assets/en/assignment/ui/EVENT_COMPLETED.png diff --git a/assets/cn/assignment/ui/EVENT_FINISHED.png b/assets/cn/assignment/ui/EVENT_COMPLETED.png similarity index 100% rename from assets/cn/assignment/ui/EVENT_FINISHED.png rename to assets/cn/assignment/ui/EVENT_COMPLETED.png diff --git a/assets/en/assignment/ui/EVENT_COMPLETED.png b/assets/en/assignment/ui/EVENT_COMPLETED.png new file mode 100644 index 0000000000000000000000000000000000000000..3a15aa266647b1924429da85a0b11e561fd2b4f7 GIT binary patch literal 8738 zcmeHMYgm$5yM8sxCTpA-FSR}ro85f*jiy$nrj%6EVf?h5vNTU%Sz02XqM#Dsm)rb2 zPtGnXQ$MpT$M6g&f_Mnaj2z2Dh%b1`GoT@$BCuhuy=Tw0|LFDW&U*b^tLU3*#ZE-Ht!!#oCko7`l0b}n>XoA4+#v=8zbEL)5n3TcROeFlMT4z z-WN7+-YgvT8_`cqqK=(81^~7BW^0!XE5C^SF$f0$-y|45BT=Mn5&(Sr-223_3rPqG z=$#)rNa`Hzc<}g8X4;|5vhV)>A1AsBVjK##nPe8lY&AuExB2t;Yesc(Zi1+(^faKW z-Kb!`Zu6tdU+3?S3A%G_+ml0C^24qIKBk~TC;2t*qfUmA&bbf}xuAhO;2HR$G)L=I60gUzL=su&b4AWa*q#DduzJQ6| zq=p;sGE7Y@03*HGb$@;7`ZcYG#Cqneqr^HQt{0B=BKdzt2>3HcFlW9r0#b=_s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=M6$8b&!2pr_luSUFw#4TRNL^=zLj zO8cvil}fpoq_d&X5S%(De+@4m;JbOIaKcy#O@(N8Pq%@4jv+$~jGzyZL=F_PZ*=q# z?9JiqCopHrndpGg>FMi)VaubY(kQWF>doEm<{+}=>g)l@DnDAMXAdCaBd0RE?w6^Q zi^S-MI7j`}g!FOAADkEUT~6P*f!7k^(zZ}rTdclh%sxKHKT+9z1+^zEY&B%GBC-pl zIeE~~(Vd}u=!@_1t{qhjK|@@ab^q;twU~tcT#wo`%y2AZE!MPMqv@IBbfk@lW*mO< z&BF_q?!@hDu5p5Eeb)w6(Qz*L+<2yWkd}8*ZgK&}$DR;UC4RD$Nk`mis zhIK_W#S1dLxW#b%*j2&}3@M|~9n-K;&m+u|`*Pa1Lk1ZfQi_TVL1s`cCighV|a= zF2k*^_p$$w&Fg*aKgsX^&bRefk@Xj#b(Hv1b8Q_Z)=^^pwaXv{*5AbcpA^ZL(GneS Xdu*j?xV@&p;CJtnXHQfe55M)FZuMo7 literal 0 HcmV?d00001 diff --git a/tasks/assignment/assets/assets_assignment_ui.py b/tasks/assignment/assets/assets_assignment_ui.py index 26379e15b..03cda2fdc 100644 --- a/tasks/assignment/assets/assets_assignment_ui.py +++ b/tasks/assignment/assets/assets_assignment_ui.py @@ -116,16 +116,22 @@ ENTRY_LOADED = ButtonWrapper( button=(474, 161, 491, 615), ), ) -EVENT_FINISHED = ButtonWrapper( - name='EVENT_FINISHED', +EVENT_COMPLETED = ButtonWrapper( + name='EVENT_COMPLETED', cn=Button( - file='./assets/cn/assignment/ui/EVENT_FINISHED.png', + file='./assets/cn/assignment/ui/EVENT_COMPLETED.png', area=(700, 300, 752, 331), search=(680, 280, 772, 351), color=(223, 215, 195), button=(700, 300, 752, 331), ), - en=None, + en=Button( + file='./assets/en/assignment/ui/EVENT_COMPLETED.png', + area=(721, 302, 851, 331), + search=(701, 282, 871, 351), + color=(229, 220, 200), + button=(721, 302, 851, 331), + ), ) EXP_MATERIALS_CREDITS_CHECK = ButtonWrapper( name='EXP_MATERIALS_CREDITS_CHECK', diff --git a/tasks/assignment/claim.py b/tasks/assignment/claim.py index 4118fe3fd..be18e0fcd 100644 --- a/tasks/assignment/claim.py +++ b/tasks/assignment/claim.py @@ -4,7 +4,7 @@ from module.config.stored.classes import now from module.logger import logger from module.ocr.ocr import Duration from tasks.assignment.assets.assets_assignment_claim import * -from tasks.assignment.assets.assets_assignment_ui import EVENT_FINISHED +from tasks.assignment.assets.assets_assignment_ui import EVENT_COMPLETED from tasks.assignment.dispatch import AssignmentDispatch from tasks.assignment.keywords import AssignmentEntry from tasks.base.page import page_assignment @@ -80,8 +80,8 @@ class AssignmentClaim(AssignmentDispatch): if self.appear(page_assignment.check_button): logger.info('Assignment report is closed') break - if self.appear(EVENT_FINISHED): - logger.info('Event finished') + if self.appear(EVENT_COMPLETED): + logger.info('Event completed') return # Close report if self.appear(REPORT, interval=1): diff --git a/tasks/assignment/ui.py b/tasks/assignment/ui.py index 94e4b4db5..d187207c4 100644 --- a/tasks/assignment/ui.py +++ b/tasks/assignment/ui.py @@ -224,8 +224,8 @@ class AssignmentUI(UI): if timeout.reached(): logger.warning('Wait entry loaded timeout') break - if self.appear(EVENT_FINISHED): - logger.info('Event finished') + if self.appear(EVENT_COMPLETED): + logger.info('Event completed') break if self.appear(ASSIGNMENT_CHECK) and \ self.image_color_count(ENTRY_LOADED, (35, 35, 35), count=800): @@ -244,13 +244,13 @@ class AssignmentUI(UI): if timeout.reached(): logger.warning('Wait correct entry loaded timeout') break - if isinstance(group, AssignmentEventGroup) and self.appear(EVENT_FINISHED): + if isinstance(group, AssignmentEventGroup) and self.appear(EVENT_COMPLETED): logger.info('Correct entry loaded') ASSIGNMENT_ENTRY_LIST.cur_buttons = [] break ASSIGNMENT_ENTRY_LIST.load_rows(self) - if all( + if ASSIGNMENT_ENTRY_LIST.cur_buttons and all( x.matched_keyword.group == group for x in ASSIGNMENT_ENTRY_LIST.cur_buttons ): From 5a55a5917b81dd50e4021afe202c452af371fe6d Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Wed, 22 May 2024 19:19:58 +0800 Subject: [PATCH 3/3] Fix: combat_wave_cost was reset in combat again --- tasks/combat/combat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/combat/combat.py b/tasks/combat/combat.py index 2aca59b2d..e8be4cf2b 100644 --- a/tasks/combat/combat.py +++ b/tasks/combat/combat.py @@ -86,8 +86,6 @@ class Combat(CombatInteract, CombatPrepare, CombatState, CombatTeam, CombatSuppo support_set = False else: support_set = True - # Reset combat_wave_cost, so handle_combat_interact() won't activate before handle_combat_prepare() - self.combat_wave_cost = 10 logger.info([support_character, support_set]) trial = 0 while 1: @@ -363,6 +361,8 @@ class Combat(CombatInteract, CombatPrepare, CombatState, CombatTeam, CombatSuppo finish = self.combat_finish() if self._combat_should_reenter(): continue + # Reset combat_wave_cost, so handle_combat_interact() won't activate before handle_combat_prepare() + self.combat_wave_cost = 10 if finish: break