misakamikodo / mhxy_script

梦幻西游手游脚本(基于pyautogui、opencv,在python环境下运行文件)
168 stars 62 forks source link

东海湾挖矿 #18

Closed chenliangqi123 closed 6 months ago

chenliangqi123 commented 8 months ago

作者您好 可以在mine.py脚本中加入东海湾地图吗

misakamikodo commented 8 months ago
from mhxy import *

if __name__ == '__main__':
    init(idx=1)
    while True:
        t = Util.locateCenterOnScreen(r'resources/small/kuang.png')
        if t is not None:
            pyautogui.leftClick(t.x, t.y)
            cooldown(0.1)
            t = Util.locateCenterOnScreen(r'resources/small/select.png')
            if t is not None:
                pyautogui.leftClick(t.x, t.y)
            cooldown(5)
            t = Util.locateCenterOnScreen(r'resources/small/dig.png')
            if t is not None:
                pyautogui.leftClick(t.x, t.y)
                cooldown(5)
        cooldown(2)

这样看见矿就挖,挂三四次就两级了

chenliangqi123 commented 8 months ago

大佬 你是不是加了三个png图片在resouces/small目录下面。。。

chenliangqi123 commented 8 months ago

还有一个问题就是给脚本权限的问题 我之前脚本是可以控制鼠标的 今天用了一下脚本不知道为什么脚本无法控制鼠标

misakamikodo commented 8 months ago

大佬 你是不是加了三个png图片在resouces/small目录下面。。。

是的,就是对应mine/norm_grey_mine.png、mine/mine_select.png 、mine/collect.png 这三个

misakamikodo commented 8 months ago

还有一个问题就是给脚本权限的问题 我之前脚本是可以控制鼠标的 今天用了一下脚本不知道为什么脚本无法控制鼠标

除了没用管理员启动,别的我就不知道了