Code: Select all
Gui, Add, Text, x10 y13, Mes:
Gui, Add, DropDownList, x42 y10 w83 vMes, Enero|Febrero|Marzo|Abril|Mayo|Junio|Julio|Agosto|Septiembre|Octubre||Noviembre|Diciembre
Gui, Add, DropDownList, x148 y10 w83 vAnyo, 2022||2023
Gui, Add, Button, default x155 y43 w60 h50, Lectura
Gui, Add, Button, x220 y43 w60 h50, Reset
Gui, Add, Text, x10 y46, Repeticiones:
Gui, Add, Edit, x85 y43 w40 Number vRepeticiones, 40
Gui, Add, Text, x24 y76, Segundos:
Gui, Add, Edit, x85 y73 w40 Number vSegundos, 155
Gui, Add, Text, x130 y76 w25 cRed vCounter
Gui, Add, Text, x130 y46 w25 cRed vIteracion
Gui, Add, Edit, center ReadOnly x10 y106 w230 cRed vPlanta
Gui, Show, w300 h135, Lectura curvas
return
GuiClose:
ExitApp
ButtonSiguiente:
Gui, Submit, NoHide
Next = 1
ButtonLectura:
Gui, Submit, NoHide
Reps = %Repeticiones%
Loop, %Repeticiones%{
GuiControl,, Iteracion, %Reps%
Reps -= 1
Sleep, 2000
Send, {F10}
Sleep, 60
Send, {Right}
Sleep, 60
Send, {Right}
Sleep, 60
Send, {Right}
Sleep, 60
Send, {Down}
Sleep, 60
Send, {Down}
Sleep, 60
Send, {Enter}
Sleep, 60
Loop, 5{
Send, {TAB}
Sleep, 60
}
Send, {Space}
Sleep, 60
Send, {TAB}
Sleep, 60
if(Mes = "Enero"){
month = 01
nextMonth = 02
} else if(Mes = "Febrero"){
month = 02
nextMonth = 03
} else if(Mes = "Marzo"){
month = 03
nextMonth = 04
} else if(Mes = "Abril"){
month = 04
nextMonth = 05
} else if(Mes = "Mayo"){
month = 05
nextMonth = 06
} else if(Mes = "Junio"){
month = 06
nextMonth = 07
} else if(Mes = "Julio"){
month = 07
nextMonth = 08
} else if(Mes = "Agosto"){
month = 08
nextMonth = 09
} else if(Mes = "Septiembre"){
month = 09
nextMonth = 10
} else if(Mes = "Octubre"){
month = 10
nextMonth = 11
} else if(Mes = "Noviembre"){
month = 11
nextMonth = 12
} else if(Mes = "Diciembre"){
month = 12
nextMonth = 01
}
Send, 01/
Sleep, 60
Send, %month%
Sleep, 60
Send, /%anyo%
Sleep, 60
Send {TAB}
Sleep, 60
Send, 01/
Sleep, 60
Send, %nextMonth%
Sleep, 60
if(Mes = "Diciembre"){
Send, 2022
} else{
Send, /%anyo%
}
Loop, 4{
Send, {TAB}
Sleep, 60
}
Send {Enter}
Sleep, 500
Send {TAB}
Sleep, 60
Send {TAB}
myVariable := CopyToVar()
CopyToVar(Wait=1) {
Save := ClipboardAll, Clipboard := ""
SendInput, {ctrl down}c{ctrl up}
ClipWait % Wait
Clip := Clipboard, Clipboard := Save
Return Clip
}
splitArray := StrSplit(myVariable, "\")
nombreArchivo := splitArray[7]
GuiControl,, Planta, %nombreArchivo%
ruta = C:\Curvas\%anyo%\%month%\
Send %ruta%
Sleep, 60
Send, {TAB}
Sleep, 60
Send, %nombreArchivo%
Send, {TAB}
Send, {TAB}
Send, {Enter}
Next = 0
Contador = %Segundos%
Loop, %Contador%{
if(Contador = 0) break
if(Next = 1) break
continue
Contador -= 1
GuiControl,, Counter, %contador%
Sleep, 1000
}
Sleep, 2000
Send, {Enter}
Sleep, 60
Send, {Down}
}