Advertisement
NeoAeon

Avulsos

Jan 11th, 2024 (edited)
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Autohotkey 8.97 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.  
  15. Gui, ProgramGui: Font, s10 bolda Verdana cYellow
  16. Gui, ProgramGui: Color, Black
  17. Gui, ProgramGui: add, Checkbox, vMyCheckBox1, Credito
  18. Gui, ProgramGui: add, Checkbox, vMyCheckBox2, Debito
  19. Gui, ProgramGui: add, text, cYellow , Selecone a data
  20. Gui, ProgramGui: add, MonthCal, gCalendar vMyCalendar
  21. Gui, ProgramGui: show,, Avulso
  22. Return
  23.  
  24. Calendar:
  25. Gui, ProgramGui: Submit, NoHide
  26. FormatTime, mycalendar, %mycalendar%, dd/MM/yyyy
  27. Data := mycalendar
  28. Return
  29.  
  30. *F1::
  31. Gui, ProgramGui: Submit, NoHide
  32. GuiControlGet, MyCheckBox1
  33. GuiControlGet, MyCheckBox2
  34. sleep, 20
  35. If (MyCheckBox1 = 1)&&(MyCheckBox2 = 1)
  36. {
  37. Msgbox, marca apenas uma caixinha pra n dar pau karai
  38. reload
  39. }
  40. If (MyCheckBox1 = 1)
  41. {
  42. WinActivate, ahk_exe DDSLogistica.exe
  43. WinWaitActive, ahk_exe DDSLogistica.exe
  44. sleep, 150
  45. WinGet, DDSPid, PID, A
  46. sleep, 250
  47. GoSub, CreditoOn
  48. }
  49. else if (MyCheckBox2 = 1)
  50. {
  51. WinActivate, ahk_exe DDSLogistica.exe
  52. WinWaitActive, ahk_exe DDSLogistica.exe
  53. sleep, 150
  54. WinGet, DDSPid, PID, A
  55. sleep, 250
  56. GoSub, DebitoOn
  57. }
  58. else
  59. msgbox, Selecione debito ou credito
  60. return
  61.  
  62. *F2::
  63. Gui, ProgramGui: Submit, NoHide
  64. GuiControlGet, MyCheckBox1
  65. GuiControlGet, MyCheckBox2
  66. sleep, 20
  67. If (MyCheckBox1 = 1)&&(MyCheckBox2 = 1)
  68. {
  69. Msgbox, marca apenas uma caixinha pra n dar pau karai
  70. reload
  71. }
  72. If (MyCheckBox1 = 1)
  73. {
  74. GoSub, CreditoOnData
  75. }
  76. else if (MyCheckBox2 = 1)
  77. {
  78. GoSub, DebitoOn
  79. }
  80. else
  81. msgbox, Selecione debito ou credito
  82. return
  83.  
  84. CreditoOnData:
  85. loop
  86. {
  87. ClipBoard :="`r`n"
  88. sleep, 150
  89. send, ^{c}
  90. ClipWait
  91. sleep, 100
  92. Projeto := ClipBoard
  93. sleep, 100
  94. if (Projeto ="`r`n")
  95. {
  96. sleep, 80
  97. SoundBeep, 1000, 350, 100
  98. Break
  99. }
  100. sleep, 100
  101. ClipBoard := "`r`n"
  102. send, {right}
  103. sleep, 100
  104. Send, ^{c}
  105. ClipWait
  106. sleep, 100
  107. NomeMotorista := ClipBoard
  108. ClipBoard := "`r`n"
  109. sleep, 100
  110. send, {Right}
  111. sleep, 100
  112. Send, ^{c}
  113. ClipWait
  114. sleep, 100
  115. DataCopiada := ClipBoard
  116. ClipBoard := "`r`n"
  117. sleep, 100
  118. send, {Right}
  119. sleep, 100
  120. Send, ^{c}
  121. ClipWait
  122. sleep, 100
  123. ValorBonus := ClipBoard
  124. sleep, 100
  125. ClipBoard := "`r`n"
  126. send, {right}
  127. sleep, 100
  128. send, ^{c}
  129. ClipWait
  130. sleep, 100
  131. WinActivate, ahk_exe DDSLogistica.exe
  132. WinWaitActive, ahk_exe DDSLogistica.exe
  133. sleep, 250
  134. loop
  135. {
  136.   CoordMode, Pixel, Relative
  137.   PixelSearch, X, Y, 456, 301, 486, 334, 0xE27869 , 10, Fast RGB
  138.   if errorlevel = 0
  139.   break
  140. }
  141. sleep, 450
  142. send, {Click, 452, 441} ;;codigo minuta
  143. sleep, 50
  144. Send, 3
  145. sleep, 75
  146. send, {click, 590, 437} ;;origem
  147. sleep, 70
  148. send, {a}
  149. sleep, 50
  150. send, {Enter}
  151. sleep, 70
  152. send, {click, 887, 436, 2} ;;historico
  153. sleep, 100
  154. send, {click, 887, 436, 2}
  155. sleep, 150
  156. send, ^{v}
  157. sleep, 200
  158. send, {click, 603, 381}
  159. sleep, 50
  160. send, %DataCopiada%
  161. sleep, 50
  162. send, {click, 765, 382, 2} ;;nome motorista
  163. sleep, 150
  164. Loop, Parse, NomeMotorista
  165. {
  166.   Send, % A_LoopField
  167.   Sleep, 150
  168. }
  169. send, {esc}
  170. sleep, 150
  171. send, {click, 1170, 378, 2} ;;projeto
  172. sleep, 70
  173. Loop, Parse, Projeto
  174. {
  175.   Send, % A_LoopField
  176.   Sleep, 70
  177. }
  178. send, {esc}
  179. sleep, 200
  180. send, {click, 1460, 378, 2}
  181. sleep, 150
  182. send, {c} ;;crédito ou débito
  183. sleep, 150
  184. send, {click, 1312, 381, 2} ;;valor
  185. sleep, 80
  186. send, ^{a}
  187. sleep, 200
  188. send, %ValorBonus%
  189. sleep, 150
  190. send, {click, 445, 321}
  191. sleep, 400
  192. send, {Enter}
  193. sleep, 80
  194. WinActivate, ahk_exe EXCEL.exe
  195. WinWaitActive, ahk_exe EXCEL.exe
  196. sleep, 100
  197. send, {Left}
  198. sleep, 50
  199. send, {Left}
  200. sleep, 50
  201. send, {Left}
  202. sleep, 50
  203. send, {Left}
  204. sleep, 50
  205. send, {down}
  206. sleep, 50
  207. }
  208. return
  209.  
  210. CreditoOn:
  211. loop
  212. {
  213. sleep, 100
  214. WinActivate, ahk_exe EXCEL.exe
  215. WinWaitActive, ahk_exe EXCEL.exe
  216. sleep, 500
  217. ClipBoard :="`r`n"
  218. sleep, 250
  219. send, ^{c}
  220. ClipWait
  221. sleep, 250
  222. IfWinExist, ahk_class #32770
  223. {
  224. send, {space}
  225. sleep, 200
  226. send, ^{c}
  227. clipwait
  228. }
  229. Projeto := ClipBoard
  230. sleep, 30
  231. if (Projeto ="`r`n")
  232. {
  233. sleep, 80
  234. SoundBeep, 1000, 350, 100
  235. Break
  236. }
  237. sleep, 250
  238. ClipBoard := "`r`n"
  239. send, {right}
  240. sleep, 100
  241. Send, ^{c}
  242. ClipWait
  243. sleep, 250
  244. IfWinExist, ahk_class #32770
  245. {
  246. send, {space}
  247. sleep, 200
  248. send, ^{c}
  249. clipwait
  250. }
  251. NomeMotorista := ClipBoard
  252. ClipBoard := "`r`n"
  253. sleep, 100
  254. send, {Right}
  255. sleep, 100
  256. Send, ^{c}
  257. ClipWait
  258. sleep, 250
  259. IfWinExist, ahk_class #32770
  260. {
  261. send, {space}
  262. sleep, 200
  263. send, ^{c}
  264. clipwait
  265. }
  266. ValorBonus := ClipBoard
  267. sleep, 100
  268. ClipBoard := "`r`n"
  269. send, {right}
  270. sleep, 100
  271. send, ^{c}
  272. ClipWait
  273. sleep, 250
  274. IfWinExist, ahk_class #32770
  275. {
  276. send, {space}
  277. sleep, 200
  278. send, ^{c}
  279. clipwait
  280. }
  281. sleep, 500
  282. WinActivate, ahk_exe DDSLogistica.exe
  283. WinActivate, ahk_exe DDSLogistica.exe
  284. WinActivate, ahk_exe DDSLogistica.exe
  285. WinWaitActive, ahk_exe DDSLogistica.exe
  286. sleep, 250
  287. loop
  288. {
  289.   CoordMode, Pixel, Relative
  290.   PixelSearch, X, Y, 456, 301, 486, 334, 0xE27869 , 10, Fast RGB
  291.   if errorlevel = 0
  292.   break
  293. }
  294. send, {click, 413, 319}
  295. sleep, 450
  296. send, {Click, 452, 441} ;;codigo minuta
  297. sleep, 50
  298. Send, 3
  299. sleep, 75
  300. send, {click, 590, 437} ;;origem
  301. sleep, 70
  302. send, {a}
  303. sleep, 50
  304. send, {Enter}
  305. sleep, 200
  306. send, {click, 887, 436, 2} ;;historico
  307. sleep, 250
  308. send, ^{v}
  309. sleep, 200
  310. send, {click, 603, 381}
  311. sleep, 50
  312. send, %Data%
  313. sleep, 50
  314. send, {click, 765, 382, 2} ;;nome motorista
  315. sleep, 150
  316. Loop, Parse, NomeMotorista
  317. {
  318.   Send, % A_LoopField
  319.   Sleep, 150
  320. }
  321. send, {esc}
  322. sleep, 150
  323. send, {click, 1170, 378, 2} ;;projeto
  324. sleep, 70
  325. Loop, Parse, Projeto
  326. {
  327.   Send, % A_LoopField
  328.   Sleep, 150
  329. }
  330. send, {esc}
  331. sleep, 200
  332. send, {click, 1460, 378, 2}
  333. sleep, 150
  334. send, {c} ;;crédito ou débito
  335. sleep, 150
  336. send, {click, 1312, 381, 2} ;;valor
  337. sleep, 80
  338. send, ^{a}
  339. sleep, 200
  340. send, %ValorBonus%
  341. sleep, 150
  342. send, {click, 445, 321}
  343. sleep, 400
  344. send, {Enter}
  345. sleep, 3000
  346. WinActivate, ahk_exe EXCEL.exe
  347. WinWaitActive, ahk_exe EXCEL.exe
  348. sleep, 1000
  349. send, {Left}
  350. sleep, 50
  351. send, {Left}
  352. sleep, 50
  353. send, {Left}
  354. sleep, 50
  355. send, {Left}
  356. sleep, 50
  357. send, {down}
  358. sleep, 500
  359. }
  360. return
  361.  
  362. DebitoOn:
  363. loop
  364. {
  365. sleep, 100
  366. WinActivate, ahk_exe EXCEL.exe
  367. WinWaitActive, ahk_exe EXCEL.exe
  368. sleep, 500
  369. ClipBoard :="`r`n"
  370. sleep, 250
  371. send, ^{c}
  372. ClipWait
  373. sleep, 100
  374. IfWinExist, ahk_class #32770
  375. {
  376. send, {space}
  377. sleep, 200
  378. send, ^{c}
  379. clipwait
  380. }
  381. Projeto := ClipBoard
  382. sleep, 30
  383. if (Projeto ="`r`n")
  384. {
  385. sleep, 80
  386. SoundBeep, 1000, 350, 100
  387. Break
  388. }
  389. sleep, 100
  390. ClipBoard := "`r`n"
  391. send, {right}
  392. sleep, 100
  393. Send, ^{c}
  394. ClipWait
  395. sleep, 100
  396. IfWinExist, ahk_class #32770
  397. {
  398. send, {space}
  399. sleep, 200
  400. send, ^{c}
  401. clipwait
  402. }
  403. NomeMotorista := ClipBoard
  404. ClipBoard := "`r`n"
  405. sleep, 100
  406. send, {Right}
  407. sleep, 100
  408. Send, ^{c}
  409. ClipWait
  410. sleep, 100
  411. IfWinExist, ahk_class #32770
  412. {
  413. send, {space}
  414. sleep, 200
  415. send, ^{c}
  416. clipwait
  417. }
  418. ValorBonus := ClipBoard
  419. sleep, 100
  420. ClipBoard := "`r`n"
  421. send, {right}
  422. sleep, 100
  423. send, ^{c}
  424. ClipWait
  425. sleep, 100
  426. IfWinExist, ahk_class #32770
  427. {
  428. send, {space}
  429. sleep, 200
  430. send, ^{c}
  431. clipwait
  432. }
  433. sleep, 500
  434. WinActivate, ahk_pid %DDSPid%
  435. WinWaitActive, ahk_pid %DDSPid%
  436. sleep, 250
  437. loop
  438. {
  439.   CoordMode, Pixel, Relative
  440.   PixelSearch, X, Y, 456, 301, 486, 334, 0xE27869 , 10, Fast RGB
  441.   if errorlevel = 0
  442.   break
  443. }
  444. send, {click, 413, 319}
  445. sleep, 450
  446. send, {Click, 452, 441} ;;codigo minuta
  447. sleep, 50
  448. Send, 3
  449. sleep, 75
  450. send, {click, 590, 437} ;;origem
  451. sleep, 70
  452. send, {a}
  453. sleep, 50
  454. send, {Enter}
  455. sleep, 200
  456. send, {click, 887, 436, 2} ;;historico
  457. sleep, 250
  458. send, ^{v}
  459. sleep, 200
  460. send, {click, 603, 381}
  461. sleep, 50
  462. send, %Data%
  463. sleep, 50
  464. send, {click, 765, 382, 2} ;;nome motorista
  465. sleep, 150
  466. Loop, Parse, NomeMotorista
  467. {
  468.   Send, % A_LoopField
  469.   Sleep, 150
  470. }
  471. send, {esc}
  472. sleep, 150
  473. send, {click, 1170, 378, 2} ;;projeto
  474. sleep, 70
  475. Loop, Parse, Projeto
  476. {
  477.   Send, % A_LoopField
  478.   Sleep, 150
  479. }
  480. send, {esc}
  481. sleep, 200
  482. send, {click, 1460, 378, 2}
  483. sleep, 150
  484. send, {d} ;;crédito ou débito
  485. sleep, 150
  486. send, {click, 1312, 381, 2} ;;valor
  487. sleep, 80
  488. send, ^{a}
  489. sleep, 200
  490. send, %ValorBonus%
  491. sleep, 150
  492. send, {click, 445, 321}
  493. sleep, 400
  494. send, {Enter}
  495. sleep, 3000
  496. WinActivate, ahk_exe EXCEL.exe
  497. WinWaitActive, ahk_exe EXCEL.exe
  498. sleep, 1000
  499. send, {Left}
  500. sleep, 50
  501. send, {Left}
  502. sleep, 50
  503. send, {Left}
  504. sleep, 50
  505. send, {Left}
  506. sleep, 50
  507. send, {down}
  508. sleep, 500
  509. }
  510. return
  511.  
  512. VerificaErro:
  513. {
  514. WinActivate, ahk_exe DDSLogistica.exe
  515. WinWaitActive, ahk_exe DDSLogistica.exe
  516. sleep, 400
  517. loop, 50
  518.    {
  519.   CoordMode, Pixel, Relative
  520.   PixelSearch, X, Y, 30, 58, 75, 103, 0xE14E10, 20, Fast RGB
  521.   if errorlevel = 0
  522.   {
  523.   send, {space}
  524.   sleep, 150
  525.   send, {click, 415, 316}
  526.   sleep, 250
  527.   WinActivate, ahk_exe EXCEL.exe
  528.   WinWaitActive, ahk_exe EXCEL.exe
  529.   sleep, 150
  530.   send, {left}
  531.   sleep, 50
  532.   send, {left}
  533.   sleep, 50
  534.   send, {left}
  535.   sleep, 50
  536.   send, {up}
  537.   sleep, 50
  538.   break
  539.   }
  540.    }
  541. }
  542. return
  543.  
  544. *^F4::
  545. loop
  546. {
  547. send, {f2}
  548. sleep, 50
  549. send, {home}
  550. sleep, 50
  551. send, '
  552. sleep, 50
  553. send, {enter}
  554. sleep, 50
  555. }
  556. Return
  557.  
  558. *^F3::
  559. loop
  560. {
  561. send, {f2}
  562. sleep, 50
  563. send, {home}
  564. sleep, 50
  565. send, {del}
  566. sleep, 50
  567. send, {enter}
  568. sleep, 50
  569. }
  570. Return
  571.  
  572. *F5::
  573. Reload
  574. Return
  575.  
  576. *F6::
  577. Pause
  578. Return
  579.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement