SiriusLeto

Autohotkey - Joystick 1 e 2

Jul 30th, 2020 (edited)
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; Versão 2.2 - bug no joystick 2 corrigido
  2. ; Versão 2.1 - bug ao ir para direita corrigido
  3. ; site: https://wgomessantos.blogspot.com/2020/04/autohotkey-joystick-1-e-2.html
  4.  
  5. #NoEnv       ; Recommended for performance and compatibility with future AutoHotkey releases.
  6. #Persistent  ; Keep this script running until the user explicitly exits it.
  7. #SingleInstance force
  8.  
  9. ; Which joystick is the configuration for? Common values 1 or 2
  10. ; A configuração é para qual joystick? Valores comuns 1 ou 2
  11. joystick := 1
  12.  
  13. ; If true the keyboard arrows will be used
  14. ; Se true será usado as setas do teclado
  15.  
  16. ; If false you will have to customize it your way, the default is wasd
  17. ; Se false você terá que personalizar do seu jeito, o padrão é wasd
  18. setas_teclado = true
  19.  
  20. if(%setas_teclado%)
  21. {
  22.     joy1up = up
  23.     joy1left = left
  24.     joy1down = down
  25.     joy1right = right
  26. }
  27. else
  28. {
  29.     joy1up = w
  30.     joy1left = a
  31.     joy1down = s
  32.     joy1right = d
  33. }
  34.  
  35. ; Opcional: Se desejar atribua as teclas para ações
  36. ; Optional: If desired, assign keys to actions
  37. jump =  y   ;pulo
  38. attack = u  ;ataque
  39. kick =      ;chute
  40. punch =     ;soco
  41. special = i ;especial
  42. power =     ;poder
  43. select = o
  44. start = p
  45.  
  46. ; Map the joystick buttons here
  47. ; Mapeie os botões do joystick aqui
  48.  
  49. ; Optional: Map an action instead of a key, see the example below
  50. ; Important: The action must be previously mapped
  51. ; Example
  52. ; punch = z
  53. ; joy1b1 = %punch%
  54.  
  55. ; Opcional: Mapear uma ação ao invés de uma tecla, ver o exemplo abaixo
  56. ; Importante: A ação deve estar previamente mapeada
  57. ; Exemplo
  58. ; punch = z
  59. ; joy1b1 = %punch%
  60.  
  61. joy1b1 = 1
  62. joy1b2 = 2
  63. joy1b3 = 3
  64. joy1b4 = 4
  65. joy1b5 = 5
  66. joy1b6 = 6
  67. joy1b7 = 7
  68. joy1b8 = 8
  69. joy1b9 = 9
  70. joy1b10 = 0
  71. joy1b11 = a
  72. joy1b12 = b
  73.  
  74. ; turbo button (true = yes, false = no)
  75. ; botao turbo (true = sim, false = nao)
  76. joy1b1turbo = false
  77. joy1b2turbo = false
  78. joy1b3turbo = false
  79. joy1b4turbo = false
  80. joy1b5turbo = false
  81. joy1b6turbo = false
  82. joy1b7turbo = false
  83. joy1b8turbo = false
  84. joy1b9turbo = false
  85. joy1b10turbo = false
  86. joy1b11turbo = false
  87. joy1b12turbo = false
  88.  
  89. ; SOMENTE ALTERE SE VOCE SOUBER O QUE ESTA FAZENDO!
  90. ; Only change if you are sure what you are doing.
  91. joy1PovIdle = -1
  92. joy1PovUpNumber = 0
  93. joy1PovLeftNumber = 27000
  94. joy1PovDownNumber = 18000
  95. joy1PovRightNumber = 9000
  96.  
  97. ;POV (Point Of View), D-PAD or PAD
  98. joy1PovUpKey := joy1up
  99. joy1PovLeftKey := joy1left
  100. joy1PovDownKey := joy1down
  101. joy1PovRightKey := joy1right
  102.  
  103. SetKeyDelay -1
  104. turboDelay = 50
  105. j1direction := 0
  106. ladoAnterior = %joy1right%
  107. verticalAnterior = %joy1up%
  108.  
  109. ; To adjust the axes in an integer, as the return can be decimal with 49.6086 instead of 50
  110. ; Para ajuste dos eixos em um inteiro, pois o retorno pode ser decimal com 49.6086 invés de 50
  111. axisIdle := 50
  112. tolerance := 1
  113. axisMinor := axisIdle - tolerance
  114. axisMajor := axisIdle + tolerance
  115.  
  116. ; Calling a steam game
  117. ;caminho = %A_ProgramFiles%\Steam\Steam.exe
  118. ;IfNotExist % caminho
  119. ;{
  120. ;    caminho = %A_ProgramFiles% (x86)\Steam\Steam.exe
  121. ;}
  122. ;
  123. ;IfExist % caminho
  124. ;{
  125. ;    Run %caminho% -applaunch 422810
  126. ;}
  127.  
  128. Hotkey, %joystick%Joy1, button1
  129. Hotkey, %joystick%Joy2, button2
  130. Hotkey, %joystick%Joy3, button3
  131. Hotkey, %joystick%Joy4, button4
  132. Hotkey, %joystick%Joy5, button5
  133. Hotkey, %joystick%Joy6, button6
  134. Hotkey, %joystick%Joy7, button7
  135. Hotkey, %joystick%Joy8, button8
  136. Hotkey, %joystick%Joy9, button9
  137. Hotkey, %joystick%Joy10, button10
  138. Hotkey, %joystick%Joy11, button11
  139. Hotkey, %joystick%Joy12, button12
  140.  
  141. SetTimer, WatchAxis, 5
  142.  
  143. ; Quits script automatically when the game is finished
  144. ;Process, Wait, RCRU.exe
  145. ;Process, Exist, RCRU.exe
  146. ;PID = %ErrorLevel%
  147. ;Process, WaitClose, %PID%
  148. ;ExitApp
  149.  
  150. stopDirection = false
  151.  
  152. WatchAxis:
  153.    if (%stopDirection%) {
  154.         return
  155.     }
  156.    
  157.     GetKeyState, joy1X, %joystick%JoyX ;posição do eixo X
  158.     GetKeyState, joy1Y, %joystick%JoyY ;posição do eixo X    
  159.     GetKeyState, pov1, %joystick%JoyPOV ;posição Point Of View
  160.    
  161.     ;Debug
  162.     ;ToolTip,  joy1X: %joy1X% `n joy1Y: %joy1Y% `n j1direction: %j1direction% `n axisIdle: %axisIdle% `n pov1: %pov1%
  163.    
  164.     ; Para ajuste dos eixos em um inteiro, pois o retorno pode ser decimal com 49.6086 invés de 50
  165.     if((joy1X > axisMinor) and (joy1X < axisMajor)){
  166.         joy1X := axisIdle
  167.     }    
  168.     if(joy1Y > axisMinor) and (joy1Y < axisMajor){
  169.         joy1Y := axisIdle
  170.     }
  171.    
  172.     if (pov1 <> joy1PovIdle)
  173.     {    
  174.         ;diagonal - up + left
  175.         if (pov1 > joy1PovLeftNumber) ; 31500
  176.         {
  177.             j1direction := 1
  178.             verticalAnterior = %joy1up%
  179.             ladoAnterior = %joy1left%
  180.         }      
  181.         else if (pov1 = joy1PovLeftNumber) ; 27000
  182.         {
  183.         ;left
  184.             j1direction := 6
  185.             ladoAnterior = %joy1left%
  186.         }
  187.         else if (pov1 > joy1PovDownNumber) ; 22500
  188.         {
  189.         ;diagonal - down + left
  190.             j1direction := 3
  191.             verticalAnterior = %joy1down%
  192.             ladoAnterior = %joy1left%
  193.         }
  194.         else if (pov1 = joy1PovDownNumber) ; 18000
  195.         {
  196.         ;down
  197.             j1direction := 7
  198.             verticalAnterior = %joy1down%
  199.         }
  200.         else if (pov1 > joy1PovRightNumber) ; 13500
  201.         {
  202.         ;diagonal - down + right
  203.             j1direction := 4
  204.             verticalAnterior = %joy1down%
  205.             ladoAnterior = %joy1right%
  206.         }
  207.         else if (pov1 = joy1PovRightNumber) ; 9000
  208.         {
  209.         ;right
  210.             j1direction := 5
  211.             ladoAnterior = %joy1right%
  212.         }  
  213.         else if (pov1 > joy1PovUpNumber) ; 4500
  214.         {
  215.         ;diagonal - up + right
  216.             j1direction := 2
  217.             verticalAnterior = %joy1up%
  218.             ladoAnterior = %joy1right%
  219.         }
  220.         else if (pov1 = joy1PovUpNumber) ; 0
  221.         {
  222.         ;up
  223.             j1direction := 8
  224.             verticalAnterior = %joy1up%
  225.         }
  226.         else
  227.         {
  228.             j1direction := 0
  229.         }    
  230.     }
  231.     else
  232.     {
  233.         if ((joy1X = axisIdle) and (joy1Y = axisIdle))
  234.         {
  235.             j1direction := 0
  236.         }    
  237.         else if ((joy1X < axisIdle) and (joy1Y < axisIdle))
  238.         {
  239.         ;diagonal - up + left
  240.             j1direction := 1
  241.             verticalAnterior = %joy1up%
  242.             ladoAnterior = %joy1left%
  243.         }
  244.         else if ((joy1X > axisIdle) and (joy1Y < axisIdle))
  245.         {
  246.         ;diagonal - up + right
  247.             j1direction := 2
  248.             verticalAnterior = %joy1up%
  249.             ladoAnterior = %joy1right%
  250.         }
  251.         else if ((joy1X < axisIdle) and (joy1Y > axisIdle))
  252.         {
  253.         ;diagonal - down + left
  254.             j1direction := 3
  255.             verticalAnterior = %joy1down%
  256.             ladoAnterior = %joy1left%
  257.         }
  258.         else if ((joy1X > axisIdle) and (joy1Y > axisIdle))
  259.         {
  260.         ;diagonal - down + right
  261.             j1direction := 4
  262.             verticalAnterior = %joy1down%
  263.             ladoAnterior = %joy1right%
  264.         }
  265.         else if (joy1X > axisIdle)
  266.         {
  267.         ;right
  268.             j1direction := 5
  269.             ladoAnterior = %joy1right%
  270.         }  
  271.         else if (joy1X < axisIdle)
  272.         {
  273.         ;left
  274.             j1direction := 6
  275.             ladoAnterior = %joy1left%
  276.         }
  277.         else if (joy1Y > axisIdle)
  278.         {
  279.         ;down
  280.             j1direction := 7
  281.             verticalAnterior = %joy1down%
  282.         }
  283.         else if (joy1Y < axisIdle)
  284.         {
  285.         ;up
  286.             j1direction := 8
  287.             verticalAnterior = %joy1up%
  288.         }
  289.         else
  290.         {
  291.             j1direction := 0
  292.         }
  293.     }
  294.    
  295.     ;Ative esse return quando o joystick estiver
  296.     ;funcionando ao mesmo tempo que esta macro
  297.     ;assim o jogo não receberá 2 inputs, porém
  298.     ;podemos chamar os golpes especiais
  299.     ;return
  300.    
  301.     if (j1direction <> j1directionPrevious)
  302.     {
  303.         if(j1direction = 0){
  304.             Send, {%joy1up% up}
  305.             Send, {%joy1left% up}
  306.             Send, {%joy1down% up}
  307.             Send, {%joy1right% up}
  308.         }else if(j1direction = 5){
  309.             Send, {%joy1up% up}
  310.             Send, {%joy1left% up}
  311.             Send, {%joy1down% up}
  312.             ;Send, {%joy1right% up}
  313.            
  314.             Send, {%joy1right% down}                
  315.         }else if(j1direction = 6){
  316.             Send, {%joy1up% up}
  317.             ;Send, {%joy1left% up}
  318.             Send, {%joy1down% up}
  319.             Send, {%joy1right% up}
  320.            
  321.             Send, {%joy1left% down}
  322.         }else if(j1direction = 8){
  323.             ;Send, {%joy1up% up}
  324.             Send, {%joy1left% up}
  325.             Send, {%joy1down% up}
  326.             Send, {%joy1right% up}
  327.            
  328.             Send, {%joy1up% down}
  329.         }else if(j1direction = 7){
  330.             Send, {%joy1up% up}
  331.             Send, {%joy1left% up}
  332.             ;Send, {%joy1down% up}
  333.             Send, {%joy1right% up}
  334.            
  335.             Send, {%joy1down% down}
  336.         }else if(j1direction = 2){
  337.             ;Send, {%joy1up% up}
  338.             Send, {%joy1left% up}
  339.             Send, {%joy1down% up}
  340.             ;Send, {%joy1right% up}
  341.            
  342.             Send, {%joy1up% down}
  343.             Send, {%joy1right% down}
  344.         }else if(j1direction = 1){
  345.             ;Send, {%joy1up% up}
  346.             ;Send, {%joy1left% up}
  347.             Send, {%joy1down% up}
  348.             Send, {%joy1right% up}
  349.            
  350.             Send, {%joy1up% down}
  351.             Send, {%joy1left% down}
  352.         }else if(j1direction = 4){
  353.             Send, {%joy1up% up}
  354.             Send, {%joy1left% up}
  355.             ;Send, {%joy1down% up}
  356.             ;Send, {%joy1right% up}
  357.            
  358.             Send, {%joy1right% down}
  359.             Send, {%joy1down% down}
  360.         }else if(j1direction = 3){
  361.             Send, {%joy1up% up}
  362.             ;Send, {%joy1left% up}
  363.             ;Send, {%joy1down% up}
  364.             Send, {%joy1right% up}
  365.            
  366.             Send, {%joy1left% down}
  367.             Send, {%joy1down% down}
  368.         }      
  369.         j1directionPrevious := j1direction
  370.     }
  371. return ; WatchAxis end
  372.  
  373.  
  374. button1:
  375.  if (%joy1b1turbo%) {
  376.     loop { ; loop the script untill broken
  377.       GetKeyState, stateJoy1, %joystick%Joy1, P ; Get the state of button (U = Up and D = Down)
  378.       if stateJoy1 = U
  379.         break ; its been released so break the loop
  380.       sleep, turboDelay
  381.       send {%joy1b1% down}
  382.       sleep, turboDelay  ; This is the time between presses, after its slept it will return to the top of the loop and start again
  383.       send {%joy1b1% up}                
  384.     } ;loop end
  385.   } else {
  386.     send {%joy1b1% down}
  387.     KeyWait %joystick%Joy1
  388.     send {%joy1b1% up}    
  389.   } ; if end
  390. return
  391.  
  392. button2:
  393.  if (%joy1b2turbo%) {
  394.     loop { ; loop the script untill broken
  395.       GetKeyState, stateJoy2, %joystick%Joy2, P ; Get the state of button (U = Up and D = Down)
  396.       if stateJoy2 = U
  397.         break ; its been released so break the loop
  398.       sleep, turboDelay
  399.       send {%joy1b2% down}
  400.       sleep, turboDelay  ; This is the time between presses, after its slept it will return to the top of the loop and start again
  401.       send {%joy1b2% up}                
  402.     } ;loop end
  403.   } else {
  404.     send {%joy1b2% down}
  405.     KeyWait %joystick%Joy2
  406.     send {%joy1b2% up}    
  407.   } ; if end
  408. return
  409.  
  410. button3:
  411.  if (%joy1b3turbo%) {
  412.     loop { ; loop the script untill broken
  413.       GetKeyState, stateJoy3, %joystick%Joy3, P ; Get the state of button (U = Up and D = Down)
  414.       if stateJoy3 = U
  415.         break ; its been released so break the loop
  416.       sleep, turboDelay
  417.       send {%joy1b3% down}
  418.       sleep, turboDelay  ; This is the time between presses, after its slept it will return to the top of the loop and start again
  419.       send {%joy1b3% up}                
  420.     } ;loop end
  421.   } else {
  422.     send {%joy1b3% down}
  423.     KeyWait %joystick%Joy3
  424.     send {%joy1b3% up}    
  425.   } ; if end
  426. return
  427.  
  428. button4:
  429.  if (%joy1b4turbo%) {
  430.     loop { ; loop the script untill broken
  431.       GetKeyState, stateJoy4, %joystick%Joy4, P ; Get the state of button (U = Up and D = Down)
  432.       if stateJoy4 = U
  433.         break ; its been released so break the loop
  434.       sleep, turboDelay
  435.       send {%joy1b4% down}
  436.       sleep, turboDelay  ; This is the time between presses, after its slept it will return to the top of the loop and start again
  437.       send {%joy1b4% up}                
  438.     } ;loop end
  439.   } else {
  440.     send {%joy1b4% down}
  441.     KeyWait %joystick%Joy4
  442.     send {%joy1b4% up}    
  443.   } ; if end
  444. return
  445.  
  446. button5:
  447.  if (%joy1b5turbo%) {
  448.     loop { ; loop the script untill broken
  449.       GetKeyState, stateJoy5, %joystick%Joy5, P ; Get the state of button (U = Up and D = Down)
  450.       if stateJoy5 = U
  451.         break ; its been released so break the loop
  452.       sleep, turboDelay
  453.       send {%joy1b5% down}
  454.       sleep, turboDelay  ; This is the time between presses, after its slept it will return to the top of the loop and start again
  455.       send {%joy1b5% up}                
  456.     } ;loop end
  457.   } else {
  458.     send {%joy1b5% down}
  459.     KeyWait %joystick%Joy5
  460.     send {%joy1b5% up}    
  461.   } ; if end
  462. return
  463.  
  464. button6:
  465.  if (%joy1b6turbo%) {
  466.     loop { ; loop the script untill broken
  467.       GetKeyState, stateJoy6, %joystick%Joy6, P ; Get the state of button (U = Up and D = Down)
  468.       if stateJoy6 = U
  469.         break ; its been released so break the loop
  470.       sleep, turboDelay
  471.       send {%joy1b6% down}
  472.       sleep, turboDelay  ; This is the time between presses, after its slept it will return to the top of the loop and start again
  473.       send {%joy1b6% up}                
  474.     } ;loop end
  475.   } else {
  476.     send {%joy1b6% down}
  477.     KeyWait %joystick%Joy6
  478.     send {%joy1b6% up}    
  479.   } ; if end
  480. return
  481.  
  482. button7:
  483.  if (%joy1b7turbo%) {
  484.     loop { ; loop the script untill broken
  485.       GetKeyState, stateJoy7, %joystick%Joy7, P ; Get the state of button (U = Up and D = Down)
  486.       if stateJoy7 = U
  487.         break ; its been released so break the loop
  488.       sleep, turboDelay
  489.       send {%joy1b7% down}
  490.       sleep, turboDelay  ; This is the time between presses, after its slept it will return to the top of the loop and start again
  491.       send {%joy1b7% up}                
  492.     } ;loop end
  493.   } else {
  494.     send {%joy1b7% down}
  495.     KeyWait %joystick%Joy7
  496.     send {%joy1b7% up}    
  497.   } ; if end
  498. return
  499.  
  500. button8:
  501.  if (%joy1b8turbo%) {
  502.     loop { ; loop the script untill broken
  503.       GetKeyState, stateJoy8, %joystick%Joy8, P ; Get the state of button (U = Up and D = Down)
  504.       if stateJoy8 = U
  505.         break ; its been released so break the loop
  506.       sleep, turboDelay
  507.       send {%joy1b8% down}
  508.       sleep, turboDelay  ; This is the time between presses, after its slept it will return to the top of the loop and start again
  509.       send {%joy1b8% up}                
  510.     } ;loop end
  511.   } else {
  512.     send {%joy1b8% down}
  513.     KeyWait %joystick%Joy8
  514.     send {%joy1b8% up}    
  515.   } ; if end
  516. return
  517.  
  518. button9:
  519.  if (%joy1b9turbo%) {
  520.     loop { ; loop the script untill broken
  521.       GetKeyState, stateJoy9, %joystick%Joy9, P ; Get the state of button (U = Up and D = Down)
  522.       if stateJoy9 = U
  523.         break ; its been released so break the loop
  524.       sleep, turboDelay
  525.       send {%joy1b9% down}
  526.       sleep, turboDelay  ; This is the time between presses, after its slept it will return to the top of the loop and start again
  527.       send {%joy1b9% up}                
  528.     } ;loop end
  529.   } else {
  530.     send {%joy1b9% down}
  531.     KeyWait %joystick%Joy9
  532.     send {%joy1b9% up}    
  533.   } ; if end
  534. return
  535.  
  536. button10:
  537.  if (%joy1b10turbo%) {
  538.     loop { ; loop the script untill broken
  539.       GetKeyState, stateJoy10, %joystick%Joy10, P ; Get the state of button (U = Up and D = Down)
  540.       if stateJoy10 = U
  541.         break ; its been released so break the loop
  542.       sleep, turboDelay
  543.       send {%joy1b10% down}
  544.       sleep, turboDelay  ; This is the time between presses, after its slept it will return to the top of the loop and start again
  545.       send {%joy1b10% up}                
  546.     } ;loop end
  547.   } else {
  548.     send {%joy1b10% down}
  549.     KeyWait %joystick%Joy10
  550.     send {%joy1b10% up}    
  551.   } ; if end
  552. return
  553.  
  554. button11:
  555.  if (%joy1b11turbo%) {
  556.     loop { ; loop the script untill broken
  557.       GetKeyState, stateJoy11, %joystick%Joy11, P ; Get the state of button (U = Up and D = Down)
  558.       if stateJoy11 = U
  559.         break ; its been released so break the loop
  560.       sleep, turboDelay
  561.       send {%joy1b11% down}
  562.       sleep, turboDelay  ; This is the time between presses, after its slept it will return to the top of the loop and start again
  563.       send {%joy1b11% up}                
  564.     } ;loop end
  565.   } else {
  566.     send {%joy1b11% down}
  567.     KeyWait %joystick%Joy11
  568.     send {%joy1b11% up}    
  569.   } ; if end
  570. return
  571.  
  572. button12:
  573.  if (%joy1b12turbo%) {
  574.     loop { ; loop the script untill broken
  575.       GetKeyState, stateJoy12, %joystick%Joy12, P ; Get the state of button (U = Up and D = Down)
  576.       if stateJoy12 = U
  577.         break ; its been released so break the loop
  578.       sleep, turboDelay
  579.       send {%joy1b12% down}
  580.       sleep, turboDelay  ; This is the time between presses, after its slept it will return to the top of the loop and start again
  581.       send {%joy1b12% up}                
  582.     } ;loop end
  583.   } else {
  584.     send {%joy1b12% down}
  585.     KeyWait %joystick%Joy12
  586.     send {%joy1b12% up}    
  587.   } ; if end
  588. return
  589.  
  590. ;correr atacar
  591. run_attack:
  592.    if(%stopDirection%){
  593.         return
  594.     }
  595.     stopDirection = true
  596.    
  597.     Send, {%joy1up% up}
  598.     Send, {%joy1left% up}
  599.     Send, {%joy1down% up}
  600.     Send, {%joy1right% up}
  601.    
  602.     send, {%ladoAnterior% down}
  603.     sleep, turboDelay
  604.     send, {%ladoAnterior% up}
  605.    
  606.     sleep, turboDelay
  607.    
  608.     send, {%ladoAnterior% down}
  609.     sleep, turboDelay
  610.     send, {%attack% down}
  611.     sleep, turboDelay ;fix
  612.    
  613.     send, {%ladoAnterior% up}
  614.     send, {%attack% up}
  615.    
  616.     stopDirection = false
  617. return
  618.  
  619. ;correr chutar
  620. run_kick:
  621.    if(%stopDirection%){
  622.         return
  623.     }
  624.     stopDirection = true
  625.    
  626.     Send, {%joy1up% up}
  627.     Send, {%joy1left% up}
  628.     Send, {%joy1down% up}
  629.     Send, {%joy1right% up}
  630.    
  631.     send, {%ladoAnterior% down}
  632.     sleep, turboDelay
  633.     send, {%ladoAnterior% up}
  634.    
  635.     sleep, turboDelay
  636.    
  637.     send, {%ladoAnterior% down}
  638.     sleep, turboDelay
  639.     send, {%kick% down}
  640.    
  641.     send, {%ladoAnterior% up}
  642.     send, {%kick% up}
  643.    
  644.     stopDirection = false
  645. return
  646.  
  647. ;voadora
  648. flying_kick:
  649.  send, {%jump% down}
  650.   sleep, turboDelay
  651.   send, {%jump% up}
  652.  
  653.   send {%kick%}
  654. return
  655.  
  656. ;esquiva vertical (cima ou baixo)
  657. vertical_dogde:
  658.    if(%stopDirection%){
  659.         return
  660.     }
  661.     stopDirection = true
  662.    
  663.     Send, {%joy1up% up}
  664.     Send, {%joy1left% up}
  665.     Send, {%joy1down% up}
  666.     Send, {%joy1right% up}
  667.    
  668.     send, {%verticalAnterior% down}
  669.     sleep, turboDelay
  670.     send, {%verticalAnterior% up}
  671.    
  672.     sleep, turboDelay
  673.    
  674.     send, {%verticalAnterior% down}
  675.     sleep, turboDelay
  676.     ;sleep, turboDelay
  677.     send, {%verticalAnterior% up}
  678.        
  679.     stopDirection = false
  680. return
  681.  
  682. ;esquiva para cima
  683. up_dogde:
  684.    if(%stopDirection%){
  685.         return
  686.     }
  687.     stopDirection = true
  688.    
  689.     Send, {%joy1up% up}
  690.     Send, {%joy1left% up}
  691.     Send, {%joy1down% up}
  692.     Send, {%joy1right% up}
  693.    
  694.     send, {%joy1up% down}
  695.     sleep, turboDelay
  696.     send, {%joy1up% up}
  697.    
  698.     sleep, turboDelay
  699.    
  700.     send, {%joy1up% down}
  701.     sleep, turboDelay
  702.     ;sleep, turboDelay
  703.     send, {%joy1up% up}
  704.        
  705.     stopDirection = false
  706. return
  707.  
  708. ;esquiva para baixo
  709. down_dogde:
  710.    if(%stopDirection%){
  711.         return
  712.     }
  713.     stopDirection = true
  714.    
  715.     Send, {%joy1up% up}
  716.     Send, {%joy1left% up}
  717.     Send, {%joy1down% up}
  718.     Send, {%joy1right% up}
  719.    
  720.     send, {%joy1down% down}
  721.     sleep, turboDelay
  722.     send, {%joy1down% up}
  723.    
  724.     sleep, turboDelay
  725.    
  726.     send, {%joy1down% down}
  727.     sleep, turboDelay
  728.     ;sleep, turboDelay
  729.     send, {%joy1down% up}
  730.        
  731.     stopDirection = false
  732. return
  733.  
Add Comment
Please, Sign In to add comment