Python自动操作脚本

来自我的个人网站: http://wangbch.com
目前有两个模块:一个类似按键精灵的脚本,一个用aircv实现的图片位置定位脚本,利用这两个脚本可以在Windows上实现大部分的自动操作,比如点击图标等。

PYTHON.TOOLS.

AutoKeyboardMouseCtrl.py

利用python程序化鼠标键盘控制操作
- mouse_moveTo(x, y)
move mouse to the location(x,y) in the screen. Input is two int, not turple
- mouse_getPosition(sleep_time)
reutrn the position(two int) after sleep_time(unit: s)
- mouse_click(x, y, click_type, times)
left(click_type == “L”, default) or right (click_type == “R”) click at the (x,y) position for times(default 1)
- mouse_hold(x, y, click_type)
keep mouse down
- mouse_release()
release
- key_stringInput(str)
control the keyboard to input some string
- key_keyInput(c)
key c, c is e.g. “ctrl”, “leftshift”, “a”, “b” and so on, more details on VK_CODE in the file.
- key_holdKey(c)
keep key c down
- key_releaseKey(c)
key release

PicLocate.py

you need aircv: https://github.com/NetEaseGame/aircv
输入一张图片,返回这张图片在屏幕中的位置(如果找不到,会返回最相近图片的位置)
- locate_pic(filename, position)
filename: the filename of the picture you need to locate in the screen.
position: default is “center”, options are “left”, “leftup”, “leftdown”, “right”, “rightup”, “rightdown”, “up” and “down”. Returns the location as following fig.1 shows:

  • 3
    点赞
  • 30
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值