求高手帮我做一个按键脚本 需求如下; 每隔10秒按一下F1 F2 F3 ,F1 F2 F3中间的间隔为3秒,求高手帮下忙

需要后台做好试过了加分... 需要后台 做好试过了 加分 展开
 我来答
sheng1326
2011-08-08 · 超过26用户采纳过TA的回答
知道答主
回答量:49
采纳率:0%
帮助的人:52.6万
展开全部
//直接将下面的代码复制进去即可,我采用的是按键精灵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
追问
谢谢   上面的貌似看不懂
手机用户47265
2011-08-07 · TA获得超过550个赞
知道小有建树答主
回答量:981
采纳率:0%
帮助的人:492万
展开全部
经计算,你的这个按键每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

需要说明:从时间间隔周期看有的时间点会同时按下几个键,脚本没有对同时按下的情况进行区别,而是默认依次按下各个键.由于按键操作本身有时间消耗(因机器不同而异),因此,脚本执行的时间并不十分精确.如果需要长期准确执行,请对间隔时间进行校正.
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式