
2个回答
展开全部
//直接将下面的代码复制进去即可,我采用的是按键精灵8.0,测试过了可直接使用,开始前先用鼠标点击要运行的窗口,然后按F10运行就可以后台运行了,下面是代码部分。
dim hwnd
hwnd=Plugin.window.mousepoint()
s=Plugin.window.getclientrect(hwnd)
XYarray=split(s,"|",-1,1)
dx=XYarray(0)
dy=XYarray(1)
rem start
Call Plugin.Bkgnd.KeyPress(Hwnd, 112)
Delay 3000
Call Plugin.Bkgnd.KeyPress(Hwnd, 113)
Delay 3000
Call Plugin.Bkgnd.KeyPress(Hwnd, 114)
Delay 10000
goto start
dim hwnd
hwnd=Plugin.window.mousepoint()
s=Plugin.window.getclientrect(hwnd)
XYarray=split(s,"|",-1,1)
dx=XYarray(0)
dy=XYarray(1)
rem start
Call Plugin.Bkgnd.KeyPress(Hwnd, 112)
Delay 3000
Call Plugin.Bkgnd.KeyPress(Hwnd, 113)
Delay 3000
Call Plugin.Bkgnd.KeyPress(Hwnd, 114)
Delay 10000
goto start
追问
谢谢 上面的貌似看不懂
展开全部
经计算,你的这个按键每42秒一个周期: 需要400多句来表示一个周期.
脚本如下:
hwnd = Plugin.Window.MousePoint()
While true
Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 113) :Call Plugin.Bkgnd.KeyPress(hwnd, 114) :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 113) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 113) :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 114) :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 113) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 113) :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 113) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 113) :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 114) :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 113) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 113) :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 113) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 114) :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 113) :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 113) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115)
Delay 1000
Wend
需要说明:从时间间隔周期看有的时间点会同时按下几个键,脚本没有对同时按下的情况进行区别,而是默认依次按下各个键.由于按键操作本身有时间消耗(因机器不同而异),因此,脚本执行的时间并不十分精确.如果需要长期准确执行,请对间隔时间进行校正.
脚本如下:
hwnd = Plugin.Window.MousePoint()
While true
Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 113) :Call Plugin.Bkgnd.KeyPress(hwnd, 114) :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 113) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 113) :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 114) :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 113) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 113) :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 113) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 113) :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 114) :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 113) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 113) :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 113) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 114) :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 113) :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 113) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 112)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115) :Call Plugin.Bkgnd.KeyPress(hwnd, 114)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 500 :Call Plugin.Bkgnd.KeyPress(hwnd, 115)
Delay 1000
Wend
需要说明:从时间间隔周期看有的时间点会同时按下几个键,脚本没有对同时按下的情况进行区别,而是默认依次按下各个键.由于按键操作本身有时间消耗(因机器不同而异),因此,脚本执行的时间并不十分精确.如果需要长期准确执行,请对间隔时间进行校正.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询