Merge pull request #680 from LmeSzinc/dev

Bug fix
This commit is contained in:
LmeSzinc 2024-11-22 23:22:47 +08:00 committed by GitHub
commit bf62eccaaa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 25 additions and 26 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

View File

@ -38,14 +38,14 @@ MAY_OBTAIN = ButtonWrapper(
cn=Button(
file='./assets/cn/combat/obtain/MAY_OBTAIN.png',
area=(813, 379, 893, 397),
search=(812, 330, 895, 468),
search=(800, 166, 975, 545),
color=(63, 71, 87),
button=(813, 379, 893, 397),
),
en=Button(
file='./assets/en/combat/obtain/MAY_OBTAIN.png',
area=(813, 379, 922, 397),
search=(812, 330, 922, 468),
search=(800, 166, 975, 545),
color=(53, 61, 78),
button=(813, 379, 922, 397),
),

View File

@ -37,10 +37,10 @@ OCR_DOUBLE_EVENT_REMAIN = ButtonWrapper(
name='OCR_DOUBLE_EVENT_REMAIN',
share=Button(
file='./assets/share/dungeon/event/OCR_DOUBLE_EVENT_REMAIN.png',
area=(517, 239, 1081, 261),
search=(497, 219, 1101, 281),
color=(198, 161, 90),
button=(517, 239, 1081, 261),
area=(517, 177, 1087, 199),
search=(497, 157, 1107, 219),
color=(198, 163, 97),
button=(517, 177, 1087, 199),
),
)
OCR_DOUBLE_EVENT_REMAIN_AT_COMBAT = ButtonWrapper(

View File

@ -37,10 +37,10 @@ SIMULATED_UNIVERSE_LOADED_CLASSIC = ButtonWrapper(
name='SIMULATED_UNIVERSE_LOADED_CLASSIC',
share=Button(
file='./assets/share/dungeon/ui_rogue/SIMULATED_UNIVERSE_LOADED_CLASSIC.png',
area=(549, 607, 572, 629),
search=(529, 587, 592, 649),
color=(147, 137, 157),
button=(549, 607, 572, 629),
area=(507, 501, 547, 541),
search=(465, 172, 588, 656),
color=(157, 155, 157),
button=(507, 501, 547, 541),
),
)
SURVIVAL_INDEX_OE_LOADED = ButtonWrapper(

View File

@ -1,5 +1,5 @@
from module.base.timer import Timer
from module.base.utils import random_rectangle_vector
from module.base.utils import area_in_area, random_rectangle_vector
from module.logger import logger
from tasks.base.page import page_guide
from tasks.dungeon.assets.assets_dungeon_ui import *
@ -94,17 +94,6 @@ class DungeonRogueUI(DungeonUI):
Swipe down to find teleport button of classic rogue
Note that this method will change SIMULATED_UNIVERSE_LOADED_CLASSIC.search, original value should have a backup
"""
# Already having classic rogue entry insight
SIMULATED_UNIVERSE_LOADED_CLASSIC.load_search(OCR_DUNGEON_LIST.button)
if self.appear(SIMULATED_UNIVERSE_LOADED_CLASSIC):
buttons = TELEPORT.match_multi_template(self.device.image)
y = SIMULATED_UNIVERSE_LOADED_CLASSIC.button[1]
for button in buttons:
# And having a teleport button below
if button.button[1] > y:
logger.info('Classic rogue teleport already in sight')
return True
logger.info('Dungeon rogue swipe down')
interval = Timer(2, count=4)
while 1:
@ -114,10 +103,20 @@ class DungeonRogueUI(DungeonUI):
self.device.screenshot()
# End
if self.appear(SIMULATED_UNIVERSE_LOADED_CLASSIC):
if self.appear(LAST_TELEPORT):
logger.info('Classic rogue teleport at end')
return True
if self.appear(SIMULATED_UNIVERSE_LOADED_CLASSIC, interval=3):
logger.info('Found rogue icon')
# Search teleport button on the right
_, y1, _, y2 = SIMULATED_UNIVERSE_LOADED_CLASSIC.button
x1, _, x2, _ = TELEPORT.area
search = (x1 - 50, y1 - 120, x2 + 50, y2 + 120)
# Check if button in search area
for button in TELEPORT.match_multi_template(self.device.image):
if area_in_area(button.button, search, threshold=0):
logger.info('Found rogue TELEPORT')
self.device.click(button)
return True
# TELEPORT not found
self.interval_clear(SIMULATED_UNIVERSE_LOADED_CLASSIC)
# Swipe
if interval.reached():