Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- #Persistent ; Keep this script running until the user explicitly exits it.
- #SingleInstance force
- SetKeyDelay -1
- turboDelay = 50
- ; JOYSTICK 1
- ; joystick 1 - axis x, y
- ; setas_teclado
- ; Se true será usado as setas do teclado
- ; Se false você terá que personalizar do seu jeito, o padrão é wasd
- setas_teclado = true
- joy1up = w
- joy1left = a
- joy1down = s
- joy1right = d
- ; joystick 1 - buttons
- joy1b1 = Numpad1
- joy1b2 = k
- joy1b3 = space
- joy1b4 = j
- joy1b5 = o
- joy1b6 = b
- joy1b7 = u
- joy1b8 = space
- joy1b9 = i
- joy1b10 = esc
- joy1b11 = n
- joy1b12 = enter
- ; joystick 1 - turbo button (true = yes, false = no)
- joy1b1turbo = false
- joy1b2turbo = false
- joy1b3turbo = false
- joy1b4turbo = false
- joy1b5turbo = false
- joy1b6turbo = false
- joy1b7turbo = false
- joy1b8turbo = false
- joy1b9turbo = false
- joy1b10turbo = false
- joy1b11turbo = false
- joy1b12turbo = false
- ; joystick 1 - POV (Point Of View), D-PAD or PAD
- joy1PovUp := joy1up
- joy1PovLeft := joy1left
- joy1PovDown := joy1down
- joy1PovRight := joy1right
- joy1PovIdle = -1 ; Only change if you are sure what you are doing.
- joy1PovUpNumber = 0 ; Only change if you are sure what you are doing.
- joy1PovLeftNumber = 27000 ; Only change if you are sure what you are doing.
- joy1PovDownNumber = 18000 ; Only change if you are sure what you are doing.
- joy1PovRightNumber = 9000 ; Only change if you are sure what you are doing.
- j1direction := 1
- ; Calling a steam game
- ;caminho = %A_ProgramFiles%\Steam\Steam.exe
- ;IfNotExist % caminho
- ;{
- ; caminho = %A_ProgramFiles% (x86)\Steam\Steam.exe
- ;}
- ;
- ;IfExist % caminho
- ;{
- ; Run %caminho% -applaunch 422810
- ;}
- SetTimer, WatchAxis, 5
- ; Quits script automatically when the game is finished
- ;Process, Wait, RCRU.exe
- ;Process, Exist, RCRU.exe
- ;PID = %ErrorLevel%
- ;Process, WaitClose, %PID%
- ;ExitApp
- WatchAxis:
- GetKeyState, JoyX, JoyX ; Get position of X axis.
- GetKeyState, JoyY, JoyY ; Get position of Y axis.
- GetKeyState, POV, JoyPOV ; Get position of the POV control.
- j1directionPrevious := j1direction
- if (POV <> joy1PovIdle) {
- ;diagonal - up + left
- if (POV > joy1PovLeftNumber) ; 31500
- {
- j1key1 := joy1PovUp
- j1key2 := joy1PovLeft
- j1direction := 1
- }
- ;left
- else if (POV = joy1PovLeftNumber) ; 27000
- {
- j1key1 := joy1PovLeft
- j1direction := 6
- }
- ;diagonal - down + left
- else if (POV > joy1PovDownNumber) ; 22500
- {
- j1key1 := joy1PovDown
- j1key2 := joy1PovLeft
- j1direction := 3
- }
- ;down
- else if (POV = joy1PovDownNumber) ; 18000
- {
- j1key1 := joy1PovDown
- j1direction := 7
- }
- ;diagonal - down + right
- else if (POV > joy1PovRightNumber) ; 13500
- {
- j1key1 := joy1PovDown
- j1key2 := joy1PovRight
- j1direction := 4
- }
- ;right
- else if (POV = joy1PovRightNumber) ; 9000
- {
- j1key1 := joy1PovRight
- j1direction := 5
- }
- ;diagonal - up + right
- else if (POV > joy1PovUpNumber) ; 4500
- {
- j1key1 := joy1PovUp
- j1key2 := joy1PovRight
- j1direction := 2
- }
- ;up
- else if (POV = joy1PovUpNumber) ; 0
- {
- j1key1 := joy1PovUp
- j1direction := 8
- }
- else
- {
- j1key1 =
- j1key2 =
- j1direction := 0
- }
- }
- else
- {
- ;diagonal - up + left
- if (JoyY < 30) and (JoyX < 30)
- {
- j1key1 := joy1up
- j1key2 := joy1left
- j1direction := 1
- }
- ;diagonal - up + right
- else if (JoyY < 30) and (JoyX > 70)
- {
- j1key1 := joy1up
- j1key2 := joy1right
- j1direction := 2
- }
- ;diagonal - down + left
- else if (JoyY > 70) and (JoyX < 30)
- {
- j1key1 := joy1down
- j1key2 := joy1left
- j1direction := 3
- }
- ;diagonal - down + right
- else if (JoyY > 70) and (JoyX > 70)
- {
- j1key1 := joy1down
- j1key2 := joy1right
- j1direction := 4
- }
- ;right
- else if JoyX > 70
- {
- j1key1 := joy1right
- j1direction := 5
- }
- ;left
- else if JoyX < 30
- {
- j1key1 := joy1left
- j1direction := 6
- }
- ;down
- else if JoyY > 70
- {
- j1key1 := joy1down
- j1direction := 7
- }
- ;up
- else if JoyY < 30
- {
- j1key1 := joy1up
- j1direction := 8
- }
- else
- {
- j1key1 =
- j1key2 =
- j1direction := 0
- }
- }
- if j1direction <> %j1directionPrevious%
- {
- if(%setas_teclado%){
- Send, {up up}
- Send, {left up}
- Send, {down up}
- Send, {right up}
- if(j1direction = 5){
- Send, {right down}
- }else if(j1direction = 6){
- Send, {left down}
- }else if(j1direction = 8){
- Send, {up down}
- }else if(j1direction = 7){
- Send, {down down}
- }else if(j1direction = 2){
- Send, {up down}
- Send, {right down}
- }else if(j1direction = 1){
- Send, {up down}
- Send, {left down}
- }else if(j1direction = 4){
- Send, {right down}
- Send, {down down}
- }else if(j1direction = 3){
- Send, {left down}
- Send, {down down}
- }
- } else {
- Send, {%joy1up% up}
- Send, {%joy1left% up}
- Send, {%joy1down% up}
- Send, {%joy1right% up}
- ;se for uma diagonal
- if (j1direction >= 1) and (j1direction <= 4) {
- Send, {%j1key1% down}
- Send, {%j1key2% down}
- } else {
- Send, {%j1key1% down}
- }
- }
- }
- return ; WatchAxis end
- ; BUTTON 1
- Joy1::
- if (%joy1b1turbo%) {
- loop { ; loop the script untill broken
- GetKeyState, stateJoy1, Joy1, P ; Get the state of button (U = Up and D = Down)
- if stateJoy1 = U
- break ; its been released so break the loop
- sleep, turboDelay
- send {%joy1b1% down}
- sleep, turboDelay ; This is the time between presses, after its slept it will return to the top of the loop and start again
- send {%joy1b1% up}
- } ;loop end
- } else {
- send {%joy1b1% down}
- KeyWait Joy1
- send {%joy1b1% up}
- } ; if end
- return
- ; BUTTON 2
- ; joystick 1
- Joy2::
- if (%joy1b2turbo%) {
- loop { ; loop the script untill broken
- GetKeyState, stateJoy2, Joy2, P ; Get the state of button (U = Up and D = Down)
- if stateJoy2 = U
- break ; its been released so break the loop
- sleep, turboDelay
- send {%joy1b2% down}
- sleep, turboDelay ; This is the time between presses, after its slept it will return to the top of the loop and start again
- send {%joy1b2% up}
- } ;loop end
- } else {
- send {%joy1b2% down}
- KeyWait Joy2
- send {%joy1b2% up}
- } ; if end
- return
- ; BUTTON 3
- ; joystick 1
- Joy3::
- if (%joy1b3turbo%) {
- loop { ; loop the script untill broken
- GetKeyState, stateJoy3, Joy3, P ; Get the state of button (U = Up and D = Down)
- if stateJoy3 = U
- break ; its been released so break the loop
- sleep, turboDelay
- send {%joy1b3% down}
- sleep, turboDelay ; This is the time between presses, after its slept it will return to the top of the loop and start again
- send {%joy1b3% up}
- } ;loop end
- } else {
- send {%joy1b3% down}
- KeyWait Joy3
- send {%joy1b3% up}
- } ; if end
- return
- ; BUTTON 4
- Joy4::
- if (%joy1b4turbo%) {
- loop { ; loop the script untill broken
- GetKeyState, stateJoy4, Joy4, P ; Get the state of button (U = Up and D = Down)
- if stateJoy4 = U
- break ; its been released so break the loop
- sleep, turboDelay
- send {%joy1b4% down}
- sleep, turboDelay ; This is the time between presses, after its slept it will return to the top of the loop and start again
- send {%joy1b4% up}
- } ;loop end
- } else {
- send {%joy1b4% down}
- KeyWait Joy4
- send {%joy1b4% up}
- } ; if end
- return
- ; BUTTON 5
- ; joystick 1
- Joy5::
- if (%joy1b5turbo%) {
- loop { ; loop the script untill broken
- GetKeyState, stateJoy5, Joy5, P ; Get the state of button (U = Up and D = Down)
- if stateJoy5 = U
- break ; its been released so break the loop
- sleep, turboDelay
- send {%joy1b5% down}
- sleep, turboDelay ; This is the time between presses, after its slept it will return to the top of the loop and start again
- send {%joy1b5% up}
- } ;loop end
- } else {
- send {%joy1b5% down}
- KeyWait Joy5
- send {%joy1b5% up}
- } ; if end
- return
- ; BUTTON 6
- ; joystick 1
- Joy6::
- if (%joy1b6turbo%) {
- loop { ; loop the script untill broken
- GetKeyState, stateJoy6, Joy6, P ; Get the state of button (U = Up and D = Down)
- if stateJoy6 = U
- break ; its been released so break the loop
- sleep, turboDelay
- send {%joy1b6% down}
- sleep, turboDelay ; This is the time between presses, after its slept it will return to the top of the loop and start again
- send {%joy1b6% up}
- } ;loop end
- } else {
- send {%joy1b6% down}
- KeyWait Joy6
- send {%joy1b6% up}
- } ; if end
- return
- ; BUTTON 7
- ; joystick 1
- Joy7::
- if (%joy1b7turbo%) {
- loop { ; loop the script untill broken
- GetKeyState, stateJoy7, Joy7, P ; Get the state of button (U = Up and D = Down)
- if stateJoy7 = U
- break ; its been released so break the loop
- sleep, turboDelay
- send {%joy1b7% down}
- sleep, turboDelay ; This is the time between presses, after its slept it will return to the top of the loop and start again
- send {%joy1b7% up}
- } ;loop end
- } else {
- send {%joy1b7% down}
- KeyWait Joy7
- send {%joy1b7% up}
- } ; if end
- return
- ; BUTTON 8
- ; joystick 1
- Joy8::
- if (%joy1b8turbo%) {
- loop { ; loop the script untill broken
- GetKeyState, stateJoy8, Joy8, P ; Get the state of button (U = Up and D = Down)
- if stateJoy8 = U
- break ; its been released so break the loop
- sleep, turboDelay
- send {%joy1b8% down}
- sleep, turboDelay ; This is the time between presses, after its slept it will return to the top of the loop and start again
- send {%joy1b8% up}
- } ;loop end
- } else {
- send {%joy1b8% down}
- KeyWait Joy8
- send {%joy1b8% up}
- } ; if end
- return
- ; BUTTON 9
- ; joystick 1
- Joy9::
- if (%joy1b9turbo%) {
- loop { ; loop the script untill broken
- GetKeyState, stateJoy9, Joy9, P ; Get the state of button (U = Up and D = Down)
- if stateJoy9 = U
- break ; its been released so break the loop
- sleep, turboDelay
- send {%joy1b9% down}
- sleep, turboDelay ; This is the time between presses, after its slept it will return to the top of the loop and start again
- send {%joy1b9% up}
- } ;loop end
- } else {
- send {%joy1b9% down}
- KeyWait Joy9
- send {%joy1b9% up}
- } ; if end
- return
- ; BUTTON 10
- ; joystick 1
- Joy10::
- if (%joy1b10turbo%) {
- loop { ; loop the script untill broken
- GetKeyState, stateJoy10, Joy10, P ; Get the state of button (U = Up and D = Down)
- if stateJoy10 = U
- break ; its been released so break the loop
- sleep, turboDelay
- send {%joy1b10% down}
- sleep, turboDelay ; This is the time between presses, after its slept it will return to the top of the loop and start again
- send {%joy1b10% up}
- } ;loop end
- } else {
- send {%joy1b10% down}
- KeyWait Joy10
- send {%joy1b10% up}
- } ; if end
- return
- ; BUTTON 11
- ; joystick 1
- Joy11::
- if (%joy1b11turbo%) {
- loop { ; loop the script untill broken
- GetKeyState, stateJoy11, Joy11, P ; Get the state of button (U = Up and D = Down)
- if stateJoy11 = U
- break ; its been released so break the loop
- sleep, turboDelay
- send {%joy1b11% down}
- sleep, turboDelay ; This is the time between presses, after its slept it will return to the top of the loop and start again
- send {%joy1b11% up}
- } ;loop end
- } else {
- send {%joy1b11% down}
- KeyWait Joy11
- send {%joy1b11% up}
- } ; if end
- return
- ; BUTTON 12
- ; joystick 1
- Joy12::
- if (%joy1b12turbo%) {
- loop { ; loop the script untill broken
- GetKeyState, stateJoy12, Joy12, P ; Get the state of button (U = Up and D = Down)
- if stateJoy12 = U
- break ; its been released so break the loop
- sleep, turboDelay
- send {%joy1b12% down}
- sleep, turboDelay ; This is the time between presses, after its slept it will return to the top of the loop and start again
- send {%joy1b12% up}
- } ;loop end
- } else {
- send {%joy1b12% down}
- KeyWait Joy12
- send {%joy1b12% up}
- } ; if end
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement