You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
589 B
Python
29 lines
589 B
Python
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")
|
|
|
|
|