Skip to content

Commit

Permalink
fix : default_config error and scheduler start when ui is not started
Browse files Browse the repository at this point in the history
  • Loading branch information
pur1fying committed Jul 17, 2024
1 parent 783a66a commit 33d1f36
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 0 additions & 2 deletions core/default_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@
"unfinished_hard_tasks": [],
"mainlinePriority": "5-1-1",
"unfinished_normal_tasks": [],
"explore_normal_task_force_each_fight" : false,
"main_story_regions": "",
"rewarded_task_times": "2,2,2",
"purchase_rewarded_task_ticket_times": "0",
Expand Down Expand Up @@ -358,7 +357,6 @@
"emulatorMultiInstanceNumber": 0,
"multiEmulatorName": "mumu",
"manual_boss": false,
"explore_normal_task_force_sss": true,
"burst1": "1",
"burst2": "2",
"pierce1": "1",
Expand Down
6 changes: 4 additions & 2 deletions core/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,14 @@ def heartbeat(self):
self._current_task = self._valid_task_queue[0]
self._currentTaskDisplay = self.event_map[self._current_task['current_task']]
self._valid_task_queue.pop(0)
self.update_signal.emit([self._currentTaskDisplay, *self._waitingTaskDisplayQueue])
if self.update_signal is not None:
self.update_signal.emit([self._currentTaskDisplay, *self._waitingTaskDisplayQueue])
return self._current_task
else:
if self.first_waiting:
self.first_waiting = False
self.update_signal.emit(["暂无任务"])
if self.update_signal is not None:
self.update_signal.emit(["暂无任务"])
return None

def update_valid_task_queue(self):
Expand Down
7 changes: 4 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,17 @@ def operate_item(self, item):
if __name__ == '__main__':
t = Main(ocr_needed=["NUM", "CN", "Global"])
t.init_static_config()
config = ConfigSet(config_dir="1708148000")
config = ConfigSet(config_dir="default_config")
tt = Baas_thread(config, None, None, None)
tt.static_config = t.static_config
tt.init_all_data()
tt.ocr = t.ocr
tt.thread_starter()
# tt.solve("refresh_uiautomator2")
# tt.solve("explore_activity_challenge")
# tt.solve("activity_sweep")
tt.solve("explore_activity_mission")
tt.solve("explore_activity_story")
# tt.solve("explore_activity_mission")
# tt.solve("explore_activity_story")
# tt.solve("common_shop")
# tt.solve("total_assault")
# tt.solve("cafe_reward")
Expand Down

0 comments on commit 33d1f36

Please sign in to comment.