Python 部落冲突机器人

问题描述 投票:0回答:1

我是编程初学者,希望自动化在部落冲突中搜索敌人的过程。我希望机器人能够搜索每个敌人 700 000 的资源。当机器人发现敌人时,我希望它发出声音。这是我目前拥有的:

import pyautogui
import time
# ingame recourses 
gold = input(Image)
elexir = input(Image)
dark_elexir input(Image)

# if enemy is found then play sound 
if elexir > 700000:
    play(sound)
    if gold > 700000:
        play(sound)
        if dark_elexir > 2000:
            play(sound)

# if not then skip and go on searching                       
else:
    pyautogui.leftClick(1642, 773, duration=5)
   

time.sleep(3)
#pyautogui.moveTo(<->, up )

# this goes the attack button 
pyautogui.leftClick(200, 920, duration=0.5)
pyautogui.leftClick(1480, 703, duration=1)

# this presses the skip button 
pyautogui.leftClick(1642, 773, duration=5)
pyautogui.leftClick(1642, 773, duration=5)
pyautogui.leftClick(1642, 773, duration=5)

我不知道如何让 python 看到我的屏幕,而且我找不到相关教程。

python python-3.x automation
1个回答
0
投票

我不久前写了一个脚本,它确实可以做到这一点,如果你想要它,请告诉我,我可以找到它。

© www.soinside.com 2019 - 2024. All rights reserved.