Skip to content

Commit

Permalink
使开始脚本后第一时间操作,不等待检测游戏失败
Browse files Browse the repository at this point in the history
  • Loading branch information
ccc007ccc committed Aug 16, 2024
1 parent 7126e95 commit b1a7ee4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
keyboard
pyautogui
opencv-python
opencv-python
pyscreeze
Pillow
7 changes: 5 additions & 2 deletions start.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def start_script(e):
# keyboard.press("j")
# fast = True
# continue_running = True
go_to_top_left()
# 启动自动重开
pag_running = True
threading.Thread(target=click_over_img, daemon=True).start()
Expand Down Expand Up @@ -92,10 +93,10 @@ def click_over_img():
# print(height, width)
#左上角
left_top_x = int(width/3)
left_top_y = int(height/3)
left_top_y = int(height/5)
#右下角
right_bottom_x = int(width - width/3)
right_bottom_y = int(height - height/3)
right_bottom_y = int(height - height/5)
# print(left_top_x, left_top_y, right_bottom_x, right_bottom_y)

while pag_running:
Expand All @@ -104,6 +105,8 @@ def click_over_img():
if img != None:
continue_running = False
pyg.click(img)
# 移动光标到左上角
pyg.moveTo(left_top_x, left_top_y)
time.sleep(1.5)
go_to_top_left()
rounds += 1
Expand Down

0 comments on commit b1a7ee4

Please sign in to comment.