求大神帮我写个按键精灵脚本,我要连续按键1234567890,每隔3秒按一下,语句循环,要能后台运行,谢谢!

2025-04-18 23:52:40
推荐回答(2个)
回答1:


 

 Hwnd = Plugin.Window.MousePoint()
Rem 开始
Call Plugin.Bkgnd.KeyPress(Hwnd, 49)
    Delay 3000
    Call Plugin.Bkgnd.KeyPress(Hwnd, 50)
    Delay 3000
    Call Plugin.Bkgnd.KeyPress(Hwnd, 51)
     Delay 3000
    Call Plugin.Bkgnd.KeyPress(Hwnd, 52)
    Delay 3000
    Call Plugin.Bkgnd.KeyPress(Hwnd, 53)    
    Delay 3000
    Call Plugin.Bkgnd.KeyPress(Hwnd, 54)
    Delay 3000
    Call Plugin.Bkgnd.KeyPress(Hwnd, 55)
    Delay 3000
    Call Plugin.Bkgnd.KeyPress(Hwnd, 56)  
    Delay 3000
    Call Plugin.Bkgnd.KeyPress(Hwnd, 57)  
     Delay 3000
     Call Plugin.Bkgnd.KeyPress(Hwnd, 48)
       Delay 3000
     Goto 开始

回答2:

是每按一个键就停3秒还是每按完一次停3秒?

如果是后者的话,只保留最后一个Delay 3000,删掉其他Delay 3000即可

i=0   
Do While i=0    
    KeyPress "1", 1
    Delay 3000
    KeyPress "2", 1
    Delay 3000
    KeyPress "3", 1
    Delay 3000
    KeyPress "4", 1
    Delay 3000
    KeyPress "5", 1
    KeyPress "6", 1
    Delay 3000
    KeyPress "7", 1
    Delay 3000
    KeyPress "8", 1
    Delay 3000
    KeyPress "9", 1
    Delay 3000
    KeyPress "0", 1
    Delay 3000
Loop