这就是我想做的:
将光标从起点X,Y移动到终点X,Y。起点和终点之间是一个红色正方形
我正试图制作一个程序,在检查红场状况的同时做这个动作。如果它在路径中发现一个红方块,它将终止鼠标移动。因此,光标将位于红方块上
有些事。。。喜欢这:
Move Cursor(x1, y1)
While cursor isn't at finish point:
Move Cursor(x2, y2)
if red square:
break
我不需要代码来检测红方块,但我需要有一个方法来移动鼠标,并有一个功能,可以突然终止鼠标移动
有什么想法吗
Tags:
好吧,让我们开始:
首先,您可以使用pyinput,这是一个可实现的库,我曾多次使用它来控制鼠标和键盘,请阅读这里:Pyinput
第二,看看下面我的逐行详细示例:您的代码看起来与之类似
我愿意回答任何问题
我希望这有帮助,祝你好运
相关问题 更多 >
编程相关推荐