diff --git a/.github/workflows/noop.yml b/.github/workflows/noop.yml new file mode 100644 index 000000000..858e938ce --- /dev/null +++ b/.github/workflows/noop.yml @@ -0,0 +1,8 @@ +name: noop +run-name: noop🚀 +on: [push] +jobs: + noop: + runs-on: ubuntu-latest + steps: + - run: echo "done" diff --git a/.gitignore b/.gitignore index f2d8ffb46..608573bbe 100644 --- a/.gitignore +++ b/.gitignore @@ -183,7 +183,7 @@ profile_default/ ipython_config.py # pyenv -.python-version +# .python-version # pipenv # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. @@ -256,3 +256,6 @@ adb_port.ini !popup.exe *.zip .vscode/* + +!config/src.json +.DS_Store diff --git a/.python-version b/.python-version new file mode 100644 index 000000000..c8cfe3959 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.10 diff --git a/assets/share/base/main_page/ROGUE_LEAVE_FOR_GOOD.png b/assets/share/base/main_page/ROGUE_LEAVE_FOR_GOOD.png new file mode 100644 index 000000000..c608ecf22 Binary files /dev/null and b/assets/share/base/main_page/ROGUE_LEAVE_FOR_GOOD.png differ diff --git a/config/src.json b/config/src.json new file mode 100644 index 000000000..8ac099296 --- /dev/null +++ b/config/src.json @@ -0,0 +1,439 @@ +{ + "Alas": { + "Emulator": { + "Serial": "R92X708AKVD", + "GameClient": "android", + "PackageName": "OVERSEA-Asia", + "GameLanguage": "cn", + "ScreenshotMethod": "ADB_nc", + "ControlMethod": "MaaTouch", + "CloudPriorQueue": false, + "AdbRestart": false + }, + "EmulatorInfo": { + "Emulator": "auto", + "name": null, + "path": null + }, + "Error": { + "Restart": "game", + "SaveError": true, + "ScreenshotLength": 1, + "OnePushConfig": "provider: null" + }, + "Optimization": { + "ScreenshotInterval": 0.2, + "CombatScreenshotInterval": 1.0, + "WhenTaskQueueEmpty": "goto_home" + } + }, + "Restart": { + "Scheduler": { + "Enable": true, + "NextRun": "2025-10-28 09:06:14", + "Command": "Restart", + "ServerUpdate": "04:00" + } + }, + "Dungeon": { + "Scheduler": { + "Enable": true, + "NextRun": "2025-10-28 08:48:19", + "Command": "Dungeon", + "ServerUpdate": "04:00" + }, + "Planner": { + "PlannerOverall": { + "time": "2024-10-27 20:54:31", + "comment": "<0.0d", + "value": "100.00%" + }, + "Item_Credit": {}, + "Item_Trailblaze_EXP": {}, + "Item_Traveler_Guide": {}, + "Item_Refined_Aether": {}, + "Item_Lost_Crystal": {}, + "Item_Broken_Teeth_of_Iron_Wolf": {}, + "Item_Endotherm_Chitin": {}, + "Item_Horn_of_Snow": {}, + "Item_Lightning_Crown_of_the_Past_Shadow": {}, + "Item_Storm_Eye": {}, + "Item_Void_Cast_Iron": {}, + "Item_Golden_Crown_of_the_Past_Shadow": {}, + "Item_Netherworld_Token": {}, + "Item_Searing_Steel_Blade": {}, + "Item_Gelid_Chitin": {}, + "Item_Shape_Shifter_Lightning_Staff": {}, + "Item_Ascendant_Debris": {}, + "Item_Nail_of_the_Ape": {}, + "Item_Suppressing_Edict": {}, + "Item_IPC_Work_Permit": {}, + "Item_Raging_Heart": {}, + "Item_Dream_Fridge": {}, + "Item_Nail_of_the_Beast_Coffin": {}, + "Item_A_Glass_of_the_Besotted_Era": {}, + "Item_Dream_Flamer": {}, + "Item_Chordal_Mirage": {}, + "Item_Invasive_Clot": {}, + "Item_Sea_Siren_Torn_Fin": {}, + "Item_Charred_Bud_of_Twilight": {}, + "Item_Darkveil_Moonlight": {}, + "Item_Harbinger_of_Strife": {}, + "Item_Worldbreaker_Blade": {}, + "Item_Arrow_of_the_Starchaser": {}, + "Item_Key_of_Wisdom": {}, + "Item_Safeguard_of_Amber": {}, + "Item_Obsidian_of_Obsession": {}, + "Item_Stellaris_Symphony": {}, + "Item_Flower_of_Eternity": {}, + "Item_Moon_Rage_Fang": {}, + "Item_Countertemporal_Shot": {}, + "Item_Exquisite_Colored_Draft": {}, + "Item_Divine_Amber": {}, + "Item_Heaven_Incinerator": {}, + "Item_Heavenly_Melody": {}, + "Item_Myriad_Fruit": {}, + "Item_Flower_of_Alaya": {}, + "Item_Tracks_of_Destiny": {}, + "Item_Destroyer_Final_Road": {}, + "Item_Guardian_Lament": {}, + "Item_Regret_of_Infinite_Ochema": {}, + "Item_Past_Evils_of_the_Borehole_Planet_Disaster": {}, + "Item_Lost_Echo_of_the_Shared_Wish": {}, + "Item_Auspice_Sliver": {}, + "Item_Daythunder_Anamnesis": {}, + "Item_Squirming_Core": {}, + "Item_Conqueror_Will": {}, + "Item_Silvermane_Medal": {}, + "Item_Ancient_Engine": {}, + "Item_Immortal_Lumintwig": {}, + "Item_Artifex_Gyreheart": {}, + "Item_Dream_Making_Engine": {}, + "Item_Shards_of_Desires": {}, + "Item_Glory_Aspersed_Torso": {}, + "Item_Eternal_Lament": {} + }, + "PlannerTarget": { + "Enable": false, + "LastScan": "2020-01-01 00:00:00", + "Character": "_none_", + "Cone": "_none_", + "Relic": "_none_", + "Ornament": "_none_", + "LevelTarget": "max", + "CharacterLevel": 80, + "ConeLevel": 80, + "AttackLevel": 6, + "SkillLevel": 10, + "UltimateLevel": 10, + "TalentLevel": 10, + "MemoSkillLevel": 6, + "MemoTalentLevel": 6 + }, + "Dungeon": { + "Name": "Calyx_Crimson_Remembrance_Amphoreus_StrifeRuinsCastrumKremnos", + "NameAtDoubleCalyx": "Calyx_Crimson_Remembrance_Amphoreus_StrifeRuinsCastrumKremnos", + "NameAtDoubleRelic": "Cavern_of_Corrosion_Path_of_Aria", + "Team": 1 + }, + "DungeonSupport": { + "Use": "when_daily", + "Character": "FirstCharacter" + }, + "DungeonStorage": { + "TrailblazePower": { + "time": "2025-10-28 07:03:20", + "total": 300, + "value": 62 + }, + "Reserved": { + "time": "2025-10-28 07:03:20", + "total": 2400, + "value": 15 + }, + "Fuel": {}, + "Immersifier": { + "time": "2025-10-28 07:03:20", + "total": 12, + "value": 12 + }, + "DungeonDouble": { + "time": "2025-10-27 21:41:30", + "calyx": 0, + "relic": 0, + "rogue": 0 + }, + "EchoOfWar": { + "time": "2025-05-19 13:01:59", + "total": 3, + "value": 0 + }, + "SimulatedUniverse": { + "time": "2025-10-28 07:03:18", + "total": 14000, + "value": 14000 + }, + "Relic": { + "time": "2025-10-27 21:42:48", + "total": 3000, + "value": 2683 + } + }, + "TrailblazePower": { + "ExtractReservedTrailblazePower": false, + "UseFuel": false, + "FuelOnlyPlanner": false, + "FuelReserve": 5 + } + }, + "Ornament": { + "Scheduler": { + "Enable": false, + "NextRun": "2025-10-28 08:48:19", + "Command": "Ornament", + "ServerUpdate": "04:00" + }, + "Ornament": { + "Dungeon": "Divergent_Universe_Eternal_Comedy", + "UseImmersifier": true, + "DoubleEvent": true, + "UseStamina": false + }, + "DungeonSupport": { + "Use": "when_daily", + "Character": "FirstCharacter" + }, + "TrailblazePower": { + "ExtractReservedTrailblazePower": false, + "UseFuel": false, + "FuelOnlyPlanner": false, + "FuelReserve": 5 + } + }, + "DailyQuest": { + "Scheduler": { + "Enable": true, + "NextRun": "2025-10-28 13:00:00", + "Command": "DailyQuest", + "ServerUpdate": "04:00" + }, + "DailyStorage": { + "DailyActivity": { + "time": "2025-10-27 21:42:37", + "total": 500, + "value": 500 + }, + "DailyQuest": { + "time": "2025-10-27 21:42:37", + "quest1": "", + "quest2": "", + "quest3": "", + "quest4": "", + "quest5": "", + "quest6": "", + "quest7": "", + "quest8": "", + "total": 8, + "value": 8 + } + } + }, + "BattlePass": { + "Scheduler": { + "Enable": true, + "NextRun": "2025-10-28 13:00:00", + "Command": "BattlePass", + "ServerUpdate": "04:00" + }, + "BattlePassStorage": { + "BattlePassLevel": { + "time": "2025-10-27 21:42:31", + "total": 70, + "value": 66 + }, + "BattlePassWeeklyQuest": { + "time": "2025-10-27 21:42:32", + "quest1": "Consume_a_total_of_1_Trailblaze_Power_1400_Trailblazer_Power_max", + "quest2": "Clear_Calyx_1_times", + "quest3": "Use_300000_credits", + "quest4": "Synthesize_Consumables_1_times", + "quest5": "", + "quest6": "", + "quest7": "", + "total": 7, + "value": 3 + }, + "BattlePassSimulatedUniverse": { + "time": "2025-10-27 21:42:32", + "total": 1, + "value": 1 + }, + "BattlePassQuestCalyx": { + "time": "2025-10-27 21:42:32", + "total": 20, + "value": 1 + }, + "BattlePassQuestEchoOfWar": { + "time": "2025-10-27 21:42:32", + "total": 2, + "value": 2 + }, + "BattlePassQuestCredits": { + "time": "2025-10-27 21:42:32", + "total": 300000, + "value": 0 + }, + "BattlePassQuestSynthesizeConsumables": { + "time": "2025-10-27 21:42:32", + "total": 10, + "value": 0 + }, + "BattlePassQuestStagnantShadow": { + "time": "2025-10-24 14:37:16", + "total": 3, + "value": 0 + }, + "BattlePassQuestCavernOfCorrosion": { + "time": "2025-10-27 21:42:32", + "total": 8, + "value": 8 + }, + "BattlePassQuestTrailblazePower": { + "time": "2025-10-27 21:42:32", + "total": 500, + "value": 460 + } + } + }, + "Assignment": { + "Scheduler": { + "Enable": true, + "NextRun": "2025-10-28 13:00:00", + "Command": "Assignment", + "ServerUpdate": "04:00" + }, + "Assignment": { + "ClaimAll": true, + "Name_1": "Nameless_Land_Nameless_People", + "Name_2": "Akashic_Records", + "Name_3": "The_Invisible_Hand", + "Name_4": "Creationism_and_Beyond", + "Duration": 20, + "Event": true, + "Assignment": { + "time": "2025-10-27 21:42:25", + "total": 4, + "value": 4 + } + } + }, + "DataUpdate": { + "Scheduler": { + "Enable": true, + "NextRun": "2025-10-28 13:00:00", + "Command": "DataUpdate", + "ServerUpdate": "04:00" + }, + "ItemStorage": { + "Credit": { + "time": "2025-10-27 21:42:48", + "value": 15431696 + }, + "StallerJade": { + "time": "2025-10-27 21:42:48", + "value": 56952 + } + }, + "CloudStorage": { + "CloudRemainSeasonPass": {}, + "CloudRemainPaid": {}, + "CloudRemainFree": {} + } + }, + "Freebies": { + "Scheduler": { + "Enable": true, + "NextRun": "2025-10-28 13:00:00", + "Command": "Freebies", + "ServerUpdate": "04:00" + }, + "Freebies": { + "SupportReward": true, + "MailReward": true, + "RedemptionCode": true, + "UsedCode": { + "YTKQGE27H57T": { + "used_at": "2025-10-24T14:38:01-07:00" + }, + "NBJ8HEJNZ5NF": { + "used_at": "2025-10-24T14:38:09-07:00" + }, + "UT38ZEJPY573": { + "used_at": "2025-10-24T14:38:15-07:00" + } + } + } + }, + "Weekly": { + "Scheduler": { + "Enable": false, + "NextRun": "2025-10-28 08:48:19", + "Command": "Weekly", + "ServerUpdate": "04:00" + }, + "Weekly": { + "Name": "Echo_of_War_Borehole_Planet_Past_Nightmares", + "Team": 2 + }, + "DungeonSupport": { + "Use": "do_not_use", + "Character": "FirstCharacter" + } + }, + "Rogue": { + "Scheduler": { + "Enable": true, + "NextRun": "2025-10-28 13:00:00", + "Command": "Rogue", + "ServerUpdate": "04:00" + }, + "RogueWorld": { + "World": "Simulated_Universe_World_3", + "Path": "Abundance", + "Bonus": "Miracle Universe", + "DomainStrategy": "combat", + "UseImmersifier": false, + "DoubleEvent": false, + "WeeklyFarming": true, + "UseStamina": false, + "SimulatedUniverseFarm": { + "time": "2025-10-28 07:16:49", + "total": 100, + "value": 100 + } + }, + "RogueBlessing": { + "PresetBlessingFilter": "preset", + "CustomBlessingFilter": "巡猎-3 > 《冠军晚餐·猫的摇篮》 > 丰饶众生,一法界心 > 毁灭-3 \n> 火堆外的夜 > 巡猎-2 > 毁灭-2 > 巡猎 > reset > random", + "PresetCurioFilter": "preset", + "CustomCurioFilter": "博士之袍 > 福灵胶 > 分裂金币 > 信仰债券 > 换境桂冠 > 俱乐部券 > 碎星芳饵 > random", + "PresetResonanceFilter": "preset", + "CustomResonanceFilter": "回响构音:均晶转变 > 回响构音:零维强化\n> 回响构音:第二次初恋 > 回响构音:体验的富翁\n> 回响构音:局外人 > 回响构音:怀疑的四重根\n> 回响构音:诸法无我 > 回响构音:诸行无常\n> 回响构音:射不主皮 > 回响构音:柘弓危矢\n> 回响构音:激变变星 > 回响构音:极端氦闪\n> 回响构音:末日狂欢 > 回响构音:树苗长高舞\n> random", + "SelectionStrategy": "unrecorded-first" + }, + "RogueDebug": { + "DebugMode": false + } + }, + "Daemon": { + "Daemon": { + "Enable": true, + "AimClicker": "do_not_click" + } + }, + "PlannerScan": { + "PlannerScan": { + "ResultAdd": false + } + } +} \ No newline at end of file diff --git a/module/alas.py b/module/alas.py index f6855ccf3..654ee4497 100644 --- a/module/alas.py +++ b/module/alas.py @@ -216,6 +216,12 @@ def get_next_task(self): continue if task.command != 'Restart': self.config.task_call('Restart') + elif method == 'goto_home': + logger.info('Goto home screen during wait') + self.run('goto_home') + release_resources() + self.device.release_during_wait() + if not self.wait_until(task.next_run): del_cached_property(self, 'config') continue elif method == 'goto_main': diff --git a/module/config/argument/args.json b/module/config/argument/args.json index 317e61f22..fcaef1e7f 100644 --- a/module/config/argument/args.json +++ b/module/config/argument/args.json @@ -141,6 +141,7 @@ "option": [ "stay_there", "goto_main", + "goto_home", "close_game", "close_emulator" ] diff --git a/module/config/argument/argument.yaml b/module/config/argument/argument.yaml index b80a16d6e..e772b2a3e 100644 --- a/module/config/argument/argument.yaml +++ b/module/config/argument/argument.yaml @@ -87,7 +87,7 @@ Optimization: CombatScreenshotInterval: 1.0 WhenTaskQueueEmpty: value: goto_main - option: [ stay_there, goto_main, close_game, close_emulator ] + option: [ stay_there, goto_main, goto_home, close_game, close_emulator ] # ==================== Daily ==================== diff --git a/module/config/i18n/en-US.json b/module/config/i18n/en-US.json index b0a29e3d2..dad67442a 100644 --- a/module/config/i18n/en-US.json +++ b/module/config/i18n/en-US.json @@ -232,6 +232,7 @@ "help": "Close AL when there are no pending tasks, can help reduce CPU", "stay_there": "Stay There", "goto_main": "Goto Main Page", + "goto_home": "Goto Home Screen", "close_game": "Close Game", "close_emulator": "Close Emulator" } diff --git a/module/config/i18n/ja-JP.json b/module/config/i18n/ja-JP.json index 846bd6371..99027e9f0 100644 --- a/module/config/i18n/ja-JP.json +++ b/module/config/i18n/ja-JP.json @@ -232,6 +232,7 @@ "help": "Optimization.WhenTaskQueueEmpty.help", "stay_there": "stay_there", "goto_main": "goto_main", + "goto_home": "goto_home", "close_game": "close_game", "close_emulator": "close_emulator" } diff --git a/module/device/app_control.py b/module/device/app_control.py index b6d40b110..60967d55a 100644 --- a/module/device/app_control.py +++ b/module/device/app_control.py @@ -50,6 +50,14 @@ def app_stop(self): else: self.app_stop_adb() + def go_home(self): + method = self.config.Emulator_ControlMethod + logger.info(f'Go home: {self.package}') + # if method in AppControl._app_u2_family: + # self.app_stop_uiautomator2() + # else: + self.go_home_adb() + def hierarchy_timer_set(self, interval=None): if interval is None: interval = 0.1 diff --git a/module/device/connection.py b/module/device/connection.py index 5e17e2760..bd47e2708 100644 --- a/module/device/connection.py +++ b/module/device/connection.py @@ -1054,7 +1054,7 @@ def brute_force_connect(): manager = EmulatorManager() manager.brute_force_connect() - for _ in range(2): + for _ in range(8): logger.info('Here are the available devices, ' 'copy to Alas.Emulator.Serial to use it or set Alas.Emulator.Serial="auto"') devices = self.list_device() @@ -1073,6 +1073,7 @@ def brute_force_connect(): for device in unavailable: logger.info(f'{device.serial} ({device.status})') + time.sleep(3.2) # brute_force_connect if self.config.Emulator_Serial == 'auto' and available.count == 0: logger.warning(f'No available device found') diff --git a/module/device/device.py b/module/device/device.py index f3b830b1e..d3d9a65f0 100644 --- a/module/device/device.py +++ b/module/device/device.py @@ -304,3 +304,8 @@ def app_stop(self): super().app_stop() self.stuck_record_clear() self.click_record_clear() + + def go_home(self): + super().go_home() + self.stuck_record_clear() + self.click_record_clear() diff --git a/module/device/method/adb.py b/module/device/method/adb.py index e6d2bde40..aea3fd1b0 100644 --- a/module/device/method/adb.py +++ b/module/device/method/adb.py @@ -388,6 +388,13 @@ def app_stop_adb(self, package_name=None): package_name = self.package self.adb_shell(['am', 'force-stop', package_name]) + @retry + def go_home_adb(self, package_name=None): + """ Stop one application: am force-stop""" + if not package_name: + package_name = self.package + self.adb_shell(['input', 'keyevent', 'KEYCODE_HOME']) + @retry def dump_hierarchy_adb(self, temp: str = '/data/local/tmp/hierarchy.xml') -> etree._Element: """ diff --git a/src.py b/src.py index 4f0ffcdf3..bbf1cbd97 100644 --- a/src.py +++ b/src.py @@ -1,5 +1,7 @@ from module.alas import AzurLaneAutoScript from module.logger import logger +import argparse +from module.config.config import name_to_function class StarRailCopilot(AzurLaneAutoScript): @@ -26,6 +28,20 @@ def goto_main(self): Login(self.config, device=self.device).app_start() UI(self.config, device=self.device).ui_goto_main() + def goto_home(self): + self.device.go_home() + + def goto_main(self): + from tasks.login.login import Login + from tasks.base.ui import UI + if self.device.app_is_running(): + logger.info('App is already running, goto main page') + UI(self.config, device=self.device).ui_goto_main() + else: + logger.info('App is not running, start app and goto main page') + Login(self.config, device=self.device).app_start() + UI(self.config, device=self.device).ui_goto_main() + def error_postprocess(self): # Exit cloud game to reduce extra fee if self.config.is_cloud_game: @@ -82,5 +98,21 @@ def planner_scan(self): if __name__ == '__main__': + parser = argparse.ArgumentParser(description='StarRailCopilot') + parser.add_argument('task', nargs='?', help='Task to run (e.g. daily_quest, battle_pass, etc.)') + args = parser.parse_args() + src = StarRailCopilot('src') - src.loop() + if args.task: + if hasattr(src, args.task): + if args.task != 'start': + src.start() + # Set and bind the task command before running + src.config.task = name_to_function(args.task) + src.config.bind(args.task) + src.config.init_task(args.task) + getattr(src, args.task)() + else: + logger.error(f'Unknown task: {args.task}') + else: + src.loop() diff --git a/start.sh b/start.sh new file mode 100755 index 000000000..93c2af6c1 --- /dev/null +++ b/start.sh @@ -0,0 +1 @@ +uv run gui.py --port 20013 \ No newline at end of file diff --git a/tasks/base/assets/assets_base_main_page.py b/tasks/base/assets/assets_base_main_page.py index 00705ff87..6601fbb45 100644 --- a/tasks/base/assets/assets_base_main_page.py +++ b/tasks/base/assets/assets_base_main_page.py @@ -33,3 +33,13 @@ button=(730, 551, 760, 587), ), ) +ROGUE_LEAVE_FOR_GOOD = ButtonWrapper( + name='ROGUE_LEAVE_FOR_GOOD', + share=Button( + file='./assets/share/base/main_page/ROGUE_LEAVE_FOR_GOOD.png', + area=(729, 595, 765, 639), + search=(709, 575, 785, 659), + color=(82, 74, 59), + button=(729, 595, 765, 639), + ), +) diff --git a/tasks/base/ui.py b/tasks/base/ui.py index 608f21a49..dfa25458f 100644 --- a/tasks/base/ui.py +++ b/tasks/base/ui.py @@ -4,7 +4,7 @@ from module.exception import GameNotRunningError, GamePageUnknownError, HandledError from module.logger import logger from module.ocr.ocr import Ocr -from tasks.base.assets.assets_base_main_page import ROGUE_LEAVE_FOR_NOW, ROGUE_LEAVE_FOR_NOW_OE +from tasks.base.assets.assets_base_main_page import ROGUE_LEAVE_FOR_GOOD, ROGUE_LEAVE_FOR_NOW_OE from tasks.base.assets.assets_base_page import CLOSE, MAIN_GOTO_CHARACTER, MAP_EXIT, MAP_EXIT_OE from tasks.base.assets.assets_base_popup import POPUP_STORY_LATER from tasks.base.main_page import MainPage @@ -502,7 +502,7 @@ def ui_leave_special(self): continue if self.handle_ui_close(page_gacha.check_button, interval=2): continue - if self.appear_then_click(ROGUE_LEAVE_FOR_NOW, interval=2): + if self.appear_then_click(ROGUE_LEAVE_FOR_GOOD, interval=2): clicked = True continue if self.appear_then_click(ROGUE_LEAVE_FOR_NOW_OE, interval=2): diff --git a/tasks/rogue/entry/entry.py b/tasks/rogue/entry/entry.py index f18019b24..161309bf3 100644 --- a/tasks/rogue/entry/entry.py +++ b/tasks/rogue/entry/entry.py @@ -9,7 +9,7 @@ from module.exception import RequestHumanTakeover, ScriptError from module.logger import logger from module.ocr.ocr import Ocr -from tasks.base.assets.assets_base_main_page import ROGUE_LEAVE_FOR_NOW +from tasks.base.assets.assets_base_main_page import ROGUE_LEAVE_FOR_GOOD from tasks.base.assets.assets_base_page import MAP_EXIT from tasks.base.page import page_guide, page_item, page_main, page_rogue from tasks.dungeon.keywords import DungeonList @@ -305,7 +305,7 @@ def rogue_world_exit(self, skip_first_screenshot=True): continue if self.handle_popup_confirm(): continue - if self.appear_then_click(ROGUE_LEAVE_FOR_NOW, interval=2): + if self.appear_then_click(ROGUE_LEAVE_FOR_GOOD, interval=2): continue def _rogue_teleport(self, skip_first_screenshot=True): diff --git a/tasks/rogue/rogue.py b/tasks/rogue/rogue.py index 11200b25e..cee5c2d81 100644 --- a/tasks/rogue/rogue.py +++ b/tasks/rogue/rogue.py @@ -1,6 +1,6 @@ from module.exception import RequestHumanTakeover from module.logger import logger -from tasks.base.assets.assets_base_main_page import ROGUE_LEAVE_FOR_NOW +from tasks.base.assets.assets_base_main_page import ROGUE_LEAVE_FOR_GOOD from tasks.base.assets.assets_base_page import MAP_EXIT from tasks.rogue.assets.assets_rogue_ui import BLESSING_CONFIRM from tasks.rogue.assets.assets_rogue_weekly import ROGUE_REPORT @@ -32,7 +32,7 @@ def rogue_leave(self, skip_first_screenshot=True): continue if self.handle_popup_confirm(): continue - if self.appear_then_click(ROGUE_LEAVE_FOR_NOW, interval=2): + if self.appear_then_click(ROGUE_LEAVE_FOR_GOOD, interval=2): continue # Blessing if self.handle_blessing(): @@ -111,9 +111,12 @@ def rogue_once(self): def run(self): self.config.update_battle_pass_quests() self.config.update_daily_quests() - if self.config.stored.DungeonDouble.is_expired(): - self.config.task_call('Dungeon') - self.config.task_stop() + + # Skip DungeonDouble check when running directly + if not self.config.task.command.lower() == 'rogue': + if self.config.stored.DungeonDouble.is_expired(): + self.config.task_call('Dungeon') + self.config.task_stop() self.config.task_delay(server_update=True) self.config.task_stop() diff --git a/tasks/rogue/route/loader.py b/tasks/rogue/route/loader.py index dbc0a595a..fac150317 100644 --- a/tasks/rogue/route/loader.py +++ b/tasks/rogue/route/loader.py @@ -5,7 +5,7 @@ from module.base.timer import Timer from module.exception import GameStuckError, HandledError, ScriptError from module.logger import logger, save_error_log -from tasks.base.assets.assets_base_main_page import ROGUE_LEAVE_FOR_NOW +from tasks.base.assets.assets_base_main_page import ROGUE_LEAVE_FOR_GOOD from tasks.base.assets.assets_base_page import MAP_EXIT from tasks.character.switch import CharacterSwitch from tasks.map.keywords import MapPlane