Command utilities (#37)

$command_utils is the repository for verbs that are of general usefulness to authors of all sorts of commands. For more details about any of these verbs, use `help $command_utils:'.

Detecting and Handling Failures in Matching
-------------------------------------------
:object_match_failed(match_result, name)
Test whether or not a :match_object() call failed and print messages if so.
<img src=">layer_match_failed(match_result, name)
Test whether or not a :match_player() call failed and print messages if so.
<img src=">layer_match_result(match_results, names)
...similar to <img src=">layer_match_failed, but does a whole list at once.

Reading Input from the Player
-----------------------------
:read() -- Read one line of input from the player and return it.
:yes_or_no([prompt])
-- Prompt for and read a `yes' or `no' answer.
:read_lines() -- Read zero or more lines of input from the player.
:Dump_lines(lines)
-- Return list of lines quoted so that feeding them to
:read_lines() will reproduce the original lines.

Utilities for Suspending
------------------------
:running_out_of_time()
-- Return true if we're low on ticks or seconds.
:suspend_if_needed(time)
-- Suspend (and return true) if we're running out of time.

Client Support for Lengthy Commands
-----------------------------------
:suspend(args) -- Handle PREFIX and SUFFIX for clients in long commands.


You are not logged in.

[home | help | who | search | setup | code]