Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #SingleInstance force
- Path := "C:\Users\paulo\OneDrive\Documents\Robo\CADASTROS LOGÍSTICS.xlsx"
- XL := ComObjCreate("Excel.Application")
- XL.Visible := true
- XL_Workbook := XL.Workbooks.Open(Path)
- XL_WorkSheet := XL_Workbook.Worksheets(1) ; Numero da sheet
- *F1::
- loop
- {
- WinGetTitle, Title, A
- XL.ActiveCell.Copy
- ClipWait
- sleep, 150
- if (Clipboard = "`r`n")
- {
- sleep, 50
- XL.Visible := true
- DllCall("user32.dll\LockWorkStation")
- Return
- }
- ControlClick, x357 y348, %Title%,, Left, 2, NA
- sleep, 50
- send, ^{a}
- sleep, 50
- send, ^{v}
- sleep, 50
- send, {enter}
- sleep, 20
- Loop
- {
- CoordMode, Pixel, Relative
- PixelSearch, X, Y, 1598, 102, 1851, 840, 0x3483FA , 5, Fast RGB
- if errorlevel = 1
- break
- }
- Loop
- {
- CoordMode, Pixel, Relative
- PixelSearch, X, Y, 1598, 102, 1851, 840, 0x3483FA, 5, Fast RGB
- if errorlevel = 0
- break
- }
- sleep, 50
- CoordMode, Pixel, Relative
- PixelSearch, X, Y, 213, 529, 277, 584, 0x3A3A3A, 5, Fast RGB
- if (errorlevel = 0)
- {
- sleep, 350
- ControlClick, x1817 y557, %Title%,, Left, 1, NA
- sleep, 150
- send, {LCTRL down}
- sleep, 50
- ControlClick, x1648 y658, %Title%,, Left, 1, NA
- sleep, 350
- send, {2}
- send, {LCTRL Up}
- sleep, 1000
- loop
- {
- CoordMode, Pixel, Relative
- PixelSearch, X, Y, 1345, 1027, 1452, 1063, 0x3483FA, 5, Fast RGB
- if errorlevel = 1
- break
- }
- WinGetTitle, Title, A
- send, {WheelDown}
- sleep, 50
- send, {WheelDown}
- sleep, 800
- ControlClick, x954 y956, %Title%,, Left, 3, NA
- sleep, 200
- send ^{c}
- ClipWait
- sleep, 50
- CadastroDOC := Clipboard
- sleep, 150
- if (CadastroDOC != "Modelo")
- {
- XL.ActiveCell.Offset(0, 1).PasteSpecial Paste:= CadastroDOC
- ControlClick, x584 y956, %Title%,, Left, 3, NA
- sleep, 200
- send ^{c}
- ClipWait
- sleep, 50
- Fabricante := Clipboard
- sleep, 250
- XL.ActiveCell.Offset(0, 1).PasteSpecial Paste:= Fabricante
- ControlClick, x1294 y956, %Title%,, Left, 3, NA
- sleep, 200
- send ^{c}
- ClipWait
- sleep, 50
- Ano := Clipboard
- sleep, 250
- XL.ActiveCell.Offset(0, 1).PasteSpecial Paste:= Ano
- ControlClick, x1260 y1065, %Title%,, Left, 3, NA
- sleep, 200
- send ^{c}
- ClipWait
- sleep, 50
- Eixos := Clipboard
- sleep, 250
- XL.ActiveCell.Offset(0, 1).PasteSpecial Paste:= Eixos
- ControlClick, x599 y810, %Title%,, Left, 3, NA
- sleep, 200
- send ^{c}
- ClipWait
- sleep, 50
- Renavam := Clipboard
- sleep, 250
- XL.ActiveCell.Offset(0, 1).PasteSpecial Paste:= Renavam
- ControlClick, x1073 y816, %Title%,, Left, 3, NA
- sleep, 200
- send ^{c}
- ClipWait
- sleep, 50
- Cidade := Clipboard
- sleep, 250
- XL.ActiveCell.Offset(0, 1).PasteSpecial Paste:= Cidade
- ControlClick, x1078 y693, %Title%,, Left, 3, NA
- sleep, 200
- send ^{c}
- ClipWait
- sleep, 50
- Chassi := Clipboard
- sleep, 250
- XL.ActiveCell.Offset(0, 1).PasteSpecial Paste:= Chassi
- sleep, 30
- Send, ^{w}
- XL.ActiveCell.Offset(1, -7).Select
- XL.ActiveCell.Interior.Color := 0x97DBED
- sleep, 200
- CadastroDOC := "`r`n"
- Fabricante := "`r`n"
- Ano := "`r`n"
- Eixos := "`r`n"
- Renavam := "`r`n"
- Cidade := "`r`n"
- Chassi := "`r`n"
- sleep, 200
- }
- else if (CadastroDOCs = "Modelo")
- {
- XL.ActiveCell.Offset(1, 0).Select
- }
- }
- else if (errorlevel = 1)
- {
- XL.ActiveCell.Offset(1, 0).Select
- }
- }
- Return
- *!z::
- WinGetTitle, Title, A
- loop
- {
- XL.ActiveCell.Copy
- ClipWait
- sleep, 150
- if (Clipboard = "`r`n")
- {
- sleep, 50
- XL.Visible := true
- DllCall("user32.dll\LockWorkStation")
- Return
- }
- ControlClick, x340 y346, %Title%,, Left, 2, NA
- sleep, 50
- send, ^{a}
- sleep, 50
- send, ^{v}
- sleep, 50
- send, {enter}
- sleep, 50
- Clipboard := "`r`n"
- sleep, 20
- Loop
- {
- CoordMode, Pixel, Relative
- PixelSearch, X, Y, 1598, 102, 1851, 840, 0x3483FA , 5, Fast RGB
- if errorlevel = 1
- break
- }
- Loop
- {
- CoordMode, Pixel, Relative
- PixelSearch, X, Y, 1598, 102, 1851, 840, 0x3483FA , 5, Fast RGB
- if errorlevel = 0
- break
- }
- sleep, 600
- ControlClick, x331 y574, %Title%,, Left, 3, NA
- sleep, 400
- send, ^{c}
- ClipWait
- sleep, 250
- XL.ActiveCell.Interior.Color := 0x97DBED
- XL.ActiveCell.Offset(0, 1).PasteSpecial Paste:= TipoRodado
- sleep, 100
- XL.ActiveCell.Offset(1, -1).Select
- sleep, 200
- TipoRodado := "`r`n"
- }
- return
- *F4::
- Gosub, AbrirLista
- loop
- {
- AchouMotora := 0
- XL.ActiveCell.Copy
- ClipWait
- if (Clipboard = "`r`n")
- Break
- NomeMotora := ClipBoard
- sleep, 80
- WinActivate, ahk_exe msedge.exe
- WinWaitActive, ahk_exe msedge.exe
- sleep, 150
- send, {F3}
- sleep, 250
- send, %NomeMotora%
- sleep, 2500
- loop, 10
- {
- CoordMode, Pixel, Relative
- PixelSearch, X, Y, -972, 69, -659, 751, 0xFF9632 , 0, Fast RGB
- if (errorlevel = 0)
- {
- AchouMotora := 1
- X2 := X+1624
- Y2 := Y+26
- send, {click, %X2%, %Y2%}
- sleep, 300
- MouseGetPos, XButton, YButton
- sleep, 50
- XAtivar := XButton-162
- YAtivar := YButton+102
- XDesativar := XButton-141
- YDesativar := YButton+160
- PerfilX := XButton-162
- PerfilY := YButton+50
- sleep, 250
- send, ^{click, %PerfilX%, %PerfilY%}
- sleep, 1000
- send, ^{2}
- sleep, 500
- loop
- {
- CoordMode, Pixel, Relative
- PixelSearch, X, Y, 412, 279, 677, 311, 0x171717 , 5, Fast RGB
- if (errorlevel = 0)
- {
- break
- }
- else if (errorlevel = 1)
- {
- send, ^{2}
- sleep, 500
- }
- }
- sleep, 500
- CoordMode, Pixel, Relative
- PixelSearch, X, Y, 410, 332, 1071, 429, 0xF23D4F , 5, Fast RGB
- if (errorlevel = 1)
- {
- sleep, 1200
- WinGetTitle, Title, A
- Controlclick, x1483 y366, %Title%,, Left, 2, NA
- sleep, 50
- ControlClick, x1057 y545, %Title%,, Left, 3, NA
- sleep, 50
- send, ^{c}
- clipwait
- sleep, 100
- IdMotora := ClipBoard
- sleep, 150
- XL.ActiveCell.Offset(0, 1).PasteSpecial Paste:= IdMotora
- ControlClick, x529 y535, %Title%,, Left, 3, NA
- sleep, 50
- send, ^{c}
- clipwait
- sleep, 100
- CPF := ClipBoard
- sleep, 150
- XL.ActiveCell.Offset(0, 1).PasteSpecial Paste:= CPF
- ControlClick, x562 y641, %Title%,, Left, 3, NA
- sleep, 50
- send, ^{c}
- clipwait
- sleep, 100
- Telefone := ClipBoard
- sleep, 150
- XL.ActiveCell.Offset(0, 1).PasteSpecial Paste:= Telefone
- ControlClick, x1137 y641, %Title%,, Left, 3, NA
- sleep, 50
- send, ^{c}
- clipwait
- sleep, 100
- Email := ClipBoard
- sleep, 150
- XL.ActiveCell.Offset(0, 1).PasteSpecial Paste:= Email
- sleep, 100
- ControlClick, x556 y781, %Title%,, Left, 2, NA
- sleep, 50
- send, ^{c}
- clipwait
- sleep, 100
- StatusMotora := ClipBoard
- sleep, 150
- XL.ActiveCell.Offset(0, 1).PasteSpecial Paste:= StatusMotora
- ControlClick, x605 y808, %Title%,, Left, 3, NA
- sleep, 50
- send, ^{c}
- clipwait
- sleep, 100
- DataCadastro := ClipBoard
- sleep, 150
- XL.ActiveCell.Offset(0, 1).PasteSpecial Paste:= DataCadastro
- send, ^{w}
- sleep, 250
- XL.ActiveCell.OffSet(1, -6).Activate
- sleep, 50
- NomeMotora := "`r`n"
- IdMotora := "`r`n"
- CPF := "`r`n"
- Telefone := "`r`n"
- Email := "`r`n"
- StatusMotora := "`r`n"
- DataCadastro := "`r`n"
- break
- }
- if (errorlevel = 0)
- {
- XL.ActiveCell.Offset(1, 0).Select
- }
- }
- else if (errorlevel = 1)
- {
- send, {wheeldown}
- sleep, 50
- send, {wheeldown}
- sleep, 50
- send, {wheeldown}
- sleep, 50
- send, {wheeldown}
- sleep, 500
- }
- }
- }
- Return
- ;;inativar placas
- *f8::
- WinGetTitle, Title, A
- loop
- {
- XL.ActiveCell.Copy
- ClipWait
- sleep, 150
- if (Clipboard = "`r`n")
- {
- sleep, 50
- XL.Visible := true
- DllCall("user32.dll\LockWorkStation")
- Return
- }
- ControlClick, x340 y346, %Title%,, Left, 2, NA
- sleep, 50
- send, ^{a}
- sleep, 50
- send, ^{v}
- sleep, 50
- send, {enter}
- sleep, 50
- Clipboard := "`r`n"
- sleep, 500
- Loop
- {
- CoordMode, Pixel, Relative
- PixelSearch, X, Y, 1598, 102, 1851, 840, 0x3483FA , 5, Fast RGB
- if errorlevel = 0
- break
- }
- sleep, 350
- ControlClick, x1818 y556, %Title%,, Left, 1, NA
- sleep, 100
- ControlClick, x1660 y725, %Title%,, Left, 1, NA
- sleep, 100
- XL.ActiveCell.Interior.Color := 0x97DBED
- sleep, 20
- XL.ActiveCell.Offset(1, 0).Select
- sleep, 200
- }
- return
- AbrirLista:
- WinActivate, ahk_exe msedge.exe
- WinWaitActive, ahk_exe msedge.exe
- sleep, 150
- send, {F3}
- sleep, 100
- send, Mostrar
- sleep, 1200
- send, {click, 83, 907}
- sleep, 150
- loop, 30
- {
- Send, {click, 967, 981}
- sleep, 200
- }
- Return
- *F6::
- Pause
- Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement