all works fine but for some reason
Code: Select all
; X Axis Forward
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(100))
Sleep 10
; X Axis centre
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(50))
Sleep 20
; X Axis Forward
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(100))
here is my script
Code: Select all
class TheFatalsCustomPlugin extends _Plugin {
Type := "TheFatal's Custom Plugin"
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("OB1", 0, "xm yp+25 w200")
this.AddOutputButton("OB2", 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
; Y Axis Down
this.OutputAxes.OutputAxis2.SetState(StickOps.AHKToVjoy(100))
Sleep 50
; Y Axis Centre
this.OutputAxes.OutputAxis2.SetState(StickOps.AHKToVjoy(50))
Sleep 50
; X Axis Back
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(0))
; Hold button 1
this.OutputButtons.OB1.SetState(1)
Sleep 50
; X Axis Centre
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(50))
Sleep 100
; X Axis Forward
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(100))
Sleep 100
; X Axis centre
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(50))
Sleep 100
; X Axis Forward
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(100))
; Hold Button 2
this.OutputButtons.OB2.SetState(1)
; Release Button 1
this.OutputButtons.OB1.SetState(0)
; X Axis centre
this.OutputAxes.OutputAxis1.SetState(StickOps.AHKToVjoy(50))
} else {
; Input Button was released
; Release Button 2
this.OutputButtons.OB2.SetState(0)
}
}
}