流放之路相关
parent
8277d4481e
commit
1e08543e56
@ -0,0 +1,28 @@
|
||||
import random
|
||||
import time
|
||||
import pyautogui
|
||||
TARGET = (1935, 615)
|
||||
|
||||
|
||||
|
||||
def get_all_target():
|
||||
for i in range(12):
|
||||
x = TARGET[0] + 53 * i
|
||||
for j in range(5):
|
||||
y = TARGET[1] + 53 * j
|
||||
yield x, y
|
||||
|
||||
|
||||
def collect():
|
||||
# 按下ctrl
|
||||
pyautogui.keyDown("ctrl") # hold down the shift key
|
||||
time.sleep(random.random())
|
||||
for x, y in get_all_target():
|
||||
pyautogui.moveTo(x, y, random.random() / 20)
|
||||
time.sleep(random.random() / 20)
|
||||
pyautogui.leftClick()
|
||||
time.sleep(random.random())
|
||||
# 松开ctrl
|
||||
pyautogui.press("ctrl")
|
||||
|
||||
|
@ -0,0 +1,21 @@
|
||||
import threading
|
||||
from pynput import keyboard
|
||||
|
||||
IS_START = False
|
||||
|
||||
def get_start():
|
||||
return IS_START
|
||||
|
||||
def listener_keyword():
|
||||
def on_press(key):
|
||||
global IS_START
|
||||
try:
|
||||
if key.char == "=":
|
||||
IS_START = not IS_START
|
||||
print(f"IS_START: {IS_START}")
|
||||
except AttributeError:
|
||||
pass
|
||||
with keyboard.Listener(on_press=on_press) as listener:
|
||||
listener.join()
|
||||
threading.Thread(target=listener_keyword).start()
|
||||
|
@ -0,0 +1,50 @@
|
||||
import time
|
||||
import random
|
||||
from pynput import keyboard, mouse
|
||||
from start import get_start
|
||||
import threading
|
||||
import pyautogui
|
||||
from collect import collect, get_all_target
|
||||
|
||||
pyautogui.FAILSAFE = True
|
||||
pyautogui.PAUSE = 0.02
|
||||
|
||||
|
||||
SOURCE = (490, 400)
|
||||
|
||||
|
||||
def rep():
|
||||
for x, y in get_all_target():
|
||||
# 鼠标移动到SOURCE
|
||||
pyautogui.moveTo(SOURCE[0], SOURCE[1], random.random() / 5)
|
||||
time.sleep(random.random() / 30)
|
||||
|
||||
# 右键
|
||||
pyautogui.rightClick()
|
||||
time.sleep(random.random() / 30)
|
||||
|
||||
# 放到 x, y
|
||||
pyautogui.moveTo(x, y, random.random() / 5)
|
||||
time.sleep(random.random() / 30)
|
||||
|
||||
# 左键
|
||||
pyautogui.leftClick()
|
||||
|
||||
|
||||
while True:
|
||||
if get_start() == False:
|
||||
continue
|
||||
rep()
|
||||
collect()
|
||||
collect()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue