Skip to content

Commit

Permalink
fix explore task
Browse files Browse the repository at this point in the history
  • Loading branch information
pur1fying committed Jan 3, 2024
1 parent 0cae17f commit c02e5c1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
4 changes: 4 additions & 0 deletions core/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,7 @@ def get_next_execute_time(self):
_valid_event.sort(key=lambda x: x['next_tick'])
return _valid_event[0]['next_tick'] - time.time()

def change_display(self, task_name):
self._display_config['running'] = task_name
self._commit_change()
self.update_signal.emit()
9 changes: 6 additions & 3 deletions module/explore_hard_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@


def implement(self):
self.scheduler.change_display("困难关推图")
t = self.config['explore_hard_task_list']
if type(t) is int:
t = str(t)
Expand All @@ -23,6 +24,8 @@ def implement(self):
self.quick_method_to_main_page()
# test_(self)
hard_task.to_hard_event(self)
self.logger.info("Add screen shot interval to 1.0 seconds")
self.screenshot_interval = 1.0
for i in range(0, len(tasks)):
data = tasks[i].split('-')
region = int(data[0])
Expand Down Expand Up @@ -220,7 +223,7 @@ def start_action(self, stage_data):

def start_choose_side_team(self, index):
if index not in [1, 2, 3, 4]:
self.exit("No formation added into corresponding config")
exit("No formation added into corresponding config")
self.logger.info("According to the config. Choose formation {0}".format(index))
loy = [195, 275, 354, 423]
y = loy[index - 1]
Expand Down Expand Up @@ -264,7 +267,7 @@ def choose_team(self, number, position, data):
to_formation_edit_i(self, index, position)
if color.judge_rgb_range(self.latest_img_array, 1166, 684, 250, 255, 105, 125, 68, 88) \
and color.judge_rgb_range(self.latest_img_array, 1156, 626, 250, 255, 105, 125, 68, 88):
self.exit("please choose another formation")
exit("please choose another formation")
to_normal_task_wait_to_begin_page(self)
return index

Expand Down Expand Up @@ -428,7 +431,7 @@ def test_(self):
for n, p in self.stage_data[mission]['start'].items():
cu_index = choose_team(self, mission, n)
if cu_index < prev_index:
self.exit("please set the first formation number smaller than the second one")
exit("please set the first formation number smaller than the second one")
prev_index = cu_index
start_mission(self)
if self.server == 'CN':
Expand Down
11 changes: 7 additions & 4 deletions module/explore_normal_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@


def implement(self):
self.scheduler.change_display("普通关推图")
self.quick_method_to_main_page()
# test_(self)
normal_task.to_normal_event(self)
self.logger.info("Add screen shot interval to 1.0 seconds")
self.screenshot_interval = 1.0
for i in range(0, len(self.config['explore_normal_task_regions'])):
region = self.config['explore_normal_task_regions'][i]
if not 4 <= region <= 16:
Expand Down Expand Up @@ -211,7 +214,7 @@ def start_action(self, gk, stage_data):

def start_choose_side_team(self, index):
if index not in [1, 2, 3, 4]:
self.exit("No formation added into corresponding config")
exit("No formation added into corresponding config")
self.logger.info("According to the config. Choose formation {0}".format(index))
loy = [195, 275, 354, 423]
y = loy[index - 1]
Expand Down Expand Up @@ -251,11 +254,11 @@ def choose_team(self, mission_num, force):
index = self.config[self.stage_data[mission_num]['attr'][force]]
self.logger.info("According to the config. Choose formation {0}".format(index))
if index not in [1, 2, 3, 4]:
self.exit("No formation added into corresponding config")
exit("No formation added into corresponding config")
to_formation_edit_i(self, index, self.stage_data[mission_num]['start'][force])
if color.judge_rgb_range(self.latest_img_array, 1166, 684, 250, 255, 105, 125, 68, 88) \
and color.judge_rgb_range(self.latest_img_array, 1156, 626, 250, 255, 105, 125, 68, 88):
self.exit("please choose another formation")
exit("please choose another formation")
to_normal_task_wait_to_begin_page(self)
return index

Expand Down Expand Up @@ -415,7 +418,7 @@ def test_(self):
for n, p in self.stage_data[mission]['start'].items():
cu_index = choose_team(self, mission, n)
if cu_index < prev_index:
self.exit("please set the first formation number smaller than the second one")
exit("please set the first formation number smaller than the second one")
prev_index = cu_index
start_mission(self)
if self.server == 'CN':
Expand Down

0 comments on commit c02e5c1

Please sign in to comment.