一个外挂代码
先上一小段外挂示例代码:全部代码见https://github.com/asweigart/sushigoroundbot
外挂代码功能为:
1、通过内置图片定位桌面上游戏的左上角位置,
2、进而确定需要点击的按钮位置
3、依次点击按钮
input('Move mouse over bot window and press Enter.')
botWindow = pyautogui.position()
# locate the game window
window = pyautogui.locateOnScreen('top_left_corner.png')
if window is None:
sys.exit('Could not find game on screen. Is the game visible?')
winLeft = window[0]
winTop = window[1]
print('Found game window at:', winLeft, winTop)
# navigate through start screen
pyautogui.click(320 + winLeft, 200 + winTop) # click on Play button
pyautogui.click(300 + winLeft, 380 + winTop) # click on Continue button
pyautogui.click(550 + winLeft, 450 + winTop) # click on Skip
pyau