Skip to content

Commit

Permalink
use_bit_blt slow
Browse files Browse the repository at this point in the history
  • Loading branch information
ok-oldking committed Jul 2, 2024
1 parent 19bb984 commit 0920475
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
8 changes: 4 additions & 4 deletions config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os

from ok.interaction.PostMessageInteraction import PostMessageInteraction
from ok.util.path import get_path_in_package
from src.task.AutoCombatTask import AutoCombatTask
from src.task.FarmEchoTask import FarmEchoTask
Expand Down Expand Up @@ -32,8 +31,9 @@ def calculate_pc_exe_path(running_path):
'windows': { # required when supporting windows game
'exe': 'Client-Win64-Shipping.exe',
'calculate_pc_exe_path': calculate_pc_exe_path,
'interaction': PostMessageInteraction,
'can_bit_blt': False # default false, opengl games does not support bit_blt
'interaction': 'PostMessage',
'can_bit_blt': True, # default false, opengl games does not support bit_blt
'bit_blt_render_full': True
},
'supported_resolution': {
'ratio': '16:9',
Expand All @@ -49,7 +49,7 @@ def calculate_pc_exe_path(running_path):
'use_proxy': True
},
'about': """
<h3>OK-Wuthering-Waves</h3>
<h3>OK-WW</h3>
<p>免费开源软件 <a href="https://github.com/ok-oldking/ok-wuthering-waves">https://github.com/ok-oldking/ok-wuthering-waves</></p>
<p>报告问题BUG <a href="https://github.com/ok-oldking/ok-wuthering-waves/issues/new?assignees=ok-oldking&labels=bug&projects=&template=%E6%8A%A5%E5%91%8Abug-.md&title=%5BBUG%5D">https://github.com/ok-oldking/ok-baijing/issues/new?assignees=ok-oldking&labels=bug&projects=&template=%E6%8A%A5%E5%91%8Abug-.md&title=%5BBUG%5D</></p>
<p>QQ群:<a href="https://qm.qq.com/q/aGO7eBJ2Uw">594495691</a></p>
Expand Down
7 changes: 4 additions & 3 deletions src/combat/CombatCheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ def check_boss(self):
def screenshot_boss_lv(self, current, name):
if self.debug:
if self.boss_lv_box is not None and self.boss_lv_edge is not None and current is not None:
self.frame[self.boss_lv_box.y:self.boss_lv_box.y + self.boss_lv_box.height,
frame = self.frame.copy()
frame[self.boss_lv_box.y:self.boss_lv_box.y + self.boss_lv_box.height,
self.boss_lv_box.x:self.boss_lv_box.x + self.boss_lv_box.width] = current
x, y, w, h = self.boss_lv_box.x, self.boss_lv_box.height + 50 + self.boss_lv_box.y, self.boss_lv_box.width, self.boss_lv_box.height
self.frame[y:y + h, x:x + w] = self.boss_lv_edge
self.screenshot(name)
frame[y:y + h, x:x + w] = self.boss_lv_edge
self.screenshot(name, frame)

def in_combat(self):
if self.in_liberation:
Expand Down
20 changes: 15 additions & 5 deletions src/task/FarmEchoTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def __init__(self):
}
self.config_type["Entrance Direction"] = {'type': "drop_down", 'options': ['Forward', 'Backward']}
self.crownless_pos = (0.9, 0.4)
self.last_drop = False

def run(self):
self.handler.post(self.mouse_reset, 0.01)
Expand All @@ -47,6 +48,7 @@ def run(self):

# loop here
count = 0

while count < self.config.get("Repeat Farm Count", 0):
count += 1
self.wait_until(lambda: self.in_team()[0], time_out=40)
Expand Down Expand Up @@ -77,15 +79,22 @@ def run(self):
logger.info(f'farm echo move forward walk_until_f to find echo')
if self.walk_until_f(time_out=4, raise_if_not_found=False): # find and pick echo
logger.debug(f'farm echo found echo move forward walk_until_f to find echo')
self.info['Echo Count'] = self.info.get('Echo Count', 0) + 1
self.incr_drop(True)
elif not self.last_drop: # only search for the guaranteed drop
self.incr_drop(self.find_echo_drop())
else:
self.find_echo_drop()
self.incr_drop(False)
self.sleep(0.5)
self.send_key('esc')
self.wait_click_feature('gray_confirm_exit_button', relative_x=-1, raise_if_not_found=True,
use_gray_scale=True)
self.wait_in_team_and_world(time_out=40)
self.sleep(1)
self.sleep(2)

def incr_drop(self, dropped):
if dropped:
self.info['Echo Count'] = self.info.get('Echo Count', 0) + 1
self.last_drop = dropped

def choose_level(self, start):
y = 0.17
Expand Down Expand Up @@ -136,9 +145,10 @@ def find_echo_drop(self):
self.sleep(1)
self.send_key('a', down_time=0.05)
self.sleep(1)
self.screenshot(f'pick_echo_{highest_index}')
if self.debug:
self.screenshot(f'pick_echo_{highest_index}')
logger.info(f'found echo {highest_index} walk')
self.walk_until_f(raise_if_not_found=False, time_out=5)
return self.walk_until_f(raise_if_not_found=False, time_out=5)


echo_color = {
Expand Down

0 comments on commit 0920475

Please sign in to comment.