!	 $eterna: wait,v 1.8 2014/03/14 20:59:18 mrg Exp $
!
! Copyright (c) 1990-2002  Michael Sandrof, Troy Rollo, Matthew Green,
! and other ircII contributors.
!
! All rights reserved.  See the HELP IRCII COPYRIGHT file for more
! information.
!
Usage: WAIT -CMD [%process] [<command> <do_command>]
  There are several forms of this command.  The first is:
    WAIT -CMD command

  WAIT causes the command to be executed when server output
  that hasn't yet arrived, finally arrives.  This allows you to
  take a specific action immediately after receiving output from 
  the server, or client.

  For example, the following alias:
    ALIAS BACKWARDS wait -cmd echo hello there;echo hi there
  will actually display "hi there" before "hello there", because
  the "hello there" echo is not executed until a WAIT token is
  received from the server.  If for instance you wanted to make
  sure to execute some command after the completion of a TRACE
  of your server, the format would be.
    TRACE
    WAIT -CMD command
  Note: This doesn't work for commands that depend on another server to 
  send you information. TRACE <remote server> for instance.

  The second form of the command is:
    WAIT -CMD %process command
  Where %process is a valid running processes id or name.  This is
  used to cause IRCII to execute the command after the process has
  exited.  If the given process doesn't exist, return is immediate.
  Here is an example of its use:
    alias uptime {
      exec -name uptime uptime
      wait %uptime -cmd echo The time is $uptime
    }
    alias dotime uptime
    on ^exec uptime assign uptime $1
  When dotime is called, a request will be sent to get the uptime.
  The ON EXEC will catch the time and assign it to the variable 
  'uptime' at the same time that the alias is at the 'wait %uptime'
  stage, when the process exits, WAIT will continue and execute 
  echo The time is $uptime, where '$uptime' has been set already.

  If you are echoing output to the screen from within the WAIT -CMD
  form, it is probably a good idea to record the current window
  and use XECHO -WINDOW to ensure that output goes where it should.

  The original form of WAIT is without -CMD no longer available.
