#include <Constants.au3>
Global $acc = iniread("Relog.ini","Global","account","")
Global $pw = iniread("Relog.ini","Global","password","")
Global $path = iniread("Relog.ini","Global","path","")
While 1
Sleep(5000)
$cmd = "netstat -b"
$string2 = _CMDreturn($cmd)
$result = StringRegExp($string2, "(\[WoW.exe\]\s+TCP)")
If $result = 0 Then
TrayTip("", "Relogging....", 8)
wend
;MsgBox(0, $cmd, $result)
Func _CMDreturn($sCommand) ; Returns a the output of a DOS command as a string
$cmdreturn = ""
$stream = Run(@ComSpec & " /c " & $sCommand, @SystemDir, @SW_HIDE, $STDOUT_CHILD + $STDIN_CHILD)
While 1 ; loop through the return from the command until there is no more
$line = StdoutRead($stream)
If @error Then ExitLoop
$cmdreturn &= $line
WEnd
Return $cmdreturn
EndFunc ;==>_CMDreturn