Advertisement
NeoAeon

Alterar Faixa

Jan 12th, 2024 (edited)
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Autohotkey 2.48 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, 100
  33. send, ^{c}
  34. ClipWait
  35. sleep, 100
  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, 50
  51. send, {right}
  52. sleep, 50
  53. send, ^{c}
  54. ClipWait
  55. sleep, 50
  56. ValKm := ClipBoard
  57. sleep, 50
  58. ClipBoard := "`r`n"
  59. sleep, 150
  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, 50
  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, 350
  92. send, {click, 1139, 590 , 2}
  93. sleep, 80
  94. send, %ValKm%
  95. sleep, 100
  96. send, {click, 932, 520, 2}
  97. sleep, 450
  98. ControlClick, x347 y224, %Title%,, Left, 1, NA
  99. sleep, 1000
  100. Loop
  101. {
  102. IfWinExist, ahk_class #32770
  103. {
  104. Send, {space}
  105. sleep, 500
  106. break
  107. }
  108. }
  109. Loop
  110. {
  111. IfWinExist, ahk_class #32770
  112. {
  113. Send, {space}
  114. sleep, 500
  115. break
  116. }
  117. }
  118. sleep, 350
  119. Send, {Enter}
  120. sleep, 650
  121. send, {click, 511, 191, 2} ;;aba de pesquisa
  122. sleep, 500
  123. WinActivate, ahk_exe EXCEL.exe
  124. WinWaitActive, ahk_exe EXCEL.exe
  125. sleep, 100
  126. Clipboard = "`r`n"
  127. send, {Left}
  128. sleep, 50
  129. send, {%UporDown%}
  130. ValKm := "`r`n"
  131. IdRota := "`r`n"
  132. sleep, 200
  133. }
  134. Return
  135.  
  136. *F5::
  137. Reload
  138. Return
  139.  
  140. *F6::
  141. Pause
  142. Return
  143.  
  144.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement