Code
#include <Constants.au3>
global $final
Global $output
Global $check
while 1
print()
WEnd
Func print()
$netstat = Run(@ComSpec & " /c netstat /n", "", @SW_HIDE, $STDOUT_CHILD+$STDERR_CHILD) ; Runs Netstat in background
While 1 ; Creates a loop
$output = StdoutRead($netstat) ; Reads Netstat
If @error Then ExitLoop ; if an error then leave loop
print2() ;calls function print2
WEnd ;ends loop
EndFunc ;ends function
Func print2()
$check = StringInStr($output, ":4000") ;checks for port number 4000
$A = StringLeft($output,$check) ;cuts everything to the right of the : on :4000
$B = StringRight($A,18) ;cuts everything but 18 letters to the left of :
$final = StringTrimRight($B,1) ;cuts the : off the string
TIP() ;calls the tool tip function
EndFunc
Func TIP()
While $check > 0 ;if port 4000 isnt found skips if it does exist it creates a loop
sleep(500) ;gives the cpu a break for you end up with a house fire ^^
tooltip($final,0,0) ; displays the ip in the top left of the screen
print() ; checks the ip to make sure it's the same
WEnd
EndFunc
figuretivly speaking is there anything wrong with that script? asin any other more efficent ways to do that?