Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;============================== Supporting functions and sections ==============================
- ;Blocks direction (WASD) keys
- BlockDirectionInputs(state)
- {
- static keys
- keys=w,a,s,d
- Loop,Parse,keys, `,
- Hotkey, *%A_LoopField%, KeyboardDummyLabel, %state%
- Return
- KeyboardDummyLabel: ; hotkeys need a label, so give them one that do nothing
- Return
- }
- ;disables accidental kicks
- Attack:
- Send {w up}{a up}{s up}{d up} ;stops your movement
- BlockDirectionInputs("on") ;disables WASD keys
- Send {Z down}
- sleep 31
- Send {Z up}
- Sleep 50 ;at this time you should be at the very start of your attack animation, meaning you cant kick anymore.
- BlockDirectionInputs("off") ;reenables WASD so you can do the pivoting attack (attack in other direction and finish it in your)
- SynchronizeDirection()
- return
- ;This is the routine that synchronizes your pressed WASD keys with their "electronic" counter parts
- SynchronizeDirection()
- {
- dir=false
- if (GetKeyState("W", "P")){
- Send {W down}
- dir=true
- }
- if (GetKeyState("A", "P")){
- Send {A down}
- dir=true
- }
- if (GetKeyState("D", "P")){
- Send {D down}
- dir=true
- }
- if (GetKeyState("S", "P")){
- Send {S down}
- dir=true
- }
- return dir
- }
- ;============================== Main Script ==============================
- LButton::
- Gosub Attack ;Activates the attack function
- return
- LButton up:: ;makes sure there is no action at the end of the click
- return
Advertisement
Add Comment
Please, Sign In to add comment