Advertisement
NeoAeon

AlterarCiclos

Dec 13th, 2023 (edited)
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Autohotkey 4.26 KB | Source Code | 0 0
  1. MsgBox, F1 = AM // F2 = PM
  2. #Persistent
  3. #NoEnv
  4. #HotKeyInterval 1
  5. #MaxHotkeysPerInterval 127
  6. #InstallKeybdHook
  7. #UseHook
  8. #SingleInstance, Force
  9.  
  10. SetControlDelay, -1
  11. SetMouseDelay, -1
  12. SetWinDelay, -1
  13. SetBatchLines, -1
  14.  
  15. Gui, ProgramGui: Font, s10 bolda Verdana cYellow
  16. Gui, ProgramGui: Color, Black
  17. Gui, ProgramGui: Add, text, cYellow , F1 inicia, F6 pausa
  18. Gui, ProgramGui: Add, text, cYellow , Selecione o sentido
  19. Gui, ProgramGui: Add, DropDownList, vList1, Cima|Baixo
  20. Gui, ProgramGui: Show,, Alterar Faixa
  21. Return
  22.  
  23. *F1::
  24. Gui, ProgramGui: Submit, NoHide
  25. if (List1 = "Cima")
  26.     UporDown := "Up"
  27. else if (List1 = "Baixo")
  28.     UporDown := "Down"
  29. loop
  30. {
  31. WinActivate, ahk_exe EXCEL.exe
  32. WinWaitActive, ahk_exe EXCEL.exe
  33. sleep, 100
  34. send, ^{c}
  35. ClipWait
  36. sleep, 100
  37. If (Clipboard = "`r`n")
  38. {
  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. SoundBeep, 1000, 350, 100
  46. Break
  47. }
  48. IdRota := ClipBoard
  49. sleep, 100
  50. ClipBoard := "`r`n"
  51. sleep, 150
  52. WinActivate, ahk_exe DDSLogistica.exe
  53. WinWaitActive, ahk_exe DDSLogistica.exe
  54. loop
  55. {
  56.   CoordMode, Pixel, Relative
  57.   PixelSearch, X, Y, 1039, 224, 1110, 240, 0x6782B6, 20, Fast RGB
  58.   if (errorlevel = 1)
  59.   {
  60.   ControlClick, x511 y191, %Title%,, Left, 2, NA
  61.   }
  62.   else if (errorlevel = 0)
  63.   {
  64.   break
  65.   }
  66. }
  67. sleep, 200
  68. send, {Click, 864, 311, 2} ;;caixa de pesquisa numero da rota
  69. sleep, 50
  70. send, %IdRota%
  71. sleep, 150
  72. send, {Click, 1526, 409} ;;pesquisar
  73. sleep, 250
  74. send, {click, 347, 521} ;;exibir
  75. ClipBoard := "`r`n"
  76. loop
  77. {
  78.   CoordMode, Pixel, Relative
  79.   PixelSearch, X, Y, 357, 208, 388, 239, 0xD23D26, 20, Fast RGB
  80.   if errorlevel = 0
  81.   break
  82. }
  83. sleep, 350
  84. send, {click, 1523, 357, 2} ;am
  85. sleep, 100
  86. send, {click, 932, 520, 2}
  87. sleep, 450
  88. send, {click, 1607, 520, 2}
  89. sleep, 450
  90. send, {click, 339, 221} ;;salvar
  91. sleep, 1000
  92. Loop
  93. {
  94. IfWinExist, ahk_class #32770
  95. {
  96. Send, {space}
  97. sleep, 500
  98. break
  99. }
  100. }
  101. Loop
  102. {
  103. IfWinExist, ahk_class #32770
  104. {
  105. Send, {space}
  106. sleep, 500
  107. break
  108. }
  109. }
  110. sleep, 350
  111. Send, {Enter}
  112. sleep, 650
  113. send, {click, 511, 191, 2} ;;aba de pesquisa
  114. sleep, 500
  115. WinActivate, ahk_exe EXCEL.exe
  116. WinWaitActive, ahk_exe EXCEL.exe
  117. sleep, 100
  118. Clipboard = "`r`n"
  119. sleep, 50
  120. send, {%UporDown%}
  121. IdRota := "`r`n"
  122. sleep, 200
  123. }
  124. Return
  125.  
  126. *F2::
  127. Gui, ProgramGui: Submit, NoHide
  128. if (List1 = "Cima")
  129.     UporDown := "Up"
  130. else if (List1 = "Baixo")
  131.     UporDown := "Down"
  132. loop
  133. {
  134. WinActivate, ahk_exe EXCEL.exe
  135. WinWaitActive, ahk_exe EXCEL.exe
  136. sleep, 100
  137. send, ^{c}
  138. ClipWait
  139. sleep, 100
  140. If (Clipboard = "`r`n")
  141. {
  142. SoundBeep, 1000, 350, 100
  143. SoundBeep, 1000, 350, 100
  144. SoundBeep, 1000, 350, 100
  145. SoundBeep, 1000, 350, 100
  146. SoundBeep, 1000, 350, 100
  147. SoundBeep, 1000, 350, 100
  148. SoundBeep, 1000, 350, 100
  149. Break
  150. }
  151. IdRota := ClipBoard
  152. sleep, 100
  153. ClipBoard := "`r`n"
  154. sleep, 150
  155. WinActivate, ahk_exe DDSLogistica.exe
  156. WinWaitActive, ahk_exe DDSLogistica.exe
  157. loop
  158. {
  159.   CoordMode, Pixel, Relative
  160.   PixelSearch, X, Y, 1039, 224, 1110, 240, 0x6782B6, 20, Fast RGB
  161.   if (errorlevel = 1)
  162.   {
  163.   ControlClick, x511 y191, %Title%,, Left, 2, NA
  164.   }
  165.   else if (errorlevel = 0)
  166.   {
  167.   break
  168.   }
  169. }
  170. sleep, 200
  171. send, {Click, 864, 311, 2} ;;caixa de pesquisa numero da rota
  172. sleep, 50
  173. send, %IdRota%
  174. sleep, 150
  175. send, {Click, 1526, 409} ;;pesquisar
  176. sleep, 250
  177. send, {click, 347, 521} ;;exibir
  178. ClipBoard := "`r`n"
  179. loop
  180. {
  181.   CoordMode, Pixel, Relative
  182.   PixelSearch, X, Y, 357, 208, 388, 239, 0xD23D26, 20, Fast RGB
  183.   if errorlevel = 0
  184.   break
  185. }
  186. sleep, 350
  187. send, {click, 1590, 358, 2} ;pm
  188. sleep, 100
  189. send, {click, 932, 520}
  190. sleep, 150
  191. send, {click, 1613, 502}
  192. sleep, 250
  193. send, {click, 661, 308, 2}
  194. sleep, 250
  195. send, ^{c}
  196. clipwait
  197. sleep, 25
  198. If (Clipboard < 1 )
  199. {
  200. send, {1}{tab}
  201. sleep, 80
  202. }
  203. send, {click, 348, 222} ;;salvar
  204. Loop
  205. {
  206. IfWinExist, ahk_class #32770
  207. {
  208. Send, {space}
  209. sleep, 2000
  210. break
  211. }
  212. }
  213. Loop
  214. {
  215. IfWinExist, ahk_class #32770
  216. {
  217. Send, {space}
  218. sleep, 500
  219. break
  220. }
  221. }
  222. sleep, 350
  223. Send, {Enter}
  224. sleep, 650
  225. send, {click, 511, 191, 2} ;;aba de pesquisa
  226. sleep, 500
  227. WinActivate, ahk_exe EXCEL.exe
  228. WinWaitActive, ahk_exe EXCEL.exe
  229. sleep, 100
  230. Clipboard = "`r`n"
  231. sleep, 50
  232. send, {%UporDown%}
  233. IdRota := "`r`n"
  234. sleep, 200
  235. }
  236. return
  237.  
  238. *F5::
  239. Reload
  240. Return
  241.  
  242. *F6::
  243. Pause
  244. Return
  245.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement