使用Jupyter(python+opencv)实现特别特别难的脚本-Day4

今天竟然在跑三本的时候发现原来每天的二本是不同的!!!我的天,那就是说还要重新再改,并且我今天发现那个打开地图之后跳转到长安城的坐标是随机的,有的时候会看不到的那个副本NPC所以这个时候我想的最浪费时间的方法就是while一直到match到为止,当然这也是明后天实现了,今天就简单把抓鬼写了,代码也不解释了过于简单。

window = get_window('梦幻西游:时空')
zhuaguiButton1Path = resize_image(r"E:\footbook\zhuaguiButton1.png", window.width / 1500, window.height / 874, 'E:\\footbook\\zhuaguiButton1_newtest1.png')
zhuaguiButton2Path = resize_image(r"E:\footbook\zhuaguiButton2.png", window.width / 1500, window.height / 874, 'E:\\footbook\\zhuaguiButton2_newtest1.png')
zhuaguiButton3Path = resize_image(r"E:\footbook\zhuaguiButton3.png", window.width / 1500, window.height / 874, 'E:\\footbook\\zhuaguiButton3_newtest1.png')
zhuaguiButton4Path = resize_image(r"E:\footbook\zhuaguiButton4.png", window.width / 1500, window.height / 874, 'E:\\footbook\\zhuaguiButton4_newtest1.png')

openMap()
openActiveButton()
click_target(zhuaguiButton1Path, 0.8, 0.5, 10, 3, 1, 0.85, 100)
click_target(zhuaguiButton2Path, 0.5, 0.5, 10, 3, 1, 0.95, 100)

##这里需要设置一个定时器来保证的队伍人数不等于5的时候也能跑
timeout = 4
start_time = time.time()
while time.time() - start_time < timeout:
    if click_target(zhuaguiButton3Path, 0.5, 0.5, 10, 3, 1, 0.85):
        print("点击成功")
        break
else:
    print("10秒内未能成功点击,执行下一步")

clickEverywhere()
click_target(zhuaguiButton4Path, 0.5, 0.5, 10, 3, 1, 0.7, 100)

这实际上就是其中一个def,这个抓鬼还是挺稳定的,下班!!!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值