autopy的使用探索
发布时间:2020-12-14 02:41:39 所属栏目:Windows 来源:网络整理
导读:autopy这个包可以直接操作电脑的一些行为,比如点击,移动鼠标啥的,但是可能只使用于windows,用处有限,不过做个简单的游戏辅助还是可以的。 网上资料贼少,很多不能用的,现总结一些可以用的放在这: import autopyautopy.alert.alert( ‘ hello ‘ )autopy
autopy这个包可以直接操作电脑的一些行为,比如点击,移动鼠标啥的,但是可能只使用于windows,用处有限,不过做个简单的游戏辅助还是可以的。 网上资料贼少,很多不能用的,现总结一些可以用的放在这: import autopy autopy.alert.alert(‘hello‘) autopy.mouse.move(100,100) autopy.mouse.smooth_move(400,400) print(autopy.mouse.location()) width,height = autopy.screen.size() print(width,height) a = autopy.bitmap.capture_screen().get_color(1,1) b = autopy.screen.get_color(1,1) autopy.bitmap.capture_screen().save(‘lfsenior.png‘) autopy.mouse.click() autopy.mouse.toggle(None,True) autopy.mouse.toggle(None,False) autopy.mouse.toggle(down=True,button=None) autopy.mouse.toggle(True) def where_is_the_rubbish(): ‘‘‘查找回收站在屏幕中的位置‘‘‘ rubbish=autopy.bitmap.Bitmap.open(‘rubbish.png‘) screen=autopy.bitmap.capture_screen() pos=screen.find_bitmap(rubbish) if pos: print (‘找到了,他的位置在:%s‘ % str(pos)) else: print (‘没有找到‘) where_is_the_rubbish() 目前成功的代码,右键不知道怎点击,找了圈没找到。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- windows-server-2008 – Windows Update无法在Windows Serv
- 无法加载Microsoft.WindowsAzure.ServiceRuntime,Version =
- 如何在Windows 8.1上安装PyBluez?
- windows – Batch Scripting Adventure
- 有了专家系统管理员,Windows和Linux等于安全性
- windows-server-2008-r2 – Windows server 2008 R2备份 –
- winapi – 在窗口模式下在Windows 10上等待VBLANK的正确方法
- Windows中的cat .git / HEAD命令?
- windows – 在IIS下运行SVN存储库
- 由于私钥过滤,signtool无法在Windows 10上找到证书