ircII help - wait

Usage: WAIT -CMD [%process] [<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.

Top level index