2023-10-18 16:07:17 +00:00
|
|
|
from module.logger import logger
|
2023-10-18 13:01:48 +00:00
|
|
|
from tasks.rogue.entry.entry import RogueEntry
|
2023-10-18 18:13:51 +00:00
|
|
|
from tasks.rogue.exception import RogueReachedWeeklyPointLimit, RogueTeamNotPrepared
|
2023-10-14 16:32:40 +00:00
|
|
|
from tasks.rogue.route.loader import RouteLoader
|
|
|
|
|
|
|
|
|
2023-10-18 16:21:00 +00:00
|
|
|
class Rogue(RouteLoader, RogueEntry):
|
2023-10-14 16:32:40 +00:00
|
|
|
def rogue_once(self):
|
|
|
|
"""
|
|
|
|
Do a complete rogue run.
|
|
|
|
|
|
|
|
Pages:
|
2023-10-18 13:01:48 +00:00
|
|
|
in: Any
|
2023-10-14 16:32:40 +00:00
|
|
|
out: page_rogue, is_page_rogue_main()
|
|
|
|
"""
|
2023-10-18 16:07:17 +00:00
|
|
|
try:
|
|
|
|
self.rogue_world_enter()
|
|
|
|
except RogueTeamNotPrepared:
|
|
|
|
logger.error(f'Please prepare your team in {self.config.RogueWorld_World}')
|
|
|
|
self.rogue_world_exit()
|
|
|
|
return False
|
2023-10-18 18:13:51 +00:00
|
|
|
except RogueReachedWeeklyPointLimit:
|
|
|
|
logger.hr('Reached rogue weekly point limit')
|
|
|
|
return False
|
2023-10-18 16:07:17 +00:00
|
|
|
|
2023-10-14 16:32:40 +00:00
|
|
|
self.rogue_run()
|
|
|
|
self.rogue_reward_claim()
|
2023-10-18 16:07:17 +00:00
|
|
|
return True
|
2023-10-14 16:32:40 +00:00
|
|
|
|
2023-10-18 16:21:00 +00:00
|
|
|
def run(self):
|
2023-10-18 18:13:51 +00:00
|
|
|
while 1:
|
|
|
|
# Run
|
|
|
|
success = self.rogue_once()
|
|
|
|
if not success:
|
|
|
|
break
|
|
|
|
|
2023-10-20 18:25:18 +00:00
|
|
|
# Scheduler
|
|
|
|
if self.config.task_switched():
|
|
|
|
self.config.task_stop()
|
|
|
|
|
2023-10-18 16:21:00 +00:00
|
|
|
self.config.task_delay(server_update=True)
|
|
|
|
|
2023-10-14 16:32:40 +00:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2023-10-18 16:21:00 +00:00
|
|
|
self = Rogue('src', task='Rogue')
|
2023-10-14 16:32:40 +00:00
|
|
|
self.device.screenshot()
|
|
|
|
self.rogue_once()
|