今天竟然在跑三本的时候发现原来每天的二本是不同的!!!我的天,那就是说还要重新再改,并且我今天发现那个打开地图之后跳转到长安城的坐标是随机的,有的时候会看不到的那个副本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,这个抓鬼还是挺稳定的,下班!!!