d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Autoit Question > Yup
Add Reply New Topic New Poll
Member
Posts: 238
Joined: Apr 15 2013
Gold: 55.00
Apr 22 2013 12:03am
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?
Member
Posts: 4,694
Joined: Sep 21 2008
Gold: 1,231.00
Apr 22 2013 12:56am
AutoIt must not be discussed in these forums
rules in sticky
Member
Posts: 238
Joined: Apr 15 2013
Gold: 55.00
Apr 22 2013 01:03am
Quote (IamnotZ @ Apr 22 2013 02:56am)
AutoIt must not be discussed in these forums
rules in sticky


ah didnt read but that's retarded you can do everying in anyother language if not more..
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Apr 22 2013 11:57am
Quote (dem0nbyte @ Apr 22 2013 03:03am)
ah didnt read but that's retarded you can do everying in anyother language if not more..


so we have been saying for years but it is not going to change.

maybe convert it to C and repost if this one gets locked lol.
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll