Você está na página 1de 44

#NoEnv

SendMode Input ; Recommended for new scripts due to its superior speed and
reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance force
#MaxThreadsPerHotkey 2 ; ------------->>> possibilitar dar reload no script
enquanto está rodando

global IBM_WIN32_NAME := "ahk_exe qws3270s.exe"


global IBM_WIN32_NAME_Opcao2 := "ahk_exe qws3270x.exe"

global Endereco_Arquivo := "D:\IBM_NaoApagar.txt"


global Endereco_Arquivo2 := "D:\IBM_NaoApagar_Auxilio1.txt"
global Endereco_Arquivo3 := "D:\IBM_Parciais_Consulta_Pendencia_OTS.txt"

global AcaoRapida_2_1 := "Login"


global AcaoRapida_2_2 := "Consulta_Tronco_CFM"
global AcaoRapida_2_3 := "Consulta_Agrupamento_CFM"
global AcaoRapida_2_4 := "Consulta_Endereco_CFM"
global AcaoRapida_2_5 := "Consulta_Estacao_CFM"

; usado em FILTROS WFBR


global cStatus := ["1181", "205"]
global cEmpresa := ["991", "208"]
global cTecnologia := ["768", "229"]
global cCM := ["329", "230"]
global cProcurar := ["321", "264"]

; variaveis globais
global PVT =
global Matricula_PVT =
global Codigo_Servico =
global Servico =

DriveGet, DriverList, list


if DriverList contains D
{
FileReadLine, Usuario, %Endereco_Arquivo%, 1
if (Usuario == "") ; EmptyFile
{
inputbox, Senha, Primeira Senha, Coloque a sua senha do IBM aqui.. Essa
é a sua primeira vez no IBM Simples.,,200,200
file1 := FileOpen(Endereco_Arquivo, "a") ; append
file1.Write("Login:" A_UserName "`r`n")
file1.Write("Senha:" Senha "`r`n")
file1.Write("Perfil:CFS`r`n")
file1.Close()
}
}
else
{
msgbox, `nVocê não deve utilizar as funções de login ou de gravação de senha
pois não possui disco "D".
}

;~ tooltip, Obrigado por utilizar o IBM Simples 1.0!`n`n©RAFACN - Rafael Carneiro


Nascimento, 400,400
;~ sleep 3000
;~ tooltip,

;~ msgbox, Para chamar o IBM Simples aperte a tecla (Windows + F1)!

;~ FileReadLine, linha_Usuario, D:\IBM_NaoApagar.txt, 1


;~ FileReadLine, linha_Senha, D:\IBM_NaoApagar.txt, 2
;~ FileReadLine, linha_Perfil, D:\IBM_NaoApagar.txt, 3

;~ StringReplace, Usuario, linha_Usuario, Login:,, All ; a ser usado no login


;~ if (SenhaIBM == "") ; Não utiliza senha posteriormente gravada se não for
escrito nada no campo
;~ StringReplace, Senha, linha_Senha, Senha:,, All ; a ser usado no login ;
sobrescrito no OK
;~ StringReplace, Perfil, linha_Perfil, Perfil:,, All ; Utilizado na GUI;
sobrescrito na GUI.

;~ file := FileOpen("D:\IBM_NaoApagar.txt", "w") ; write


;~ file.Write("Login:" A_UserName "`r`n")
;~ file.Write("Senha:" Senha "`r`n")
;~ file.Write("Perfil:CFS`r`n")
;~ file.Close()

guiTelaInicial()
{

gui, font, s%f_size%


Gui, Color, 000000, 000000

;~ Gui, Gui1:Add, Text,, Text for about-box.


Gui, Font, S%f_size% cYellow Bold, Arial ; x
Gui, Add, Text,, Ação IBM:
Gui, Font, S%f_size% cBlack Normal, Arial

Gui, Font, S%f_size% cRed Normal Arial


Gui, Add, ListBox, vMyListBox gMyListBox w340 r31
GuiControl,, MyListBox, Alteracao_Config_Fac_CFM
GuiControl,, MyListBox, Alteracao_Informacoes_Tronco_CFM
GuiControl,, MyListBox, Alteracao_Fac_Sem_Emissao_CFM
GuiControl,, MyListBox, Alteracao_Nivel_Fac_CFM
GuiControl,, MyListBox, Alteracao_T&C_Dados_CFM
GuiControl,, MyListBox, Associar_Designacao_Servico_CFM
GuiControl,, MyListBox, Ativacao_Troncos_Acesso_CFM
GuiControl,, MyListBox, Ativacao_Troncos_Servico_CFM
GuiControl,, MyListBox, Cancelamento_Item_OTS_CFM
GuiControl,, MyListBox, Consulta_Agrupamento_CFM ;
GuiControl,, MyListBox, Consulta_Bandas_Estacao_CFM
GuiControl,, MyListBox, Consulta_Degrau_COM
GuiControl,, MyListBox, Consulta_Endereco_CFM ;
GuiControl,, MyListBox, Consulta_Estacao_CFM ;
GuiControl,, MyListBox, Consulta_Execucao_OTS
GuiControl,, MyListBox, Consulta_Facilidades_Vagas_CFM
GuiControl,, MyListBox, Consulta_OTS_CFM
GuiControl,, MyListBox, Consulta_OTS_CFM_2
GuiControl,, MyListBox, Consulta_OTS_PorCliente_CFM
GuiControl,, MyListBox, Consulta_OTS_Retornada_CFM
GuiControl,, MyListBox, Consulta_OTS_Pendentes_Fechamento
GuiControl,, MyListBox, Consulta_Pendencia_OTS
GuiControl,, MyListBox, Consulta_Por_Capacidade_Por_Estacao_CFM
GuiControl,, MyListBox, Consulta_Tronco_CFM ;
GuiControl,, MyListBox, Desassociar_Designacao_Servico_CFM
GuiControl,, MyListBox, Desativacao_Troncos_CFM
GuiControl,, MyListBox, Fechamento_OTS_CFM
GuiControl,, MyListBox, Inclusao_Estacao_CFM
;~ GuiControl,, MyListBox, Login
GuiControl,, MyListBox, OTS_Radio_CFM
GuiControl,, MyListBox, Reserva_Fac_CFM
GuiControl,, MyListBox, Retorna_OTS_CFM
Gui, Font, S%f_size% cBlack Normal, Arial

tamanho_listbox := 33*14
posicionamento_1 := tamanho_listbox + 1
posicionamento_2 := tamanho_listbox + 20
posicionamento_3 := tamanho_listbox + 20 + 30

Gui, Font, S%f_size% cWhite Bold, Arial ; x


Gui, Add, Text,xs+350 ys, Grave sua senha IBM aqui:
Gui, Font, S%f_size% cBlack Normal, Arial

Gui, Add, Edit, xs+350 ys+25 w150 vSenhaIBM


Gui, Add, Button, Default gPegaSenha_BtOK w33 h23 xs+510 ys+27,
OK

Gui, Font, S%f_size% cYellow Bold, Arial ; x


Gui, Add, Text,xs+350 ys+80, Atalhos:
Gui, Font, S%f_size% cBlack Normal, Arial

Gui, Font, S15 cBlack Bold, Arial


Gui, Add, Button, Default gAcessoRapido_1_1 w25 h23 xs+350
ys+120, &1 ; hwndbt_AcessoRapido_Login
Gui, Add, Button, Default gAcessoRapido_1_2 w25 h23 xs+350
ys+150, &2 ; hwndbt_AcessoRapido_Login
Gui, Add, Button, Default gAcessoRapido_1_3 w25 h23 xs+350
ys+180, &3 ; hwndbt_AcessoRapido_Login
Gui, Add, Button, Default gAcessoRapido_2_1 w25 h23 xs+400
ys+120, &1 ; hwndbt_AcessoRapido_Login
Gui, Add, Button, Default gAcessoRapido_2_2 w25 h23 xs+400
ys+150, &2 ; hwndbt_AcessoRapido_Login
Gui, Add, Button, Default gAcessoRapido_2_3 w25 h23 xs+400
ys+180, &3 ; hwndbt_AcessoRapido_Login
Gui, Add, Button, Default gAcessoRapido_2_4 w25 h23 xs+400
ys+210, &4 ; hwndbt_AcessoRapido_Login
Gui, Add, Button, Default gAcessoRapido_2_5 w25 h23 xs+400
ys+240, &5 ; hwndbt_AcessoRapido_Login
Gui, Font, S%f_size% cBlack Normal, Arial

Gui, Font, S%f_size% cRed Bold, Arial ; x


Gui, Add, Text,xs+380 ys+680, copyright: ♦RAFACN♦
Gui, Font, S%f_size% cBlack Normal, Arial
}
return

MotorIBM(Action)
{

;~ IBM_WIN32_NAME := "ahk_exe qws3270s.exe"


if WinExist(IBM_WIN32_NAME) ; qws3270s.exe > "processo" ativo no gerenciador
de tarefas > aba processos.
{
WinActivate, %IBM_WIN32_NAME%
winwaitactive, %IBM_WIN32_NAME%
}
else if WinExist(IBM_WIN32_NAME_Opcao2)
{
WinActivate, %IBM_WIN32_NAME_Opcao2%
winwaitactive, %IBM_WIN32_NAME_Opcao2%
}
else
{
msgbox, Nenhuma janela do IBM detectada..
;~ reload ; aqui
return
}

if (Action == "Alteracao_Config_Fac_CFM")
{
ToolTip, F1-2-3-1, 560, 20
SetTimer, RemoveToolTip, 3000

Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, 2418
Send, {Enter}
Send, {F1}
Send, 2
send, {Enter}
send, 3
send, {Enter}
send, 1
send, {Enter}
}
else if (Action == "Alteracao_Fac_Sem_Emissao_CFM")
{
ToolTip, F1-2-2-1-2, 560, 20
SetTimer, RemoveToolTip, 3000

Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, 2418
Send, {Enter}
Send, {F1}
Send, 2
send, {Enter}
send, 2
send, {Enter}
send, 1
send, {Enter}
send, 2
send, {Enter}
}
else if (Action == "Alteracao_Informacoes_Tronco_CFM")
{
ToolTip, F1-2-3-2, 560, 20
SetTimer, RemoveToolTip, 3000

send, {F12}
send, {F12}
send, {F12}
send, {F12}
send, {F12}
send, {F12}
send, {F12}
send, {F12}
send, 2418
send, {Enter}
Send, {F1}
send, 2
send, {Enter}
send, 3
send, {Enter}
send, 2
send, {Enter}
}
else if (Action == "Alteracao_Nivel_Fac_CFM")
{
ToolTip, F1-2-3-3, 560, 20
SetTimer, RemoveToolTip, 3000

send, {F12}
send, {F12}
send, {F12}
send, {F12}
send, {F12}
send, {F1}
send, {F12}
send, {F12}
send, {F12}
send, 2418
send, {Enter}
send, {F1}
send, 2
send, {Enter}
send, 3
send, {Enter}
send, 3
send, {Enter}
}
else if (Action == "Alteracao_T&C_Dados_CFM")
{
ToolTip, F1-2-1-3, 560, 20
SetTimer, RemoveToolTip, 3000

Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
send, 2418
send, {Enter}
Send, {F1}
send, 2
send, {Enter}
send, 1
send, {Enter}
send, 3
send, {Enter}
Send, {Tab}
Send, {Tab}
Send, {Tab}
Send, {Tab}
Send, {Tab}
Send, 2014
Send, 9999
send, RAFACN

Send, {Tab}
FormatTime, Time,, ddMMyyyy
Send,%Time%
Send,%Time%

send, RCE AM MT
Send, {Tab}
send, s
Send, {Tab}
}
else if (Action == "Associar_Designacao_Servico_CFM")
{
ToolTip, F6-8-1, 560, 20
SetTimer, RemoveToolTip, 3000

Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
send, 2418
Send, {Enter}
Send, {F6}
send, 8
Send, {Enter}
send, 1
Send, {Enter}
}
else if (Action == "Ativacao_Troncos_Acesso_CFM")
{
ToolTip, F1-2-1-1, 560, 20
SetTimer, RemoveToolTip, 3000

Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
send, 2418
send, {Enter}
Send, {F1}
send, 2
send, {Enter}
send, 1
send, {Enter}
send, 1
send, {Enter}
Send, {Tab}
Send, {Tab}
Send, {Tab}
Send, {Tab}
Send, {Tab}
Send, {Tab}
send, {Tab}
send, rce am mt
Send, {Tab}
send, RAFACN
Send, {Tab}

FormatTime, Time,, ddMMyyyy


Send,%Time%
Send,%Time%

;~ send, xxxx16e1
Send, {Tab}
;~ send, coloca
Send, {Tab}
Send, {Tab}
Send, {Tab}
send, rede acesso0093
send, {Tab}
send, {Tab}
send, {Tab}
send, {Tab}
}
else if (Action == "Ativacao_Troncos_Servico_CFM")
{
InsidePreenchido = 0
PVT =
Matricula_PVT =
Codigo_Servico =
Servico =
guiEscolha_PVT_e_Servico(InsidePreenchido) ; ipip
associa_PVT_e_Servico(Matricula_PVT,Codigo_Servico)

ToolTip, F1-2-1-1, 560, 20


SetTimer, RemoveToolTip, 3000

Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
send, 2418
send, {Enter}
Send, {F1}
send, 2
send, {Enter}
send, 1
send, {Enter}
send, 1
send, {Enter}
Send, {Tab}
Send, {Tab}
Send, {Tab}
Send, {Tab}
Send, {Tab}
Send, {Tab}
send, {Tab}
send, rce am at
Send, {Tab}
send, %PVT%
if (strlen(%PVT%) < 9)
send, {Tab}

FormatTime, Time,, ddMMyyyy


Send,%Time%
Send,%Time%

;~ send, xxxx16e1
Send, {Tab}
;~ send, coloca
Send, {Tab}
Send, {Tab}
Send, {Tab}
send, rede DADOS %Codigo_Servico%
send, {Tab}
send, {Tab}
send, {Tab}
send, {Tab}
}
else if (Action == "Cancelamento_Item_OTS_CFM")
{
ToolTip, F1-2-2-1-3, 560, 20
SetTimer, RemoveToolTip, 3000

Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
send, 2418
send, {Enter}
Send, {F1}
send, 2
send, {Enter}
send, 2
send, {Enter}
send, 1
send, {Enter}
send, 3
send, {Enter}
}
else if(Action == "Consulta_Agrupamento_CFM")
{
ToolTip, F3-14-12, 560, 20
SetTimer, RemoveToolTip, 3000

Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, 2418
Send, {Enter}
Send, {F3}
Send, 14
Send, {Enter}
Send, 12
Send, {Enter}
}
else if (Action == "Consulta_Bandas_Estacao_CFM")
{
ToolTip, F3-14-10, 560, 20
SetTimer, RemoveToolTip, 3000

Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
send, 2418
Send, {Enter}
Send, {F3}
send, 14
Send, {Enter}
send, 10
Send, {Enter}
send, rce agpane
}
else if (Action == "Consulta_Degrau_COM")
{
ToolTip, COM-2118-15, 560, 20
SetTimer, RemoveToolTip, 3000

Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
sleep 100
Send, {Delete}
Send, {Delete}
send, f
send, {Enter}
send, com
send, {Enter}
sleep 2000
send, 2118
send, {Enter}
send, 15
send, {Enter}
}
else if (Action == "Consulta_Execucao_OTS")
{
ToolTip, F3-16-16, 560, 20
SetTimer, RemoveToolTip, 3000

Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
send, 2418
Send, {Enter}
Send, {F3}
Send, {Enter}
send, 16
Send, {Enter}
send, 16
Send, {Enter}
}
else if (Action == "Consulta_Facilidades_Vagas_CFM")
{
ToolTip, F3-15-6, 560, 20
SetTimer, RemoveToolTip, 3000

Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
send, 2418
Send, {Enter}
Send, {F3}
send, 15
Send, {Enter}
send, 6
Send, {Enter}
send, RCE AMLINE
Send, {Tab}
send, GP
Send, {Tab}
}
else if (Action == "Consulta_OTS_CFM")
{
ToolTip, F3-14-6, 560, 20
SetTimer, RemoveToolTip, 3000

Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
send, 2418
Send, {Enter}
Send, {F3}
send, 14
Send, {Enter}
send, 6
Send, {Enter}
}
else if (Action == "Consulta_OTS_CFM_2")
{
ToolTip, F1-2-2-4, 560, 20
SetTimer, RemoveToolTip, 3000

Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
send, 2418
Send, {Enter}
Send, {F1}
send, 2
Send, {Enter}
send, 2
Send, {Enter}
send, 4
Send, {Enter}
}
else if (Action == "Consulta_OTS_PorCliente_CFM")
{
ToolTip, F3-14-2, 560, 20
SetTimer, RemoveToolTip, 3000

Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
send, 2418
Send, {Enter}
Send, {F3}
send, 14
Send, {Enter}
send, 2
Send, {Enter}
}
else if (Action == "Consulta_OTS_Pendentes_Fechamento")
{
ToolTip, F1-2-2-1-1-F1, 560, 20
SetTimer, RemoveToolTip, 3000

Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
send, 2418
Send, {Enter}
Send, {F1}
send, 2
Send, {Enter}
send, 2
Send, {Enter}
send, 1
Send, {Enter}
send, 1
Send, {Enter}
Send, {F1}
}
else if (Action == "Consulta_OTS_Retornada_CFM")
{
ToolTip, F3-14-9, 560, 20
SetTimer, RemoveToolTip, 3000

Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
send, 2418
Send, {Enter}
Send, {F3}
send, 14
Send, {Enter}
send, 9
Send, {Enter}
}
else if (Action == "Consulta_Pendencia_OTS")
{
ToolTip, F3-16-7-1, 560, 20
SetTimer, RemoveToolTip, 3000

Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
send, 2418
Send, {Enter}
Send, {F3}
send, 16
Send, {Enter}
send, 7
Send, {Enter}
send, 1
Send, {Enter}
}
else if (Action == "Consulta_Por_Capacidade_Por_Estacao_CFM")
{
ToolTip, F3-14-16, 560, 20
SetTimer, RemoveToolTip, 3000
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
send, 2418
Send, {Enter}
Send, {F3}
send, 14
Send, {Enter}
send, 16
Send, {Enter}
send, 6340m
Send, {Tab}
send, rce am
}
else if (Action == "Consulta_Tronco_CFM")
{
ToolTip, F3-14-1, 560, 20
SetTimer, RemoveToolTip, 3000

Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
send, 2418
Send, {Enter}
Send, {F3}
send, 14
Send, {Enter}
send, 1
Send, {Enter}
}
else if (Action == "Desassociar_Designacao_Servico_CFM")
{
ToolTip, F6-8-3, 560, 20
SetTimer, RemoveToolTip, 3000

Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
send, 2418
Send, {Enter}
Send, {F6}
send, 8
Send, {Enter}
send, 3
Send, {Enter}
}
else if (Action == "Desativacao_Troncos_CFM")
{
ToolTip, F1-2-1-2, 560, 20
SetTimer, RemoveToolTip, 3000

Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
send, 2418
Send, {Enter}
Send, {F1}
send, 2
Send, {Enter}
send, 1
Send, {Enter}
send, 2
Send, {Enter}
Send, {Tab}
Send, {Tab}
Send, {Tab}
Send, {Tab}
Send, {Tab}
Send, 2014
Send, 9999
send, RAFACN
Send, {Tab}
FormatTime, Time,, ddMMyyyy
Send,%Time%
Send,%Time%
send, Inclusao de cliente no anel
Send, {Tab}
}
else if (Action == "Consulta_Endereco_CFM")
{
ToolTip, F3-17-1, 560, 20
SetTimer, RemoveToolTip, 3000

Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
send, 2418
Send, {Enter}
Send, {F3}
send, 17
Send, {Enter}
send, 1
Send, {Enter}
}
else if (Action == "Consulta_Estacao_CFM")
{
ToolTip, F3-13-6, 560, 20
SetTimer, RemoveToolTip, 3000

Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
send, 2418
Send, {Enter}
Send, {F3}
send, 13
Send, {Enter}
send, 6
Send, {Enter}
Send, {Tab}
Send, {Tab}
Send, {Tab}
send, x
Send, +{Tab}
Send, +{Tab}
Send, +{Tab}
Send, +{Tab}
}
else if (Action == "Escreve_CFs_Envolvidos_Acesso_RCE")
{
send, {Home}
send, ^E
sleep 50
send, {Down}
send, ^E
sleep 50
send, {Down}
send, ^E
sleep 50
send, {Down}
send, ^E
sleep 50
send, {Down}
send, ^E
sleep 50
send, {Down}
send, ^E
sleep 50
send, {Down}
send, {Home}
send, RCE AM MT
Send, {Home}
send, {Down}
Send, BSA GR MT
send, {Home}
send, {Down}
send, {Down}
}
else if (Action == "Escreve_CFs_Envolvidos_Servico_RCE")
{
send, {Home}
send, ^E
sleep 50
send, {Down}
send, ^E
sleep 50
send, {Down}
send, ^E
sleep 50
send, {Down}
send, ^E
sleep 50
send, {Down}
send, ^E
sleep 50
send, {Down}
send, ^E
sleep 50
send, {Down}
send, {Home}
send, RCE AM MT
Send, {Home}
send, {Down}
Send, RCE AM AT
send, {Home}
send, {Down}
send, {Down}
Send, BSA GR MT
send, {Home}
send, {Down}
send, {Down}
send, {Down}
}
else if (Action == "Escreve_CFs_Envolvidos_Acesso_MCO")
{
send, {Home}
send, ^E
sleep 50
send, {Down}
send, ^E
sleep 50
send, {Down}
send, ^E
sleep 50
send, {Down}
send, ^E
sleep 50
send, {Down}
send, ^E
sleep 50
send, {Down}
send, ^E
sleep 50
send, {Down}
send, {Home}
send, MCO MS MT
Send, {Home}
send, {Down}
Send, BSA GR MT
send, {Home}
send, {Down}
send, {Down}
}
else if (Action == "Escreve_CFs_Envolvidos_Acesso_JPA")
{
send, {Home}
send, ^E
sleep 50
send, {Down}
send, ^E
sleep 50
send, {Down}
send, ^E
sleep 50
send, {Down}
send, ^E
sleep 50
send, {Down}
send, ^E
sleep 50
send, {Down}
send, ^E
sleep 50
send, {Down}
send, {Home}
send, JPA TR MT
Send, {Home}
send, {Down}
Send, BSA GR MT
send, {Home}
send, {Down}
send, {Down}
}
else if (Action == "Fechamento_OTS_CFM")
{
ToolTip, F1-2-2-1-1, 560, 20
SetTimer, RemoveToolTip, 3000

Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
send, 2418
Send, {Enter}
Send, {F1}
send, 2
Send, {Enter}
send, 2
Send, {Enter}
send, 1
Send, {Enter}
send, 1
Send, {Enter}
}
else if (Action == "Inclusao_Estacao_CFM")
{
ToolTip, F1-3-12, 560, 20
SetTimer, RemoveToolTip, 3000

Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
send, 2418
Send, {Enter}
Send, {F1}
send, 3
Send, {Enter}
send, 1
Send, {Enter}
Send, {Tab}
Send, {Tab}
Send, {Tab}
Send, {Tab}
Send, {Tab}
Send, {Tab}
Send, {Tab}
Send, {Tab}
Send, {Tab}
Send, {Tab}
Send, {Tab}
Send, {Tab}
send, snrce am mt
Send, {Tab}
Send, {Tab}
Send, {Tab}
send, rce am mt
Send, {Tab}
Send, {Tab}
Send, {Tab}
Send, {Tab}
send, rce am at
}
else if (Action == "Login")
{
FileReadLine, linha_Usuario, %Endereco_Arquivo%, 1
FileReadLine, linha_Senha, %Endereco_Arquivo%, 2
FileReadLine, linha_Perfil, %Endereco_Arquivo%, 3
StringReplace, Usuario, linha_Usuario, Login:,, All ; a ser usado no
login
StringReplace, Senha, linha_Senha, Senha:,, All ; a ser usado no
login ; sobrescrito no OK
StringReplace, Perfil, linha_Perfil, Perfil:,, All ; Utilizado na GUI;
sobrescrito na GUI.

Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}

Send, !c ;key clear


send, f
Send, {Enter}

Send, {F3}
send, %Usuario%
Send, {Tab}
if (Senha != "")
{
send, %Senha%
Send, {Enter}
Send, !c ;key clear
send, %Perfil%
Send, {Enter}
Send, !c ;key clear
send, 2418
Send, {Enter}
}
else
{
msgbox, Nenhuma Senha cadastrada. Verifique se você possui disco
D:/. Caso possua, cadastre sua senha no menu principal do IBM Simples.`nPedimos
desculpas pelo inconviniente.
}

}
else if (Action == "OTS_Radio_CFM")
{
ToolTip, F1-2-1-5-1-1, 560, 20
SetTimer, RemoveToolTip, 3000

Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
send, 2418
Send, {Enter}
Send, {F1}
send, 2
Send, {Enter}
send, 1
Send, {Enter}
send, 5
Send, {Enter}
send, 1
Send, {Enter}
send, 1
Send, {Enter}
Send, {Tab}
Send, {Tab}
send, 1
Send, {Tab}
Send, {Tab}
send, X
Send, {Tab}
send, X
Send, +{Tab}
Send, +{Tab}
Send, +{Tab}
Send, +{Tab}
Send, +{Tab}
Send, +{Tab}
Send, +{Tab}
}
else if (Action == "Reserva_Fac_CFM")
{
ToolTip, F1-1-F1, 560, 20
SetTimer, RemoveToolTip, 3000

Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
send, 2418
Send, {Enter}
Send, {F1}
send, 1
Send, {Enter}
Send, {F1}
}
else if (Action == "Retorna_OTS_CFM")
{
ToolTip, F1-2-2-2-4, 560, 20
SetTimer, RemoveToolTip, 3000

Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
send, 2418
Send, {Enter}
Send, {F1}
send, 2
Send, {Enter}
send, 2
Send, {Enter}
send, 2
Send, {Enter}
send, 4
Send, {Enter}
}

return

RemoveToolTip:
;~ SetTimer, RemoveToolTip, Off
ToolTip
return

Submitt: ; ipip
guicontrolget, PVT
guicontrolget, Servico
;~ gui, EscolhaPVTeServico:Submit
gui, EscolhaPVTeServico:destroy
InsidePreenchido = 1
return
}
return

#F1::
{

;~ zera_tudo(PVT, Matricula_PVT, Codigo_Servico, Servico) ; PODE USAR!!!!

;~ ------------------
global f_size=12
gosub, INICIO
return

;~ #F11::
;~ f_size +=2
;~ Gui,destroy
;~ gosub, INICIO
;~ return

;~ #F12::
;~ f_size -=2
;~ Gui,destroy
;~ gosub, INICIO
;~ return
;~ ------------------

INICIO:
guiTelaInicial()
Gui, Show
return

MyListBox:
if A_GuiEvent = Normal ; <> DoubleClick
{
GuiControlGet, MyListBox
Action = %MyListBox%

gui, destroy
MotorIBM(Action)
}
return

PegaSenha_BtOK:

GuiControlGet, SenhaIBM

StringReplace, Senha, SenhaIBM, xx, xx, All

FileReadLine, linha_Usuario, %Endereco_Arquivo%, 1


FileReadLine, linha_Senha, %Endereco_Arquivo%, 2
FileReadLine, linha_Perfil, %Endereco_Arquivo%, 3

StringReplace, Usuario, linha_Usuario, Login:,, All ; a ser usado no


login
if (SenhaIBM == "") ; Não utiliza senha posteriormente gravada se não
for escrito nada no campo ; SenhaIBM vem do campo "Edit" ao lado de OK
{
StringReplace, Senha, linha_Senha, Senha:,, All ; a ser usado no
login ; sobrescrito no OK
}
StringReplace, Perfil, linha_Perfil, Perfil:,, All ; Utilizado na GUI;
sobrescrito na GUI.

file1 := FileOpen(Endereco_Arquivo, "w") ; write


file1.Write("Login:" Usuario "`r`n")
file1.Write("Senha:" Senha "`r`n")
file1.Write("Perfil:" Perfil "`r`n")
file1.Close()

GuiControl,,SenhaIBM ; EditBox Clear


Clear = 1 ; EditBox Clear
return

AcessoRapido_1_1:
gui, destroy
MotorIBM("Escreve_CFs_Envolvidos_Servico_RCE")
return

AcessoRapido_1_2:
gui, destroy
MotorIBM("Escreve_CFs_Envolvidos_Acesso_RCE")
return

AcessoRapido_1_3:
gui, destroy
Consulta_Centros_Funcionais_Status_e_OTS()
return

AcessoRapido_2_1:
gui, destroy
MotorIBM(AcaoRapida_2_1) ; "Login"
return

AcessoRapido_2_2:
gui, destroy
MotorIBM(AcaoRapida_2_2) ; "Consulta_Tronco_CFM"
return

AcessoRapido_2_3:
gui, destroy
MotorIBM(AcaoRapida_2_3) ; "Consulta_Agrupamento_CFM"
return
AcessoRapido_2_4:
gui, destroy
MotorIBM(AcaoRapida_2_4) ; "Consulta_Endereco_CFM"
return
AcessoRapido_2_5:
gui, destroy
MotorIBM(AcaoRapida_2_5) ; "Consulta_Estacao_CFM"
return

GuiClose:
GuiEscape:
gui, destroy
return
}
return

guiEscolha_PVT_e_Servico(byref InsidePreenchido) ; ipip


{
y_Drop1 = 100
y_Drop2 := y_Drop1+50
y_Drop3 := y_Drop1+100

Gui, EscolhaPVTeServico:Add, Text,y40,Informações necessárias


Gui, EscolhaPVTeServico:Add, Text,x10 y%y_Drop1%, PVT:
Gui,EscolhaPVTeServico:Add, DropDownList, xp+60 y%y_Drop1% w120 vPVT,
ACOLQUE|ANDRERM|ANTOMAR|CARMEMC|CMLIMA|DANYL|DHELEN|DAFS|ELIASRS|BETHC|FCABRAL|
HERCIL|JCSALES|JOSOLIV|JUCARLA|JORDANI|NESSACS|PAULOAD|ROSLIM|XAVIERS
Gui, EscolhaPVTeServico:Add, Text,x10 y%y_Drop2%, SERVIÇO:
Gui,EscolhaPVTeServico:Add, DropDownList, xp+60 y%y_Drop2% w120 vServico,
BLD|MPLS|VIPLINE|VIPPHONE|VBL|INTERNET|PRIMELINK|IP VPN|RUD MPLS|VIPLINE IP|
VIPUNICO|LAN TO LAN|VIP ESPECIAL|VIPSIP|GER DATACOM|GER TELLABS
Gui,EscolhaPVTeServico:Add, Button, Default w90 h25 x200 y200 gSubmitt,
Preencher ; Muda a variável InsidePreenchido para 1
gui,EscolhaPVTeServico:show

while(!InsidePreenchido) ; loop infinito


{
sleep 200
}

;~ return ; necessário para não executar novamente o codigo abaixo de submitt


}
return

associa_PVT_e_Servico(byref Matricula_PVT, byref Codigo_Servico)


{
If (PVT == "ACOLQUE")
Matricula_PVT = 440900
else If (PVT == "ANDRERM")
Matricula_PVT = 399144
else If (PVT == "ANTOMAR")
Matricula_PVT = 238942
else If (PVT == "CARMEMC")
Matricula_PVT = 228024
else If (PVT == "CMLIMA")
Matricula_PVT = 189764
else If (PVT == "DANYL")
Matricula_PVT = 358581
else If (PVT == "DHELEN")
Matricula_PVT = 474437
else If (PVT == "DAFS")
Matricula_PVT = 410479
else If (PVT == "ELIASRS")
Matricula_PVT = 233385
else If (PVT == "BETHC")
Matricula_PVT = 447172
else If (PVT == "FCABRAL")
Matricula_PVT = 418284
else If (PVT == "HERCIL")
Matricula_PVT = 344989
else If (PVT == "JCSALES")
Matricula_PVT = 187257
else If (PVT == "JOSOLIV")
Matricula_PVT = 471921
else If (PVT == "JUCARLA")
Matricula_PVT = 493014
else If (PVT == "JORDANI")
Matricula_PVT = 238899
else If (PVT == "NESSACS")
Matricula_PVT = 421903
else If (PVT == "PAULOAD")
Matricula_PVT = 55345
else If (PVT == "ROSLIM")
Matricula_PVT = 450793
else If (PVT == "XAVIERS")
Matricula_PVT = 485309

If (Servico == "BLD")
Codigo_Servico = 0057
else if (Servico == "MPLS")
Codigo_Servico = 0228
else if (Servico == "VIPLINE")
Codigo_Servico = 0123
else if (Servico == "VIPPHONE")
Codigo_Servico = 0123
else if (Servico == "VBL")
Codigo_Servico = 0232
else if (Servico == "INTERNET")
Codigo_Servico = 0023
else if (Servico == "PRIMELINK")
Codigo_Servico = 0001
else if (Servico == "IP VPN")
Codigo_Servico = 0165
else if (Servico == "RUD MPLS")
Codigo_Servico = 0189
else if (Servico == "VIPLINE IP")
Codigo_Servico = 0195
else if (Servico == "VIPUNICO")
Codigo_Servico = 0227
else if (Servico == "LAN TO LAN")
Codigo_Servico = 0197
else if (Servico == "VIP ESPECIAL")
Codigo_Servico = 0219
else if (Servico == "VIPSIP")
Codigo_Servico = 0264
else if (Servico == "GER DATACOM")
Codigo_Servico = 0202
else if (Servico == "GER TELLABS")
Codigo_Servico = 0211
}
return

zera_tudo(byref PVT, byref Matricula_PVT, byref Codigo_Servico, byref Servico)


{
PVT =
Matricula_PVT =
Codigo_Servico =
Servico =
}
return

#F2::
{
msgbox, %PVT%
send, %Matricula_PVT%
}
return

;~ apagar depois
#F7::
{
;~ else if WinExist("ahk_exe qws3270x.exe") ; qws3270s.exe > "processo" ativo
no gerenciador de tarefas > aba processos.
;~ WinActivate, ahk_exe qws3270s.exe
;~
-----------------------------------------------------------------------------------
------------
;~ UniqueID := WinExist("WinTitle", "WinText", "ExcludeTitle", "ExcludeText")
;~
-----------------------------------------------------------------------------------
------------
;~ WinGet, active_pid, PID, A
;~ msgbox, %active_pid%
;~ Process, priority, %NewPID%, High
;~
-----------------------------------------------------------------------------------
------------
;~ if WinExist("ahk_exe qws3270s.exe") ; qws3270s.exe > "processo" ativo no
gerenciador de tarefas > aba processos.
;~ WinActivate, ahk_exe qws3270s.exe
;~
-----------------------------------------------------------------------------------
------------
; Example #2: This will visit all windows on the entire system and display info
about each of them:
WinGet, id, list,,, Program Manager
Loop, %id%
{
this_id := id%A_Index%
WinActivate, ahk_id %this_id%
WinGetClass, this_class, ahk_id %this_id%
WinGetTitle, this_title, ahk_id %this_id%
MsgBox, 4, , Visiting All Windows`n%a_index% of %id%`nahk_id %this_id
%`nahk_class %this_class%`n%this_title%`n`nContinue?
IfMsgBox, NO, break
}
;~
-----------------------------------------------------------------------------------
------------
;~ Gui, Add, ListView, x2 y0 w400 h500, Process Name|Command Line
;~ for process in ComObjGet("winmgmts:").ExecQuery("Select * from Win32_Process")
;~ LV_Add("", process.Name, process.CommandLine)
;~ Gui, Show,, Process List
;~
-----------------------------------------------------------------------------------
------------
;~ MouseGetPos,,, id
;~ if WinExist("ahk_class Notepad ahk_id " id)
;~ MsgBox The mouse is over Notepad.
;~
-----------------------------------------------------------------------------------
------------

}
return

Consulta_Centros_Funcionais_Status_e_OTS()
{
Tronco_Escolhido_Consulta := clipboard
if Tronco_Escolhido_Consulta not contains VC4S,0480N,16E1
{
msgbox, Tronco no nível necessário não copiado no clipboard.
return ; reload
}
;~ APAGA ARQUIVO ANTES DE COMEÇAR
file2 := FileOpen(Endereco_Arquivo2, "w") ;
file2.Close()

file3 := FileOpen(Endereco_Arquivo3, "w") ;


file3.write(Tronco_Escolhido_Consulta "`n`r")
file3.Close()
;~ -----------------------------------

NumeroOTS :=
["","","","","","","","","","","","","","","","","","","","","","","","","","","","
","","","","","","","","","","","","","","","","","","","","","","","","","","","",
"","","","","","","","","","","","","","",""]
StatusOTS :=
["","","","","","","","","","","","","","","","","","","","","","","","","","","","
","","","","","","","","","","","","","","","","","","","","","","","","","","","",
"","","","","","","","","","","","","","",""]
CentrosFuncionaisOTS :=
["","","","","","","","","","","","","","","","","","","","","","","","","","","","
","","","","","","","","","","","","","","","","","","","","","","","","","","","",
"","","","","","","","","","","","","","",""]
Tronco_na_linha_GP :=
["","","","","","","","","","","","","","","","","","","","","","","","","","","","
","","","","","","","","","","","","","","","","","","","","","","","","","","","",
"","","","","","","","","","","","","","",""]
linha_GP =
buff_shGP =

;~ MAXIMIZA TELA DO CMD


send, !{Space}
sleep 300
send, {Down 4}
sleep 300
send, {Enter}
sleep 300
;~ -----------------------
;~ CONSULTA_TRONCO:
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
send, 2418
Send, {Enter}
Send, {F3}
send, 14
Send, {Enter}
send, 1
Send, {Enter}
sleep 3000
send, %Tronco_Escolhido_Consulta%
sleep 400
send, {Enter}
;~ -----------------------
file3.write("Relatorio de OTS no tronco: " Tronco_Escolhido_Consulta " `n")
file3.close()

sleep 200
achou = 0
contador = 0
while (!achou)
{
send, {Enter} ; 4}
achou := Full_Screen_Check("CONSULTA DE TRONCOS - FACILIDADES GERADAS")
if (contador == 14)
{
msgbox, problema ao achar o tronco no CFM.
Reload
}
contador ++
}
sleep 500 ; 2000

i=1
; pega tudo
file2 := FileOpen(Endereco_Arquivo2, "a") ; append
loop, 10
{
;~ msgbox, %i%
mouseclickdrag,left, 4, 284, 1274, 921
sleep 300
if clipboard not contains CENTRO(S) FUNCIONAL(IS)
{
if clipboard contains GP
{
file2.Write(clipboard "`r`n")
}
}
else
{
break
}
i++
send, {Enter}
sleep 300
}
file2.Close()

if (i==1)
{
msgbox, Nenhum nível GP reconhecido! %i%
reload
}

i=1
continuar = 1
while (continuar)
{
;~ msgbox, entrou
linha_GP =
buff_shGP =

FileReadLine, linha_GP, %Endereco_Arquivo2%, %i%


;~ msgbox, % "linha_GP: " linha_GP
;~ j=10 ; 9,2
;~ loop 10
;~ {
;~ j++
;~ buff_shGP := substr(linha_GP,j,2)
;~ msgbox, % "buff_shGP: " j "|" buff_shGP "|"
;~ }
buff_shGP := substr(linha_GP,9,2)
;~ msgbox, % "buff_shGP: |" buff_shGP "|"
if (buff_shGP == "GP")
{
Tronco_na_linha_GP[i] := substr(linha_GP,15,30) ; 29 XWXW
;~ msgbox, % "|" Tronco_na_linha_GP[i] "|" i " xxxxwwww" ; erro
aqui
}
else
{
break
}
i++
if linha_GP not contains GP
continuar = 0
}

numero_de_linhas_no_arquivo := i - 1
;~ i=1
;~ loop, %numero_de_linhas_no_arquivo%
;~ {
;~ msgbox, % Tronco_na_linha_GP[i]
;~ i++
;~ }

i=1
;~ msgbox, Lupará: %numero_de_linhas_no_arquivo%

;~ CONSULTA_TRONCO:
sleep 300
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
Send, {F12}
send, 2418
Send, {Enter}
Send, {F3}
send, 14
Send, {Enter}
send, 1
Send, {Enter}

loop, %numero_de_linhas_no_arquivo%
{
buffer_Tronco_na_linha_GP := Tronco_na_linha_GP[i]
buff_NumeroOTS =
buff_StatusOTS =
clipboard := buffer_Tronco_na_linha_GP
;~ msgbox, |%buffer_Tronco_na_linha_GP%|
if (buffer_Tronco_na_linha_GP != " ") ; "
") ; errando
{
;~ msgbox, entrou2

;~ sleep 3000
Full_Screen_Check("CONSULTA COMPLETA DE TRONCOS/CIRCUITOS")
;~ msgbox, % Tronco_na_linha_GP[i]
;~ sleep 500
send, % Tronco_na_linha_GP[i]
;~ sleep 500
send, {Enter}
sleep 1500
;~ -------------------
Full_Screen_Check("CONTA CORRENTE") ; CONSULTA DE TRONCOS
clipboard =
;~ sleep 1000
mouseclickdrag,left, 343, 355, 708, 359 ; 531, 358
sleep 200
NumeroOTS[i] := clipboard
;~ msgbox, % NumeroOTS[i]
sleep 200
clipboard =
mouseclickdrag,left, 341, 616, 898, 616
sleep 200
StatusOTS[i] := clipboard
sleep 200

file3 := FileOpen(Endereco_Arquivo3, "a") ;


buff_NumeroOTS := NumeroOTS[i]
buff_StatusOTS := StatusOTS[i]
;~ msgbox, x %buff_NumeroOTS% | %buff_StatusOTS%
file3.write("`n`r`n`r" Tronco_na_linha_GP[i] " | OTS: "
NumeroOTS[i] " | STATUS: " StatusOTS[i])
;~ file3.write("`n`r`n`r" buff_NumeroOTS " | " buff_StatusOTS)
file3.Close()

Send, {F12}
sleep 200

}
i++
}

run D:\IBM_Parciais_Consulta_Pendencia_OTS.txt

}
return

;~ APAGA ARQUIVO ANTES DE COMEÇAR


Full_Screen_Check(textNeeded) ; , numberOfScreens, byref numberOfTests)
{

;~ numberOfTests++
cliboardOLD := clipboard
textFound = 0
loop 4
{
sleep 200
mouseclickdrag, left, 4, 135, 1283, 951
sleep 300
if Clipboard contains %textNeeded%
{
textFound = 1
break
}
sleep 100
}

;~ if (textFound == 0)
;~ {

;~ if (numberOfScreens == numberOfTests)
;~ {
;~ msgbox, erro. Tela do CFM necessária não localizada!
;~ reload
;~ }
;~ }

clipboard := clipboardOLD
sleep 150

return %textFound%
}
;~ -----------------------------------

; ##############################################################################

; pega informações cla


#q::
{

num_solic =
wf =
cliente =
Servico =
velocidade =
designacao =
Tecnologia =
;~ uf =
cidade =
TipoLogr =
NomeLogr =
numero =
bairro =
cep =
contato_nome =
contato_tel =
global Title

pega_CLA(num_solic,wf,cliente,Servico,velocidade,designacao,Tecnologia,uf,cidade,Ti
poLogr,NomeLogr,numero,bairro,cep,contato_nome,contato_tel)

dir_executante = NE
coordenador_operadora2 = RAFAEL CARNEIRO NASCIMENTO ; REBECA LIMA
MACHADO
tipo_coord = EXECUTANTE
atividade = INSTALACAO
abordado = NAO

descricao = |SERVIÇO:%Servico%|DESIG.:%designacao%|TECNOLOGIA:
%Tecnologia%|PPC:|PVT:|

;~ TipoLogr
;~ NomeLogr

endereco := TipoLogr " " NomeLogr

StringReplace, endereco, endereco, %A_SPACE%%A_SPACE%%A_SPACE%,


%A_SPACE%,All
StringReplace, endereco, endereco, %A_SPACE%%A_SPACE%, %A_SPACE
%,All

centro_manutencao = RCE

}
return

guiListboxProjeto()
{
Gui, Add, Text,, PROJETO:
Gui, Add, ListBox, vMyListBoxProjeto
gMyListBox_Projeto w640 r2
GuiControl,, MyListBoxProjeto,
PRODUÇÃO
GuiControl,, MyListBoxProjeto,
REDE ACESSO

}
return

; joga informações pegas do cla na parte de cadastro do WFBR


#w::
{
INICIO2:
guiListboxProjeto() ; cabeçalho padrao gui contendo apenas a listbox
Gui, Show
return

MyListBox_Projeto:
if A_GuiEvent = Normal ; <> DoubleClick
{

GuiControlGet, MyListBoxProjeto
Escolha_Listbox_Projeto = %MyListBoxProjeto%
gui, destroy

if (Escolha_Listbox_Projeto == "PRODUÇÃO")
tipo_projeto = PRODUCAO
else if (Escolha_Listbox_Projeto == "REDE ACESSO")
tipo_projeto = REDE ACESSO

escreve_WF(num_solic,wf,tipo_projeto,dir_executante,coordenador_operadora2,cliente,
endereco,numero,bairro,cep,cidade,contato_nome,contato_tel,centro_manutencao,tipo_c
oord,servico,velocidade,atividade,Tecnologia,abordado,descricao)
}
return

}
return

pega_CLA(byref num_solic,byref wf,byref cliente,byref Servico, byref


velocidade,byref designacao,byref Tecnologia,byref uf,byref cidade,byref
TipoLogr,byref NomeLogr,byref numero,byref bairro,byref cep, byref contato_nome,
byref contato_tel)
{
Title =
winactivate, http://ntspo913/newcla/Asp/ConsultaGeralDet.asp
wingetactivetitle, Title
if Title not contains http://ntspo913/newcla/Asp/ConsultaGeralDet.asp
{
msgbox, CLA não aberto na página correta.
http://ntspo913/newcla/Asp/ConsultaGeralDet.asp
exitapp
}

WinMaximize, http://ntspo913/newcla/Asp/ConsultaGeralDet.asp
sleep 400
mouseclick, left, 220, 140
sleep 100
send, {WheelUp 5}
sleep 1000

num_solic =
wf =
cliente =
Servico =
velocidade =
designacao =
Tecnologia =
cidade =
TipoLogr =
NomeLogr =
numero =
bairro =
cep =
contato_nome =
contato_tel =

; CLA NORMAL: 1252661


num_solic := pegra_drag(224, 137, 265, 136) ; (220, 123, 268, 123)
wf := pegra_drag(204, 171, 250, 169) ; (200, 155, 251, 156)
cliente := pegra_drag(206, 205, 525, 204) ; (202, 191, 748, 191)
Servico := pegra_drag(206, 335, 369, 335) ; (201, 321, 377, 318)
velocidade := pegra_drag(583, 334, 631, 335) ; (580, 322, 667, 319)
designacao := pegra_drag(205, 366, 655, 366) ; (203, 352, 355, 349)
Tecnologia := pegra_drag(583, 705, 736, 704) ; (580, 691,739, 691)
;;~ uf := pegra_drag(201, 736, 371, 735)
cidade := pegra_drag(584, 749, 763, 750) ; (579, 737, 760, 737)
TipoLogr := pegra_drag(205, 765, 377, 764) ; (200, 753, 375, 751)
NomeLogr := pegra_drag(583, 765, 759, 767) ; (577, 752, 760, 750)
numero := pegra_drag(204, 782, 371, 783) ; (200, 768, 371, 766)
bairro := pegra_drag(204, 797, 379, 801) ; (200, 785, 378, 780) ; *****
cep := pegra_drag(581, 796, 727, 798) ; (576, 778, 661, 782)
contato_nome := pegra_drag(204, 814, 381, 816) ; (204, 799, 361, 798)
contato_tel := pegra_drag(583, 815, 688, 812) ; (582, 799, 722, 799)

; CLA ENDEREÇO GRANDE: 1321312

if(TipoLogr == numero) ; CASO ENDEREÇO GRANDE


{
NomeLogr := pegra_drag(585, 764, 758, 780) ; (577, 752, 760, 767)
numero := pegra_drag(206, 794, 371, 795) ; (203, 780, 274, 780)
cep := pegra_drag(580, 812, 740, 811) ; (576, 798, 665, 796)
bairro := pegra_drag(206, 810, 380, 810) ; (202, 796, 375, 796)
contato_nome := pegra_drag(205, 825, 383, 827) ; (203, 813, 380, 813)
contato_tel := pegra_drag(585, 826, 749, 829) ; (581, 812, 674, 810)
}

; CLA COMPLEMENTO GRANDE:

;~ if(bairro == numero) ; CASO COMPLEMENTO GRANDE


;~ {
;~ ;;~ NomeLogr := pegra_drag(577, 752, 760, 767)
;~ ;;~ numero := pegra_drag(203, 780, 274, 780)
;~ cep := pegra_drag() ; (578, 797, 663, 796)
;~ bairro := pegra_drag() ; (203, 799, 374, 799)
;~ contato_nome := pegra_drag() ; (203, 814, 380, 814)
;~ contato_tel := pegra_drag() ; (581, 814, 701, 814)
;~ }

cep_len := strlen(cep)
StringMid, cep, cep, 2, %cep_len%
}
return

pegra_drag(x1,y1,x2,y2)
{
clipboard =
mouseclickdrag,left, %x1%, %y1%, %x2%, %y2%
sleep 50
send, ^c
sleep 100
return %clipboard%
}

escreve_WF(num_solic,wf,tipo_projeto,dir_executante,coordenador_operadora2,cliente,
endereco,numero,bairro,cep,cidade,contato_nome,contato_tel,centro_manutencao,tipo_c
oord,Servico,velocidade,atividade,Tecnologia,abordado,descricao)
{
;~ wingetactivetitle, Title
;~ if Title contains Cadastro
;~ {
;~ sleep 100
;~ }
;~ else
;~ {
;~ msgbox, você não está na tela correta.
;~ Reload
;~ }

msgbox, |num_solic: %num_solic%|`n|wf: %wf%|`n|tipo_projeto: %tipo_projeto%|


`n|dir_executante: %dir_executante%|`n|coordenador_operadora2:
%coordenador_operadora2%|`n|cliente: %cliente%|`n|endereco: %endereco%|`n|numero:
%numero%|`n|bairro: %bairro%|`n|cep: %cep%|`n|cidade: %cidade%|`n|
centro_manutencao: %centro_manutencao%|`n|tipo_coord: %tipo_coord%|`n|velocidade:
%velocidade%|`n|atividade: %atividade%|`n|%abordado%|`n|descricao: %descricao%| `n|
contato_nome: %contato_nome%| `n|contato_tel: %contato_tel%|

StringReplace, num_solic, num_solic, `r`n, ,All


StringReplace, wf, wf, `r`n, ,All
StringReplace, tipo_projeto, tipo_projeto, `r`n, ,All
StringReplace, dir_executante, dir_executante, `r`n, ,All
StringReplace, coordenador_operadora2, coordenador_operadora2, `r`n, ,All
StringReplace, cliente, cliente, `r`n, ,All
StringReplace, endereco, endereco, `r`n, ,All
;~ StringReplace, endereco, endereco, %A_SPACE%%A_SPACE%, %A_SPACE%,All
;~ StringReplace, endereco, endereco, %A_SPACE%%A_SPACE%%A_SPACE%, %A_SPACE
%,All
StringReplace, numero, numero, `r`n, ,All
StringReplace, bairro, bairro, `r`n, ,All
StringReplace, cep, cep, `r`n, ,All
StringReplace, cidade, cidade, `r`n, ,All
StringReplace, contato_nome, contato_nome, `r`n, ,All
StringReplace, contato_tel, contato_tel, `r`n, ,All
StringReplace, centro_manutencao, centro_manutencao, `r`n, ,All
StringReplace, tipo_coord, tipo_coord, `r`n, ,All
StringReplace, Servico, Servico, `r`n, ,All
StringReplace, velocidade, velocidade, `r`n, ,All
StringReplace, atividade, atividade, `r`n, ,All
StringReplace, Tecnologia, Tecnologia, `r`n, ,All
StringReplace, abordado, abordado, `r`n, ,All
StringReplace, descricao, descricao, `r`n, ,All

StringReplace, num_solic, num_solic, `t, ,All


StringReplace, wf, wf, `t, ,All
StringReplace, tipo_projeto, tipo_projeto, `t, ,All
StringReplace, dir_executante, dir_executante, `t, ,All
StringReplace, coordenador_operadora2, coordenador_operadora2, `t, ,All
StringReplace, cliente, cliente, `t, ,All
StringReplace, endereco, endereco, `t, ,All
StringReplace, numero, numero, `t, ,All
StringReplace, bairro, bairro, `t, ,All
StringReplace, cep, cep, `t, ,All
StringReplace, cidade, cidade, `t, ,All
StringReplace, contato_nome, contato_nome, `t, ,All
StringReplace, contato_tel, contato_tel, `t, ,All
StringReplace, centro_manutencao, centro_manutencao, `t, ,All
StringReplace, tipo_coord, tipo_coord, `t, ,All
StringReplace, Servico, Servico, `t, ,All
StringReplace, velocidade, velocidade, `t, ,All
StringReplace, atividade, atividade, `t, ,All
StringReplace, Tecnologia, Tecnologia, `t, ,All
StringReplace, abordado, abordado, `t, ,All
StringReplace, descricao, descricao, `t, ,All

StringReplace, cep, cep,-,,All

if Servico contains MPLS


Servico = MPLS
else if Servico contains BUSINESS
Servico = BLD
else if Servico contains IP DIRETO
Servico = OUTROS
else
{
msgbox, Servico Desconhecido |%Servico%|
}

if Tecnologia contains GPON


Tecnologia = FIBRA GPON
else
Tecnologia = FIBRA EMBRATEL

sleep 300
mouseclick, left, 602, 275 ; 404, 260
send, %num_solic%
;~ sleep 300
send, {TAB}
sleep 3000
wingetactivetitle, Title
;~ msgbox, %Title%
if Title contains Atenção
{
send, ^{F4}
;~ winclose, %Title%
}
sleep 1000
send, %wf%
;~ sleep 300
send, {TAB}
;~ sleep 300
send, %tipo_projeto%
;~ sleep 300
send, {TAB}
sleep 3000
mouseclick, left, 617, 332 ; 404, 318
sleep 200
send, PADRAO
;~ sleep 300
send, {TAB}
;~ sleep 300
send, %dir_executante%
;~ sleep 300
send, {TAB}
;~ sleep 300
send, %coordenador_operadora2%
;~ sleep 300
send, {TAB}
;~ sleep 300
send, %cliente%
;~ sleep 300
send, {TAB}
;~ sleep 300
send, %endereco%
;~ sleep 300
send, {TAB}
;~ sleep 300
send, %numero%
;~ sleep 300
send, {TAB}
;~ sleep 300
send, %bairro%
;~ sleep 300
send, {TAB}
;~ sleep 300
send, {TAB}
;~ sleep 300
send, %cep%
;~ sleep 400
send, {TAB}
;~ sleep 300
send, %cidade%
;~ sleep 300
send, {TAB}
;~ sleep 300
send, {TAB}
;~ sleep 300
send, %contato_nome%
;~ sleep 300
send, {TAB}
;~ sleep 300
send, %contato_tel%
;~ sleep 300
send, {TAB}
;~ sleep 300
send, {TAB}
;~ sleep 300
send, %centro_manutencao%
;~ sleep 300
send, {TAB}
;~ sleep 300
send, %tipo_coord%
;~ sleep 300
send, {TAB}
;~ sleep 300
send, %Servico% ; xxxxxxxxxxxxxxxxxxxxxx
;~ sleep 300
send, {TAB}
;~ sleep 300
send, %velocidade%
;~ sleep 300
send, {TAB}
;~ sleep 300
send, %atividade%
;~ sleep 300
send, {TAB}
;~ sleep 300
send, %Tecnologia% ; xxxxxxxxxxxxxxxxxxxxxx
;~ sleep 300
send, {TAB}
;~ sleep 300
send, %abordado%
;~ sleep 300
send, {TAB}
;~ sleep 300
send, {TAB}
;~ sleep 300
send, %descricao%

tooltip, % "Uia!!", 500, 800


sleep 2000
tooltip,
}
return

; atualiza data conne


#'::
{
clipboard_antigo := clipboard
clipboard =
;~ msgbox, ok
;~ Click
sleep 400
send, ^a
sleep 50
send, ^c
sleep 150
data_prevista := clipboard

INICIO3:
guiListboxFase() ; cabeçalho padrao gui contendo apenas a listbox
Gui, Show
return

MyListBox_fases:
if A_GuiEvent = Normal ; <> DoubleClick
{
GuiControlGet, MyListBox_fases
Escolha_Listbox = %MyListBox_fases%
gui, destroy
}
calcula_data(data_prevista,Escolha_Listbox)
clipboard := clipboard_antigo
return
}
return
guiListboxFase()
{

Gui, Add, Text,, Fase:


Gui, Add, ListBox, vMyListBox_fases gMyListBox_fases
w640 r10
GuiControl,,
MyListBox_fases, NOVO ; IDADE 0 OU 1
GuiControl,, MyListBox_fases,
PROJETO
GuiControl,, MyListBox_fases,
VISTORIA
GuiControl,, MyListBox_fases,
CONSTRUÇÃO
GuiControl,, MyListBox_fases,
LANÇAMENTO
GuiControl,, MyListBox_fases, FUSÃO
GuiControl,,
MyListBox_fases, CONSTRUÍDO
GuiControl,, MyListBox_fases,
AGUARDANDO DOC
GuiControl,, MyListBox_fases,
DOCUMENTADO
GuiControl,,
MyListBox_fases, FINALIZADO

}
return

calcula_data(data_prevista,Escolha_Listbox)
{

data_futura =
Time =
FormatTime, dia_atual, %Time%, dd ; h
FormatTime, mes_atual, %Time%, MM ; h
FormatTime, ano_atual, %Time%, yyyy ; h

stringmid, dia_data_prevista, data_prevista, 1, 2


stringmid, mes_data_prevista, data_prevista, 4, 2
stringmid, ano_data_prevista, data_prevista, 7, 4

if (dia_data_prevista > 0)
if (dia_data_prevista < 32)
if (mes_data_prevista > 0)
if (mes_data_prevista < 13)
if (ano_data_prevista > 0)
if (ano_data_prevista < 9999)
{
if ((dia_atual + 30*mes_atual + 365*ano_atual) > (dia_data_prevista +
30*mes_data_prevista + 365*ano_data_prevista))
{
escrever = 1
}
;~ else
;~ {
;~ msgbox, %dia_atual%/%mes_atual%/%ano_atual% <
%dia_data_prevista%/%mes_data_prevista%/%ano_data_prevista%
;~ }
}

if (escrever == 1 || clipboard == "")


{
if (Escolha_Listbox == "NOVO")
{
;~ msgbox, hoje + 20
Date := A_Now
Date += 20, Days
FormatTime, data_futura, %Date%, dd/MM/yyyy
sleep 200
send, %data_futura%
}
else if (Escolha_Listbox == "PROJETO")
{
;~ msgbox, hoje + 20
Date := A_Now
Date += 20, Days
FormatTime, data_futura, %Date%, dd/MM/yyyy
sleep 200
send, %data_futura%
}
else if (Escolha_Listbox == "VISTORIA")
{
;~ msgbox, hoje + 20
Date := A_Now
Date += 20, Days
FormatTime, data_futura, %Date%, dd/MM/yyyy
sleep 200
send, %data_futura%
}
else if (Escolha_Listbox == "CONSTRUÇÃO")
{
;~ msgbox, hoje + 15
Date := A_Now
Date += 15, Days
FormatTime, data_futura, %Date%, dd/MM/yyyy
sleep 200
send, %data_futura%
}
else if (Escolha_Listbox == "LANÇAMENTO")
{
;~ msgbox, hoje + 15
Date := A_Now
Date += 15, Days
FormatTime, data_futura, %Date%, dd/MM/yyyy
sleep 200
send, %data_futura%
}
else if (Escolha_Listbox == "FUSÃO")
{
;~ msgbox, hoje + 10
Date := A_Now
Date += 10, Days
FormatTime, data_futura, %Date%, dd/MM/yyyy
sleep 200
send, %data_futura%
}
else if (Escolha_Listbox == "CONSTRUÍDO")
{
;~ msgbox, hoje + 9
Date := A_Now
Date += 9, Days
FormatTime, data_futura, %Date%, dd/MM/yyyy
sleep 200
send, %data_futura%
}
else if (Escolha_Listbox == "AGUARDANDO DOC")
{
;~ msgbox, hoje + 8
Date := A_Now
Date += 8, Days
FormatTime, data_futura, %Date%, dd/MM/yyyy
sleep 200
send, %data_futura%
}
else if (Escolha_Listbox == "DOCUMENTADO")
{
;~ msgbox, hoje + 8
Date := A_Now
Date += 8, Days
FormatTime, data_futura, %Date%, dd/MM/yyyy
sleep 200
send, %data_futura%
}
else if (Escolha_Listbox == "FINALIZADO")
{
;~ msgbox, hoje + 8
Date := A_Now
Date += 8, Days
FormatTime, data_futura, %Date%, dd/MM/yyyy
sleep 200
send, %data_futura%
}
}

}
return

; FILTROS WFBR
------------------------------------------------------------------------
; filtros wfbr
#f::
{
inputbox, pesquisa_opcao,Opção,Escolha a opção de cliques:,,150,150
pesquisa(pesquisa_opcao)
clica(cProcurar)
}
return

pesquisa(opcao)
{
clica(cCM,"RCE")
if(opcao == 0)
{
clica(cStatus,"TODOS")
clica(cEmpresa,"TODAS") ; LIDER, IRTEL
clica(cTecnologia,"TODAS")
}
else if(opcao == 1)
{
clica(cStatus,"INTERROMPIDO")
clica(cEmpresa,"PROTELE") ; LIDER, IRTEL
clica(cTecnologia,"FIBRA EMBRATEL") ; FIBRA GPON
}
else if(opcao == 2)
{
clica(cStatus,"INTERROMPIDO")
clica(cEmpresa,"LIDER") ; LIDER, IRTEL
clica(cTecnologia,"FIBRA EMBRATEL") ; FIBRA GPON
}
else if(opcao == 3)
{
clica(cStatus,"INTERROMPIDO")
clica(cEmpresa,"IRTEL") ; LIDER, IRTEL
clica(cTecnologia,"FIBRA EMBRATEL") ; FIBRA GPON
}
else if(opcao == 4)
{
clica(cStatus,"INTERROMPIDO")
clica(cEmpresa,"PROTELE") ; LIDER, IRTEL
clica(cTecnologia,"FIBRA GPON")
}
else if(opcao == 5)
{
clica(cStatus,"INTERROMPIDO")
clica(cEmpresa,"LIDER") ; LIDER, IRTEL
clica(cTecnologia,"FIBRA GPON")
}
else if(opcao == 6)
{
clica(cStatus,"INTERROMPIDO")
clica(cEmpresa,"IRTEL") ; LIDER, IRTEL
clica(cTecnologia,"FIBRA GPON")
}
}
return

clica(opcao,escreve="",timming=100)
{
mouseclick,left,opcao.1,opcao.2
sleep, %timming%
if(escreve != "")
send, %escreve%
;~ sleep, %timming%
}
return

; ------------------------------------------------------------------------
;~ #IFWINNOTEXIST, ahk_class QWS3250X ; #iFWINNOTEXIST, ahk_exe qws3270x.exe
;~ #IFWINNOTEXIST, ahk_class QWS3250S ; ahk_exe qws3270s.exe
; /////////////////////
;~ AppsKey::
;~ {
;~ send, !{Tab}
;~ }
;~ return

;~ Rcontrol::
;~ {
;~ send, ^c
;~ }
;~ return

;~ RShift::
;~ {
;~ send, ^v
;~ }
;~ return
; /////////////////////
ins::
{
reload
}
return

#m::
{
mousegetpos, Mx, My
clipboard := Mx ", " My
msgbox, %clipboard%
}
return

#n::
{
mousegetpos, Nx, Ny
clipboard := Mx ", " My ", " Nx ", " Ny
msgbox, %clipboard%
}
return

Você também pode gostar