Yikes! Using per-host vars is complicated!
Using some UDFs:
 Code:
; load external functions via call if you don't copy/paste the content directly into this script
Call '.\FileIO.kxf'
Call '.\Ping.kxf'

; clear DONE flag
$Done = 0

; load list of monitored devices into an array
$aTargets = FileIO('.\ServerList.txt', 'R')
; Create a status array to match the targets
Dim $aStatus[UBound($aTargets)]
; Initialize the status array to Status:1
For $ = 0 to UBound($aStatus)
  $aStatus[$P] = 1
Next

; loop until all devices are at Status:3
While Not $Done
  Cls
  $Done = 1			; assume complete
  ; enumerate the list of targets
  For $P = 0 to UBound($aTargets)
    If Ping($Target)		; host is up - responds to Ping
      If $aStatus[$P] = 2	; prior status was down
        $aStatus[$P] = 3	; log the transition from down to up (Status:2 to Status:3)
      EndIf
      If $aStatus[$P] = 1	; not rebooted yet
        $Done = 0		; this host hasn't rebooted, we're not done
      EndIf
    Else
      $aStatus[$P] = 2		; Host is down - set Status:2
      $Done = 0			; this host is (still) down, we're not done
    EndIf    
    $Target ' is at Stage: ' $aStatus[$P] @CRLF
  Next
  Sleep 60			; wait 60 seconds and do it all again
Loop
'All hosts have completed the reboot process.' @CRLF
This is untested, and you should declare the vars, but basically, it loads a list of hostnames into an array. It creates a duplicate array to hold the per-host status, setting it to "1". It pings each host. If the host responds AND the status is 1, it does nothing but clear the DONE flag. If the host responds AND the status is 2, it moves to Stage:3 - reboot complete. If the host doesn't respond, it sets the Stage to 2 (down) and clears the DONE flag.

As long as the DONE flag is 0, the loop repeats the process (after the delay). When all hosts have rebooted and come back up (transitioned from stage 2 to 3), the DONE flag will not be cleared and the loop will exit.

You might want to add a test to insure that the process only runs 60 times (one hour, assuming a 60-second delay between loops). If you want this, just add a $L value, increment it prior to the Loop statement, and add If $L > 60 $Done = 1 EndIf.

In this case, there is never a transition from stage 3 back to 1. The program ends when all monitored systems have rebooted. Running it again starts from state 1.

You will need to add / modify the status messages as your requirements dictate.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D