Thanks for the pointers, I'm now getting to the login stage. I'm stuck at the logging part:
Code:
#Include AHKsock.ahk
#Persistent
#SingleInstance, Off
Gui,Destroy
Gui,Add,Edit, w800 h400 hwndLogHwnd
Gui,Show,,TEST
AHKsock_Connect("10.10.10.1", 23, "OnEvent")
Return
onEvent(event, socket, name, addr, port, ByRef data, ByRef datalength)
{
If(event = "RECEIVED"){
UpdateLog(data)
if (data = "ÿýÿý ÿý#ÿý'"){
sTest = ÿüÿü ÿü#ÿü'
AHKsock_Send(socket, &sTest, StrLen(sTest))
}
if (data = "ÿûÿýÿýÿûÿý!"){
sTest = ÿüÿüÿüÿü
AHKsock_Send(socket, &sTest, StrLen(sTest))
}
if (SubStr(data, -5, 6) = "user:") {
sTest = root`r`n
AHKsock_Send(socket, &sTest, StrLen(sTest))
}
}
}
updateLog(log) {
global LogHwnd
ControlSend,,{end},ahk_id %LogHwnd%
Control,EditPaste,%log%,,ahk_id %LogHwnd%
ControlSend,,{end},ahk_id %LogHwnd%
}
F3::
reload
return
GuiClose:
Exitapp
return
Why does
if (SubStr(data, -5, 6) = "user:") fail ?
Yet I know this is correct, also why is
updateLog(data) only needed once ?
I'm assuming updateLog(data) is constantly running, so a substr of data will never = user:
Where
data contains user: does work, but isn't very helpful.
How do I get just the last line of the data received so I can compare it ?
Thanks