Advertisement
NeoAeon

Tipo Rodado

Jan 11th, 2024 (edited)
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Autohotkey 2.98 KB | Source Code | 0 0
  1. #Persistent
  2. #NoEnv
  3. #HotKeyInterval 1
  4. #MaxHotkeysPerInterval 127
  5. #InstallKeybdHook
  6. #UseHook
  7. #SingleInstance, Force
  8.  
  9. SetControlDelay, -1
  10. SetMouseDelay, -1
  11. SetWinDelay, -1
  12. SetBatchLines, -1
  13.  
  14. Gui, ProgramGui: Font, s10 bolda Verdana cYellow
  15. Gui, ProgramGui: Color, Black
  16. Gui, ProgramGui: Add, text, cYellow , F1 inicia, F6 pausa
  17. Gui, ProgramGui: Add, text, cYellow , Selecione o sentido
  18. Gui, ProgramGui: Add, DropDownList, vList1, Cima|Baixo
  19. Gui, ProgramGui: Show,, Alterar Faixa
  20. Return
  21.  
  22. *F1::
  23. Gui, ProgramGui: Submit, NoHide
  24. if (List1 = "Cima")
  25.     UporDown := "Up"
  26. else if (List1 = "Baixo")
  27.     UporDown := "Down"
  28. loop
  29. {
  30. WinActivate, ahk_exe EXCEL.exe
  31. WinWaitActive, ahk_exe EXCEL.exe
  32. sleep, 200
  33. send, ^{c}
  34. ClipWait
  35. sleep, 50
  36. If (Clipboard = "`r`n")
  37. {
  38. SoundBeep, 1000, 350, 100
  39. SoundBeep, 1000, 350, 100
  40. SoundBeep, 1000, 350, 100
  41. SoundBeep, 1000, 350, 100
  42. SoundBeep, 1000, 350, 100
  43. SoundBeep, 1000, 350, 100
  44. SoundBeep, 1000, 350, 100
  45. Break
  46. }
  47. IdRota := ClipBoard
  48. sleep, 100
  49. ClipBoard := "`r`n"
  50. sleep 100
  51. send, {right}
  52. sleep, 100
  53. send, ^{c}
  54. clipwait
  55. sleep 50
  56. TipoRodado := ClipBoard
  57. sleep, 50
  58. ClipBoard := "`r`n"
  59. sleep, 250
  60. WinActivate, ahk_exe DDSLogistica.exe
  61. WinWaitActive, ahk_exe DDSLogistica.exe
  62. loop
  63. {
  64.   CoordMode, Pixel, Relative
  65.   PixelSearch, X, Y, 1039, 224, 1110, 240, 0x6782B6, 20, Fast RGB
  66.   if (errorlevel = 1)
  67.   {
  68.   ControlClick, x511 y191, %Title%,, Left, 2, NA
  69.   }
  70.   else if (errorlevel = 0)
  71.   {
  72.   break
  73.   }
  74. }
  75. sleep, 200
  76. send, {Click, 864, 311, 2} ;;caixa de pesquisa numero da rota
  77. sleep, 90
  78. send, %IdRota%
  79. sleep, 150
  80. send, {Click, 1526, 409} ;;pesquisar
  81. sleep, 250
  82. send, {click, 347, 521} ;;exibir
  83. ClipBoard := "`r`n"
  84. loop
  85. {
  86.   CoordMode, Pixel, Relative
  87.   PixelSearch, X, Y, 357, 208, 388, 239, 0xD23D26, 20, Fast RGB
  88.   if errorlevel = 0
  89.   break
  90. }
  91. sleep, 500
  92. send, {click, 1519, 305, 2}
  93. sleep, 250
  94. Loop, Parse, TipoRodado, `/
  95. {
  96.   Send, % A_LoopField
  97.   Sleep, 250
  98. }
  99. sleep, 400
  100. send, {esc}
  101. sleep, 500
  102. send, {click, 407, 532, 2}
  103. sleep, 500
  104. Gosub, Deleta
  105. sleep, 500
  106. send, {click, 702, 532, 2}
  107. sleep, 500
  108. Gosub, Deleta
  109. sleep, 500
  110. send, {click, 1116, 532, 2}
  111. sleep, 500
  112. Gosub, Deleta
  113. sleep, 500
  114. send, {click, 1383, 532, 2}
  115. sleep, 500
  116. Gosub, Deleta
  117. sleep, 500
  118. send, {click, 932, 520, 2}
  119. sleep, 450
  120. send, {click, 1607, 520, 2}
  121. sleep, 450
  122. send, {click, 339, 221} ;;salvar
  123. sleep, 500
  124. Loop
  125. {
  126. IfWinExist, ahk_class #32770
  127. {
  128. Send, {space}
  129. sleep, 500
  130. break
  131. }
  132. }
  133. Loop
  134. {
  135. IfWinExist, ahk_class #32770
  136. {
  137. Send, {space}
  138. sleep, 500
  139. break
  140. }
  141. }
  142. sleep, 350
  143. Send, {Enter}
  144. sleep, 650
  145. send, {click, 511, 191, 2} ;;aba de pesquisa
  146. sleep, 500
  147. WinActivate, ahk_exe EXCEL.exe
  148. WinWaitActive, ahk_exe EXCEL.exe
  149. sleep, 100
  150. Clipboard = "`r`n"
  151. sleep, 150
  152. send, {%UporDown%}
  153. sleep, 80
  154. send, {left}
  155. sleep, 80
  156. IdRota := "`r`n"
  157. TipoRodado := "`r`n"
  158. sleep, 100
  159. }
  160. Return
  161.  
  162.  
  163.  
  164. Deleta:
  165. {
  166. send, {del}
  167. sleep, 300
  168. send, {Down}
  169. sleep, 50
  170. send, {down}
  171. }
  172. return
  173.  
  174. *F5::
  175. Reload
  176. Return
  177.  
  178. *F6::
  179. Pause
  180. Return
  181.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement