求做一个按键精灵脚本 每1S按下F4 每1.5S按下F2 每2S按下F3 每2.5S按下F1 并且可后台操作

 我来答
dlbabo
2011-05-01 · TA获得超过5676个赞
知道大有可为答主
回答量:2016
采纳率:57%
帮助的人:1540万
展开全部
  经计算,你的这个按键每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

  需要说明:从时间间隔周期看有的时间点会同时按下几个键,脚本没有对同时按下的情况进行区别,而是默认依次按下各个键.由于按键操作本身有时间消耗(因机器不同而异),因此,脚本执行的时间并不十分精确.如果需要长期准确执行,请对间隔时间进行校正.
随走无涯
2011-05-02 · 超过16用户采纳过TA的回答
知道答主
回答量:43
采纳率:0%
帮助的人:39.1万
展开全部
不太精通按键精灵的可以使用简单百宝箱,还不至于被GM查出开辅助软件。
而且简单百宝箱也支持后台运行,很方便的。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
xugaoming23
2011-05-03 · TA获得超过151个赞
知道小有建树答主
回答量:157
采纳率:0%
帮助的人:84万
展开全部
后台是针对具体窗口才能写的
普通的窗口后台很简单,像楼上一样Bkgnd.KeyPress能达到目的
游戏窗口,如果是dgi的也可以,但现在许多游戏都是DX的,他们都是拒绝Bkgnd.KeyPress这样的后台的,还有可能普通窗口也拒绝这样的后台,按键的后台命令就是个鸡肋
许多都得用第三方插件
所以你得首先考虑你的应用程序是否支持后台命令,以及支持什么样的后台命令

然后你才可以来问怎么写这个脚本
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(1)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

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

类别

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

说明

0/200

提交
取消

辅 助

模 式