my problem is repeating the script
i have a script with button sequence: LEFT, LEFT, DOWN, LEFT so if i press binded key it works correctly but if i hold binded key there are a small pause between 1rst and 2nd sequences it looks like:
LEFT, LEFT, DOWN, LEFT, !!!PAUSE!!!, LEFT, LEFT, DOWN, LEFT, LEFT, LEFT, DOWN, LEFT, etc
can u pls help me with deleating that pause
here is my script
Code: Select all
class test1 extends _Plugin {
Type := "test1"
Description := "Your description here"
; The Init() method of a plugin is called when one is added. Use it to create your Gui etc
Init(){
; Create the GUI
; Add a hotkey, and give it the name "MyHk1". All hotkey objects can be accessed via this.InputButtons[name]
; Have it call MyHkChangedState when it changes state.
this.AddInputButton("IB1", 0, this.MyHkChangedState.Bind(this), "xm ym w200")
; Add an Output, and give it the name "MyOp1". All output objects can be accessed via this.OutputButtons[name]
this.AddOutputButton("OB6", 0, "xm yp+25 w200")
this.AddOutputAxis("OutputAxis1", 0, "xm yp+25 w125")
this.AddOutputAxis("OutputAxis2", 0, "xm yp+25 w125")
}
; Called when the hotkey changes state (key is pressed or released)
MyHkChangedState(e){
if (e){ ; Only do this on press of the Input Button (e=1), do nothing on release (e=0)
static StickOps := UCR.Libraries.StickOps
; The input button was pressed, send the sequence of actions
; X Axis Back
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(0))
Sleep 25
; X Axis Centre
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(50))
Sleep 25
; X Axis Back
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(0))
Sleep 25
; X Axis Centre
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(50))
Sleep 100
; Y Axis Down
this.OutputAxes.OutputAxis2.SetState(StickOps.AHKToVjoy(100))
Sleep 25
; X Axis Back
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(0))
Sleep 25
; X Axis Centre
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(50))
; Y Axis Centre
this.OutputAxes.OutputAxis2.SetState(StickOps.AHKToVjoy(50))
} else {
; X Axis Centre
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(50))
; Y Axis Centre
this.OutputAxes.OutputAxis2.SetState(StickOps.AHKToVjoy(50))
}
}
}