获取坐标
import time
import random
import pyautogui
pyautogui.PAUSE = 1
pyautogui.FAILSAFE = True
try:
while True:
x, y = pyautogui.position()
print(str(x) + ', ' + str(y), end=" : ")
r,g,b = pyautogui.screenshot().getpixel((x, y))
print(str(r) + ' ' + str(g) + ' ' + str(b))
time.sleep(2)
except KeyboardInterrupt:
print('unknowed error, plase check!')
1366*768 分辨率 全屏
import time
import random
import pyautogui
pyautogui.PAUSE = 1
pyautogui.FAILSAFE = True
def sleepRandomTime():
time.sleep(random.randint(100,150) / 100)
#游戏开始,卡牌确定,射箭,回合结束的像素点
pos = [(994,629), (686,604), (813,585), (1106,353)]
try:
while True:
#x, y = pyautogui.position()
#print(str(x) + '-' + str(y))
for i in range(0, len(pos)):
pyautogui.click(pos[i])
sleepRandomTime()
except KeyboardInterrupt:
print('unknowed error, plase check!')