Advertisement
NeoAeon

Cadastro Fornecedores

Jan 25th, 2024 (edited)
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Autohotkey 23.77 KB | Source Code | 0 0
  1. #SingleInstance, Force
  2. SetWorkingDir, %A_ScriptDir%
  3. Sendmode InPut
  4.  
  5. #Persistent
  6. #NoEnv
  7. #HotKeyInterval 1
  8. #MaxHotkeysPerInterval 127
  9. #InstallKeybdHook
  10. #UseHook
  11. #SingleInstance, Force
  12.  
  13. SetControlDelay, -1
  14. SetMouseDelay, -1
  15. SetWinDelay,-1
  16. SetBatchLines,-1
  17.  
  18. SleepTime := 700
  19.  
  20. msgbox, F1 FORNECEDORES | F2 PROPRIETARIO | F3 FROTA | F4 MOTORISTA
  21.  
  22. *F1::
  23. UF := "SP"
  24. Loop,
  25. {
  26. send, ^{c}
  27. clipwait
  28. sleep, 100
  29. if (ClipBoard = "`r`n")
  30. {
  31. loop, 5
  32. {
  33. SoundBeep, 2000, 350, 1000
  34. }
  35. break
  36. }
  37.     TipoDePessoa := ClipBoard
  38.     sleep, 50
  39.     ClipBoard := "`r`n"
  40.     sleep, 150
  41.     send, {right}
  42.     sleep, 100
  43.     send, ^{c}
  44.     clipwait
  45.     sleep, 100
  46.      CPFouCNPJ := ClipBoard
  47.      sleep, 50
  48.      ClipBoard := "`r`n"
  49.      sleep, 150
  50.      send, {right}
  51.      sleep, 100
  52.      send, ^{c}
  53.      clipwait
  54.      sleep, 100
  55.      IE := ClipBoard
  56.      sleep, 50
  57.      ClipBoard := "`r`n"
  58.      sleep, 150
  59.      send, {right}
  60.      sleep, 100
  61.      send, ^{c}
  62.      clipwait
  63.      sleep, 100
  64.      NumeroBanco := ClipBoard
  65.      sleep, 50
  66.      ClipBoard := "`r`n"
  67.      sleep, 150
  68.      send, {right}
  69.      sleep, 100
  70.      send, ^{c}
  71.      clipwait
  72.      sleep, 100
  73.      Banco := ClipBoard
  74.      sleep, 50
  75.      ClipBoard := "`r`n"
  76.      sleep, 150
  77.      send, {right}
  78.      sleep, 100
  79.      send, ^{c}
  80.      clipwait
  81.      sleep, 100
  82.       Favorecido := ClipBoard
  83.       sleep, 50
  84.       ClipBoard := "`r`n"
  85.       sleep, 150
  86.       send, {right}
  87.       sleep, 100
  88.       send, ^{c}
  89.       clipwait
  90.       sleep, 100
  91.        TipoDaChave := RegExReplace( ClipBoard, "[\r\n\t]" )
  92.        sleep, 150
  93.        ClipBoard := "`r`n"
  94.        sleep, 150
  95.        send, {right}
  96.        sleep, 100
  97.        send, ^{c}
  98.        clipwait
  99.        sleep, 100
  100.          ChavePix := ClipBoard
  101.          sleep, 50
  102.          ClipBoard := "`r`n"
  103.          sleep, 150
  104.           send, {right}
  105.          sleep, 100
  106.           send, ^{c}
  107.           clipwait
  108.           sleep, 100
  109.            NumAgencia := ClipBoard
  110.            sleep, 50
  111.            ClipBoard := "`r`n"
  112.            sleep, 150
  113.            send, {right}
  114.            sleep, 100
  115.            send, ^{c}
  116.            clipwait
  117.            sleep, 100
  118.             NumConta := ClipBoard
  119.             sleep, 50
  120.             ClipBoard := "`r`n"
  121.               sleep, 100
  122.               send, {right}
  123.               sleep, 50
  124.             gosub, ColarNoDDS
  125. sleep, 250
  126. TipoDePessoa := "`r`n"
  127.   CPFouCNPJ := "`r`n"
  128.     IE := "`r`n"
  129.      NumeroBanco := "`r`n"
  130.       Banco := "`r`n"
  131.         Favorecido := "`r`n"
  132.           TipoDaChave := "`r`n"
  133.             ChavePix := "`r`n"
  134.               NumAgencia := "`r`n"
  135.                 NumConta := "`r`n"
  136.         sleep, 150
  137.     WinActivate, ahk_exe EXCEL.exe
  138.         WinWaitActive, ahk_exe EXCEL.exe
  139.                   sleep, 150
  140.                    send, {down}
  141.                    sleep, 100
  142.                    loop, 8
  143.                    {
  144.                        send, ^{left}
  145.                        sleep, 50
  146.                    }
  147.                    sleep, 250
  148.                    
  149. }
  150. Return
  151.  
  152. *F2::
  153. loop
  154. {
  155. Gosub, CopiaDados
  156. sleep, 500
  157. if (Parar = 1)
  158. {
  159. break
  160. }
  161. WinActivate, ahk_exe DDSLogistica.exe
  162. WinWaitActive, ahk_exe DDSLogistica.exe
  163. sleep, 250
  164. send, {click, 572, 498} ;;aba dados pessoais
  165. sleep, 500
  166. send, {click, 529, 240}
  167. sleep, 200
  168. Send, {Click, 677, 307} ; nome proprietário digitável
  169. Sleep, %SleepTime%
  170. send, %NomePropri%
  171. Send, {Click, 606, 355, 2} ; CPF/CNPJ digitável
  172. Sleep, %SleepTime%
  173. send, %Cpf_Cnpj%
  174. Sleep, %SleepTime%
  175. Send, {Click, 839, 361} ; Data de nascimento digitável
  176. Sleep, %SleepTime%
  177. Send, %Data%
  178. Sleep, %SleepTime%
  179. Send, {Click, 982, 358} ; RG digitável
  180. Sleep, %SleepTime%
  181. send, %RG%
  182. Sleep, %SleepTime%
  183. Send, {Click, 1149, 359} ; Inscrição estadual digitável SEMPRE ISENTO
  184. Sleep, %SleepTime%
  185. send, isento
  186. Sleep, %SleepTime%
  187. Send, {Click, 570, 407} ; ANTT digitável
  188. Sleep, %SleepTime%
  189. send, %ANTT%
  190. Sleep, %SleepTime%
  191. Send, {Click, 629, 466} ; Tipo de proprietário droplist
  192. Sleep, %SleepTime%
  193. Loop, Parse, TipoPropri, `/
  194. {
  195.   Send, % A_LoopField
  196.   Sleep, 1000
  197. }
  198. send, {esc}
  199. sleep, 500
  200. Send, {Click, 731, 564} ; Endereço digitável
  201. Sleep, %SleepTime%
  202. send, %Endereço%
  203. Sleep, %SleepTime%
  204. Send, {Click, 991, 568} ; Bairro digitável
  205. Sleep, %SleepTime%
  206. send, %Bairro%
  207. Sleep, %SleepTime%
  208. send, {click, 560, 610} ; CEP
  209. Sleep, %SleepTime%
  210. send, %CEP%
  211. Sleep, %SleepTime%
  212. Send, {Click, 971, 614} ; UF droplist
  213. Sleep, %SleepTime%
  214. Loop, Parse, UF, `/
  215. {
  216.   Send, % A_LoopField
  217.   Sleep, 1000
  218. }
  219. send, {esc}
  220. sleep, 200
  221. Send, {Click, 569, 665} ; Telefone digitável
  222. Sleep, %SleepTime%
  223. send, %Telefone%
  224. Sleep, %SleepTime%
  225. send, {click, 795, 657} ; Telefone digitável
  226. Sleep, %SleepTime%
  227. send, %Telefone%
  228. Sleep, %SleepTime%
  229. send, {click, 577, 707}
  230. Sleep, %SleepTime%
  231. send, %Email%
  232. Sleep, %SleepTime%
  233. Send, {click, 696, 506} ; aba dados bancários
  234. Sleep, %SleepTime%
  235. send, {click, 609, 580} ; codigo banco
  236. Sleep, %SleepTime%
  237. Loop, Parse, CodBanco, `/
  238. {
  239.   Send, % A_LoopField
  240.   Sleep, 1000
  241. }
  242. loop, 5
  243. {
  244. send, {tab}
  245. sleep, 50
  246. }
  247. Sleep, %SleepTime%
  248. send, {click, 850, 575} ; agencia banco
  249. Sleep, %SleepTime%
  250. send, %Banco%
  251. sleep, %SleepTime%
  252. send, {click, 933, 577} ; codigo conta
  253. Sleep, %SleepTime%
  254. send, %NumConta%
  255. Sleep, %SleepTime%
  256. send, {click, 1342, 565} ; botao de favorecido puxado do cadastro de fornecedores
  257. Sleep, %SleepTime%
  258. send, {click, 652, 683} ; chave pix digitavel
  259. Sleep, %SleepTime%
  260. send, %ChavePix%
  261. Sleep, %SleepTime%
  262. if (TipoDaChave = 0)
  263. {
  264. Gosub, ChaveTipo1
  265. sleep, 100
  266. }
  267. else if (TipoDaChave = 1)
  268. {
  269. Gosub, ChaveTipo2
  270. sleep, 100
  271. }
  272. else if (TipoDaChave = 2)
  273. {
  274. Gosub, ChaveTipo3
  275. sleep, 100
  276. }
  277. else if (TipoDaChave = 3)
  278. {
  279. Gosub, ChaveTipo4
  280. sleep, 100
  281. }
  282. sleep, %SleepTime%
  283. if (TipoConta = 0)
  284. {
  285. Gosub, TipoConta1
  286. sleep, 100
  287. }
  288. else if (TipoConta = 1)
  289. {
  290. Gosub, TipoConta2
  291. sleep, 100
  292. }
  293. sleep, %SleepTime%
  294. send, {click, 563, 243}
  295. Sleep, 1200
  296. send, {space}
  297. sleep, 500
  298. send, {space}
  299. sleep, 500
  300. WinActivate, ahk_exe EXCEL.exe
  301. WinWaitActive, ahk_exe EXCEL.exe
  302. sleep, 250
  303. clipboard := "`r`n"
  304. sleep, 100
  305. send, ^{left}
  306. sleep, 50
  307. send, ^{left}
  308. sleep, 50
  309. send, ^{left}
  310. sleep, 50
  311. send, {down}
  312. }
  313. Return
  314.  
  315. *F3::
  316. loop
  317. {
  318. Gosub, CopiaDadosVeiculo
  319. WinActivate, ahk_exe DDSLogistica.exe
  320. WinWaitActive, ahk_exe DDSLogistica.exe
  321. sleep, 250
  322. If (Parar = 1)
  323. Break
  324. send, {click, 534, 291}
  325. sleep, 500
  326. SEND, {CLICK, 693, 355} ; PLACA
  327. Sleep, %SleepTime%
  328. send, %Placa%
  329. Sleep, %SleepTime%
  330. SEND, {CLICK, 972, 360} ; UF DROPLIST
  331. Sleep, %SleepTime%
  332. Loop, Parse, UF, `/
  333. {
  334.   Send, % A_LoopField
  335.   Sleep, 1000
  336. }
  337. send, {esc}
  338. sleep, 200
  339. SEND, {CLICK, 778, 410} ; PROPRIETÁRIO DROPLIST
  340. Sleep, %SleepTime%
  341. Loop, Parse, Proprietario, `/
  342. {
  343.   Send, % A_LoopField
  344.   Sleep, 1000
  345. }
  346. send, {esc}
  347. sleep, 200
  348. LOOP, 5
  349. {
  350. SEND, {TAB}
  351. SLEEP, 50
  352. }
  353. Sleep, %SleepTime%
  354. SEND, {CLICK, 932, 407} ; DISPONIVEL SEMPRE < DROPLIST
  355. Sleep, %SleepTime%
  356. send, {d}
  357. sleep, 200
  358. send, {esc}
  359. LOOP, 5
  360. {
  361. SEND, {TAB}
  362. SLEEP, 50
  363. }
  364. Sleep, %SleepTime%
  365. SEND, {CLICK, 634, 519} ; MARCA DO VEICULO < DROPLIST
  366. Sleep, %SleepTime%
  367. Loop, Parse, Marca, `/
  368. {
  369.   Send, % A_LoopField
  370.   Sleep, 1000
  371. }
  372. send, {esc}
  373. sleep, 200
  374. LOOP, 5
  375. {
  376. SEND, {TAB}
  377. SLEEP, 50
  378. }
  379. Sleep, %SleepTime%
  380. SEND, {CLICK, 934, 517} ; MODELO VEICULO < DROPLIST
  381. Sleep, %SleepTime%
  382. Loop, Parse, Modelo, `/
  383. {
  384.   Send, % A_LoopField
  385.   Sleep, 1000
  386. }
  387. send, {esc}
  388. sleep, 200
  389. LOOP, 5
  390. {
  391. SEND, {TAB}
  392. SLEEP, 50
  393. }
  394. Sleep, %SleepTime%
  395. SEND, {CLICK, 1187, 517} ; ANO FABRICATIONS < DROPLIST
  396. Sleep, %SleepTime%
  397. Loop, Parse, AnoFab, `/
  398. {
  399.   Send, % A_LoopField
  400.   Sleep, 1000
  401. }
  402. send, {esc}
  403. sleep, 200
  404. SEND, {CLICK, 1341, 516} ; ANO MODELO < DROPLIST
  405. Sleep, %SleepTime%
  406. Loop, Parse, AnoMod, `/
  407. {
  408.   Send, % A_LoopField
  409.   Sleep, 1000
  410. }
  411. send, {esc}
  412. sleep, 200
  413. SEND, {CLICK, 657, 568} ; tipo rodado < DROPLIST
  414. Sleep, %SleepTime%
  415. Loop, Parse, TipoRodado, `/
  416. {
  417.   Send, % A_LoopField
  418.   Sleep, 1000
  419. }
  420. send, {esc}
  421. sleep, 200
  422. LOOP, 5
  423. {
  424. SEND, {TAB}
  425. SLEEP, 50
  426. }
  427. Sleep, %SleepTime%
  428. SEND, {CLICK, 960, 568} ; tipo veículo (reboque tracao)< DROPLIST
  429. Sleep, %SleepTime%
  430. Loop, Parse, Reboque_Tracao, `/
  431. {
  432.   Send, % A_LoopField
  433.   Sleep, 1000
  434. }
  435. send, {esc}
  436. sleep, 200
  437. SEND, {CLICK, 730, 619} ; tipo carroceria (opções no txt) < DROPLIST
  438. Sleep, %SleepTime%
  439. Loop, Parse, TipoCarroceria, `/
  440. {
  441.   Send, % A_LoopField
  442.   Sleep, 1000
  443. }
  444. send, {esc}
  445. sleep, 200
  446. SEND, {CLICK, 596, 664} ; tara
  447. Sleep, %SleepTime%
  448. send, %Tara%
  449. Sleep, %SleepTime%
  450. SEND, {CLICK, 1184, 666} ;CAPACIDADE DA CARGA POR METRO CUBICO (M³)
  451. Sleep, %SleepTime%
  452. send, %CapacidadeCarga%
  453. sleep, 500
  454. send, {click, 610, 713} ;CHASSI
  455. Sleep, %SleepTime%
  456. SEND, %Chassi%
  457. Sleep, %SleepTime%
  458. send, {click, 1059, 716}
  459. Sleep, %SleepTime%
  460. SEND, %Renavam%
  461. Sleep, 300
  462. send, {click, 1114, 353}
  463. sleep, 300
  464. send, {click, 594, 289}
  465. sleep, 800
  466. send, {space}
  467. sleep, 500
  468. send, {space}
  469. sleep, 100
  470. WinActivate, ahk_exe EXCEL.exe
  471. WinWaitActive, ahk_exe EXCEL.exe
  472. sleep, 250
  473. clipboard := "`r`n"
  474. sleep, 100
  475. send, ^{left}
  476. sleep, 50
  477. send, ^{left}
  478. sleep, 50
  479. send, ^{left}
  480. sleep, 50
  481. send, {down}
  482. sleep, 100
  483. }
  484. Return
  485.  
  486. TipoConta1:
  487. send, {Click, 1070, 561} ;;Corrente
  488. Return
  489.  
  490. TipoConta2:
  491. send, {Click, 1165, 564} ;;poupança
  492. Return
  493.  
  494. ChaveTipo1:
  495. send, {click, 1080, 682};; celular
  496. Return
  497.  
  498. ChaveTipo2:
  499. send, {click, 1258, 682};; cpf ou cnpj
  500. return
  501.  
  502. ChaveTipo3:
  503. send, {click, 1080, 716};; chave aleatoria
  504. return
  505.  
  506. ChaveTipo4:
  507. send, {click, 1258, 716};; email
  508. return
  509.  
  510. CopiaDadosVeiculo:
  511. Clipboard := "`r`n"
  512. sleep, 200
  513. WinActivate, ahk_exe EXCEL.exe
  514. WinWaitActive, ahk_exe EXCEL.exe
  515. sleep, 150
  516. send, ^{c}
  517.     clipwait
  518.     sleep, 100
  519.     if (clipboard = "`r`n")
  520.     {
  521.      Parar := 1
  522.      }
  523. sleep, 150
  524.      Placa := RegExReplace( ClipBoard, "[\r\n\t]" )
  525.      sleep, 50
  526.      ClipBoard := "`r`n"
  527.      sleep, 150
  528.      send, {right}
  529.      sleep, 100
  530.      send, ^{c}
  531.      clipwait
  532.      sleep, 100
  533.      UF := ClipBoard
  534.      sleep, 50
  535.      ClipBoard := "`r`n"
  536.      sleep, 150
  537.      send, {right}
  538.      sleep, 100
  539.      send, ^{c}
  540.      clipwait
  541.      sleep, 100
  542.      Proprietario := ClipBoard
  543.      sleep, 50
  544.      ClipBoard := "`r`n"
  545.      sleep, 150
  546.      send, {right}
  547.      sleep, 100
  548.      send, ^{c}
  549.      clipwait
  550.      sleep, 100
  551.      Marca := ClipBoard
  552.      sleep, 50
  553.      ClipBoard := "`r`n"
  554.      sleep, 150
  555.      send, {right}
  556.      sleep, 100
  557.      send, ^{c}
  558.      clipwait
  559.      sleep, 100
  560.       Modelo := ClipBoard
  561.       sleep, 50
  562.       ClipBoard := "`r`n"
  563.       sleep, 150
  564.       send, {right}
  565.       sleep, 100
  566.       send, ^{c}
  567.       clipwait
  568.       sleep, 100
  569.        AnoFab := RegExReplace( ClipBoard, "[\r\n\t]" )
  570.        sleep, 150
  571.        ClipBoard := "`r`n"
  572.        sleep, 150
  573.        send, {right}
  574.        sleep, 100
  575.        send, ^{c}
  576.        clipwait
  577.        sleep, 100
  578.          AnoMod := ClipBoard
  579.          sleep, 50
  580.          ClipBoard := "`r`n"
  581.          sleep, 150
  582.           send, {right}
  583.          sleep, 100
  584.           send, ^{c}
  585.           clipwait
  586.           sleep, 100
  587.            TipoRodado := ClipBoard
  588.            sleep, 50
  589.            ClipBoard := "`r`n"
  590.            sleep, 150
  591.            send, {right}
  592.            sleep, 100
  593.            send, ^{c}
  594.            clipwait
  595.            sleep, 100
  596.            Reboque_Tracao := clipboard 
  597.             sleep, 50
  598.            ClipBoard := "`r`n"
  599.            sleep, 150
  600.            send, {right}
  601.            sleep, 100
  602.            send, ^{c}
  603.            clipwait
  604.            sleep, 100
  605.             TipoCarroceria := ClipBoard
  606.             sleep, 50
  607.             ClipBoard := "`r`n"
  608.               sleep, 150
  609.               send, {right}
  610.               sleep, 100
  611.            send, ^{c}
  612.            clipwait
  613.               sleep, 100
  614.                Tara := ClipBoard
  615.             sleep, 50
  616.             ClipBoard := "`r`n"
  617.               sleep, 150
  618.               send, {right}
  619.               sleep, 100
  620.            send, ^{c}
  621.            clipwait
  622.               sleep, 100
  623.                 CapacidadeCarga := ClipBoard
  624.             sleep, 50
  625.             ClipBoard := "`r`n"
  626.                sleep, 150
  627.                 send, {right}
  628.               sleep, 100
  629.            send, ^{c}
  630.            clipwait
  631.               sleep, 100
  632.                 Chassi := ClipBoard
  633.             sleep, 50
  634.             ClipBoard := "`r`n"
  635.                sleep, 150
  636.                  send, {right}
  637.               sleep, 100
  638.            send, ^{c}
  639.            clipwait
  640.               sleep, 100
  641.                 Renavam := ClipBoard
  642.             sleep, 50
  643.             ClipBoard := "`r`n"
  644.                sleep, 150
  645. return
  646.  
  647. *F4::
  648. loop
  649. {
  650. Gosub, CopiaDados_Motorista
  651. WinActivate, ahk_exe DDSLogistica.exe
  652. WinWaitActive, ahk_exe DDSLogistica.exe
  653. If (Parar = 1)
  654. Break
  655. sleep, 100
  656. send, {click, 458, 240}
  657. sleep, 200
  658. send, {click, 499, 436} ;;Aba dados pessoais
  659. sleep, 100
  660. send, {click, 637, 312} ;;Nome
  661. Sleep, %SleepTime%
  662. send, %Nome_Moto%
  663. Sleep, %SleepTime%
  664. send, {click, 756, 352} ;;Empresa filial origem
  665. Sleep, %SleepTime%
  666. send, {a}
  667. sleep, 100
  668. send, {esc}
  669. sleep, 250
  670. send, {click, 732, 403} ;;Departamento função
  671. Sleep, %SleepTime%
  672. loop, 15
  673. {
  674. send, {down}
  675. sleep, 50
  676. }
  677. send, {esc}
  678. Sleep, %SleepTime%
  679. send, {click, 520, 503} ;;Data_Nasci
  680. Sleep, %SleepTime%
  681. send, %Data_Nasci%
  682. Sleep, %SleepTime%
  683. send, {click, 645, 506} ;;CPF
  684. Sleep, %SleepTime%
  685. send, %CPF%
  686. Sleep, %SleepTime%
  687. send, {click, 807, 504} ;;RG
  688. Sleep, %SleepTime%
  689. send, %RG%
  690. Sleep, %SleepTime%
  691. send, {click, 533, 740} ;;Endereço
  692. Sleep, %SleepTime%
  693. send, %Endereco%
  694. Sleep, %SleepTime%
  695. send, {click, 1062, 741} ;;Bairro
  696. Sleep, %SleepTime%
  697. send, %Bairro%
  698. Sleep, %SleepTime%
  699. send, {click, 598, 789} ;;Cidade
  700. Sleep, %SleepTime%
  701. send, %Cidade%
  702. Sleep, %SleepTime%
  703. send, {click, 895, 787} ;;UF
  704. Sleep, %SleepTime%
  705. Loop, Parse, UF, `/
  706. {
  707.   Send, % A_LoopField
  708.   Sleep, 1000
  709. }
  710. send, {esc}
  711. sleep, 250
  712. send, {click, 634, 437} ;;dados espec
  713. Sleep, %SleepTime%
  714. send, {click, 563, 493} ;;CNH
  715. Sleep, %SleepTime%
  716. send, %CNH%
  717. Sleep, %SleepTime%
  718. send, {click, 527, 543} ;;Placa
  719. Sleep, %SleepTime%
  720. Loop, Parse, Placa_Moto, `/
  721. {
  722.   Send, % A_LoopField
  723.   Sleep, 1000
  724. }
  725. send, {esc}
  726. sleep, 250
  727. send, {click, 488, 244}
  728. sleep, 250
  729. loop, 3
  730. {
  731. send, {enter}
  732. sleep, 500
  733. }
  734. return
  735.  
  736. CopiaDados_Motorista:
  737. Clipboard := "`r`n"
  738. WinActivate, ahk_exe EXCEL.exe
  739. WinWaitActive, ahk_exe EXCEL.exe
  740. sleep, 100
  741. send, ^{c}
  742.     clipwait
  743.     sleep, 100
  744.     if (clipboard = "`r`n")
  745.     {
  746.      Parar := 1
  747.      }
  748. sleep, 150
  749.      Nome_Moto := RegExReplace( ClipBoard, "[\r\n\t]" )
  750.      sleep, 50
  751.      ClipBoard := "`r`n"
  752.      sleep, 150
  753.      send, {right}
  754.      sleep, 100
  755.      send, ^{c}
  756.      clipwait
  757.      sleep, 100
  758.      Data_Nasci := ClipBoard
  759.      sleep, 50
  760.      ClipBoard := "`r`n"
  761.      sleep, 150
  762.      send, {right}
  763.      sleep, 100
  764.      send, ^{c}
  765.      clipwait
  766.      sleep, 100
  767.      CPF := ClipBoard
  768.      sleep, 50
  769.      ClipBoard := "`r`n"
  770.      sleep, 150
  771.      send, {right}
  772.      sleep, 100
  773.      send, ^{c}
  774.      clipwait
  775.      sleep, 100
  776.      RG := ClipBoard
  777.      sleep, 50
  778.      ClipBoard := "`r`n"
  779.      sleep, 150
  780.      send, {right}
  781.      sleep, 100
  782.      send, ^{c}
  783.      clipwait
  784.      sleep, 100
  785.       Endereco := ClipBoard
  786.       sleep, 50
  787.       ClipBoard := "`r`n"
  788.       sleep, 150
  789.       send, {right}
  790.       sleep, 100
  791.       send, ^{c}
  792.       clipwait
  793.       sleep, 100
  794.        Bairro := RegExReplace( ClipBoard, "[\r\n\t]" )
  795.        sleep, 150
  796.        ClipBoard := "`r`n"
  797.        sleep, 150
  798.        send, {right}
  799.        sleep, 100
  800.        send, ^{c}
  801.        clipwait
  802.        sleep, 100
  803.          Cidade := ClipBoard
  804.          sleep, 50
  805.          ClipBoard := "`r`n"
  806.          sleep, 150
  807.           send, {right}
  808.          sleep, 100
  809.           send, ^{c}
  810.           clipwait
  811.           sleep, 100
  812.            UF := ClipBoard
  813.            sleep, 50
  814.            ClipBoard := "`r`n"
  815.            sleep, 150
  816.            send, {right}
  817.            sleep, 100
  818.            send, ^{c}
  819.            clipwait
  820.            sleep, 100
  821.            CNH := clipboard
  822.             sleep, 50
  823.            ClipBoard := "`r`n"
  824.            sleep, 150
  825.            send, {right}
  826.            sleep, 100
  827.            send, ^{c}
  828.            clipwait
  829.            sleep, 100
  830.            Placa_Moto := clipboard 
  831.             sleep, 50
  832.            ClipBoard := "`r`n"
  833. }
  834. return
  835.  
  836. CopiaDados:
  837. WinActivate, ahk_exe EXCEL.exe
  838. WinWaitActive, ahk_exe EXCEL.exe
  839. sleep, 100
  840. send, ^{c}
  841.     clipwait
  842.     sleep, 100
  843.     if (clipboard = "`r`n")
  844.     {
  845.      Parar := 1
  846.      }
  847. sleep, 150
  848.      NomePropri := RegExReplace( ClipBoard, "[\r\n\t]" )
  849.      sleep, 50
  850.      ClipBoard := "`r`n"
  851.      sleep, 150
  852.      send, {right}
  853.      sleep, 100
  854.      send, ^{c}
  855.      clipwait
  856.      sleep, 100
  857.      Cpf_Cnpj := ClipBoard
  858.      sleep, 50
  859.      ClipBoard := "`r`n"
  860.      sleep, 150
  861.      send, {right}
  862.      sleep, 100
  863.      send, ^{c}
  864.      clipwait
  865.      sleep, 100
  866.      Data := ClipBoard
  867.      sleep, 50
  868.      ClipBoard := "`r`n"
  869.      sleep, 150
  870.      send, {right}
  871.      sleep, 100
  872.      send, ^{c}
  873.      clipwait
  874.      sleep, 100
  875.      RG := ClipBoard
  876.      sleep, 50
  877.      ClipBoard := "`r`n"
  878.      sleep, 150
  879.      send, {right}
  880.      sleep, 100
  881.      send, ^{c}
  882.      clipwait
  883.      sleep, 100
  884.       ANTT := ClipBoard
  885.       sleep, 50
  886.       ClipBoard := "`r`n"
  887.       sleep, 150
  888.       send, {right}
  889.       sleep, 100
  890.       send, ^{c}
  891.       clipwait
  892.       sleep, 100
  893.        TipoPropri := RegExReplace( ClipBoard, "[\r\n\t]" )
  894.        sleep, 150
  895.        ClipBoard := "`r`n"
  896.        sleep, 150
  897.        send, {right}
  898.        sleep, 100
  899.        send, ^{c}
  900.        clipwait
  901.        sleep, 100
  902.          Endereço := ClipBoard
  903.          sleep, 50
  904.          ClipBoard := "`r`n"
  905.          sleep, 150
  906.           send, {right}
  907.          sleep, 100
  908.           send, ^{c}
  909.           clipwait
  910.           sleep, 100
  911.            Bairro := ClipBoard
  912.            sleep, 50
  913.            ClipBoard := "`r`n"
  914.            sleep, 150
  915.            send, {right}
  916.            sleep, 100
  917.            send, ^{c}
  918.            clipwait
  919.            sleep, 100
  920.            CEP := clipboard
  921.             sleep, 50
  922.            ClipBoard := "`r`n"
  923.            sleep, 150
  924.            send, {right}
  925.            sleep, 100
  926.            send, ^{c}
  927.            clipwait
  928.            sleep, 100
  929.             UF := ClipBoard
  930.             sleep, 50
  931.             ClipBoard := "`r`n"
  932.               sleep, 150
  933.               send, {right}
  934.               sleep, 100
  935.            send, ^{c}
  936.            clipwait
  937.               sleep, 100
  938.                Telefone := ClipBoard
  939.             sleep, 50
  940.             ClipBoard := "`r`n"
  941.               sleep, 150
  942.               send, {right}
  943.               sleep, 100
  944.            send, ^{c}
  945.            clipwait
  946.               sleep, 100
  947.                 CodBanco := ClipBoard
  948.             sleep, 50
  949.             ClipBoard := "`r`n"
  950.               sleep, 150
  951.               send, {right}
  952.               sleep, 100
  953.            send, ^{c}
  954.            clipwait
  955.               sleep, 100
  956.                 Banco := ClipBoard
  957.             sleep, 50
  958.             ClipBoard := "`r`n"
  959.               sleep, 150
  960.               send, {right}
  961.               sleep, 100
  962.            send, ^{c}
  963.            clipwait
  964.               sleep, 100
  965.                  NumConta := RegExReplace( ClipBoard, "[\r\n\t]" )
  966.             sleep, 50
  967.             ClipBoard := "`r`n"
  968.               sleep, 150
  969.               send, {right}
  970.                 sleep, 100
  971.            send, ^{c}
  972.            clipwait
  973.               sleep, 100
  974.                  ChavePix := ClipBoard
  975.             sleep, 50
  976.             ClipBoard := "`r`n"
  977.               sleep, 150
  978.               send, {right}
  979.               sleep, 50
  980.               send, ^{c}
  981.            clipwait
  982.               sleep, 100
  983.                TipoDaChave := RegExReplace( ClipBoard, "[\r\n\t]" )
  984.             sleep, 50
  985.             ClipBoard := "`r`n"
  986.               sleep, 150
  987.               send, {right}
  988.               sleep, 100
  989.            send, ^{c}
  990.            clipwait
  991.               sleep, 100
  992.                TipoConta := RegExReplace( ClipBoard, "[\r\n\t]" )
  993.             sleep, 50
  994.             ClipBoard := "`r`n"
  995.               sleep, 100
  996.                send, {right}
  997.               sleep, 100
  998.            send, ^{c}
  999.            clipwait
  1000.               sleep, 100
  1001.                Email := clipboard
  1002.                sleep, 150
  1003. return
  1004.  
  1005. ColarNoDDS:
  1006. {
  1007. DadoDivergente := 0
  1008. WinActivate, ahk_exe DDSLogistica.exe
  1009. WinWaitActive, ahk_exe DDSLogistica.exe
  1010. sleep, 150
  1011. send, {click, 365, 143}
  1012. sleep, 200
  1013. send, {click, 397, 321}
  1014. sleep, 100
  1015. send, {click, 485, 206}
  1016. sleep, 80
  1017. send, %Favorecido%
  1018. sleep, 100
  1019. send, {click, 788, 203, 2}
  1020. sleep, 50
  1021. send, {n}
  1022. sleep, 50
  1023. send, {esc}
  1024. sleep, 50
  1025. send, {click, 415, 245}
  1026. sleep, 150
  1027. send, %CPFouCNPJ%
  1028. sleep, 1000
  1029. send, {click, 431, 372}
  1030. sleep, 150
  1031. send, %Favorecido%
  1032. sleep, 500
  1033. send, {click, 573, 246}
  1034. sleep, 150
  1035. send, ISENTO
  1036. IfWinNotExist, ahk_exe DDSLogistica.exe
  1037. {
  1038. Msgbox, DDS Fatal error (SQL)
  1039. Reload
  1040. }
  1041. sleep, 1000
  1042. send, {click, 732, 451, 2}
  1043. sleep, 150
  1044. Loop, Parse, UF, `/
  1045. {
  1046.   Send, % A_LoopField
  1047.   Sleep, 400
  1048. }
  1049. sleep, 400
  1050. send, {esc}
  1051. sleep, 50
  1052. send, {click, 650, 320}
  1053. sleep, 250
  1054. IfWinNotExist, ahk_exe DDSLogistica.exe
  1055. {
  1056. Msgbox, DDS Fatal error (SQL)
  1057. Reload
  1058. }
  1059. loop
  1060. {
  1061.   CoordMode, Pixel, Relative
  1062.   PixelSearch, X, Y, 398, 548, 441, 558, 0x6B86BC, 10, Fast RGB
  1063.   if errorlevel = 0
  1064.   break
  1065. }
  1066. sleep, 100
  1067. send, {click, 463, 469}
  1068. sleep, 100
  1069. Loop, Parse, NumeroBanco, `/
  1070. {
  1071.   Send, % A_LoopField
  1072.   Sleep, 250
  1073. }
  1074. sleep, 100
  1075. send, {Esc}
  1076. sleep, 100
  1077. send, {click, 689, 474}
  1078. sleep, 100
  1079. send,  %NumAgencia%
  1080. sleep, 100
  1081. send, {click, 810, 473}
  1082. sleep, 100
  1083. send, %NumConta%
  1084. sleep, 100
  1085. send, {click, 600, 518}
  1086. sleep, 80
  1087. send, %Favorecido%
  1088. sleep, 100
  1089. send, {click, 831, 512}
  1090. sleep, 80
  1091. send, %CPFouCNPJ%
  1092. sleep, 100
  1093. if (TipoDaChave = 0)
  1094. {
  1095. send, {click, 387, 552}
  1096. }
  1097. else if (TipoDaChave = 1)
  1098. {
  1099. Gosub, TipoChave1
  1100. }
  1101. else if (TipoDaChave = 2)
  1102. {
  1103. Gosub, TipoChave2
  1104. }
  1105. else if TipoDaChave = 3
  1106. {
  1107. Gosub, TipoChave3
  1108. }
  1109. sleep, 1000
  1110. send, {click, 622, 560}
  1111. sleep, 80
  1112. send, %ChavePix%
  1113. sleep, 100
  1114. send, {click, 907, 469}
  1115. sleep, 100
  1116. send, {click, 436, 150}
  1117. sleep, 1000
  1118. loop
  1119. {
  1120.   CoordMode, Pixel, Relative
  1121.   PixelSearch, X, Y, 28, 55, 60, 84, 0x108DDC, 2, Fast RGB
  1122.   if errorlevel = 0
  1123.   {
  1124.                      sleep, 100
  1125.                      send, {space}
  1126.                      sleep, 1000
  1127.                      
  1128.   break
  1129.  }
  1130.   else if errorlevel = 1
  1131. {
  1132.   CoordMode, Pixel, Relative
  1133.   PixelSearch, X, Y, 26, 57, 62, 89, 0xFEC700, 2, Fast RGB
  1134.   if errorlevel = 0
  1135. {
  1136.                      sleep, 100
  1137.                      gosub, Dado_Divergente
  1138.               WinActivate, ahk_exe DDSLogistica.exe
  1139.               WinWaitActive, ahk_exe DDSLogistica.exe
  1140.                      sleep, 150
  1141.                      send, {space}
  1142.                      sleep, 150
  1143.                      DadoDivergente := 1
  1144.   break
  1145. }
  1146. }
  1147. }
  1148. if (DadoDivergente = 0)
  1149. sleep, 2000
  1150. loop
  1151. {
  1152.   CoordMode, Pixel, Relative
  1153.   PixelSearch, X, Y, 28, 55, 60, 84, 0xDE480C, 2, Fast RGB
  1154.   if errorlevel = 0
  1155. {
  1156.                      sleep, 100
  1157.                      gosub, Fornecedor_cadastrado_anteriormente
  1158.               WinActivate, ahk_exe DDSLogistica.exe
  1159.               WinWaitActive, ahk_exe DDSLogistica.exe
  1160.                      sleep, 150
  1161.                      send, {space}
  1162.                      sleep, 150
  1163.   break
  1164. }
  1165. else if errorlevel = 1
  1166. {
  1167.   CoordMode, Pixel, Relative
  1168.   PixelSearch, X, Y, 28, 55, 60, 84, 0x108DDC, 2, Fast RGB
  1169.   if errorlevel = 0
  1170.                      sleep, 100
  1171.                      send, {space}
  1172.                      sleep, 200
  1173.   break
  1174. }
  1175. }
  1176. send, {click, 365, 143}
  1177. sleep, 500
  1178. }
  1179. Return
  1180.  
  1181. Fornecedor_cadastrado_anteriormente:
  1182. {
  1183.                   WinActivate, ahk_exe EXCEL.exe
  1184.                   WinWaitActive, ahk_exe EXCEL.exe
  1185.                    sleep, 150
  1186. send, Fornecedor já cadastrado ou dados repetidos
  1187. sleep, 250
  1188. }
  1189. return
  1190.  
  1191. Dado_Divergente:
  1192. {
  1193.  WinActivate, ahk_exe EXCEL.exe
  1194.                   WinWaitActive, ahk_exe EXCEL.exe
  1195.                    sleep, 150
  1196. send, Dado divergente (provavelmente o CPF/CNPJ)
  1197. }
  1198. return
  1199.  
  1200.  
  1201. TipoChave1:
  1202. Send, {click, 386, 575}
  1203. return
  1204.  
  1205. TipoChave2:
  1206. Send, {click, 389, 591}
  1207. return
  1208.  
  1209. TipoChave3:
  1210. Send, {click, 388, 615}
  1211. return
  1212.  
  1213. ProcessExist(name)
  1214. {
  1215.     Process, Exist, %name%
  1216.         return Errorlevel
  1217. }
  1218. return
  1219.  
  1220.  
  1221. *F6::
  1222. ExitApp
  1223. Return
  1224.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement