CLAC

CLAC is a CAOS function relating to the function of an activateable agents.

Activateable agents in CEE are either in CLAC mode, in which case they behave as described below, or they are in CLIK mode.

Usage
Syntax: CLAC X (integer)

This sets the message that will be sent to TARG when it is next clicked. X should therefore be one of a message number, or -1; in the latter case no message will be sent. Note that this function will switch an agent to CLAC mode if run while in CLIK mode.

Also note that early message numbers do not always correspond to script numbers. For instance, message 0 is activate 1, which is script 1. Tables of the two are contained in the CAOS documentation (MANN).

Syntax: CLAC

This returns the current CLAC value of the target agent (a message number or -1), or -2 if the agent is in CLIK mode.

Example
Two scripts from a very simple activateable agent of class 1 1 100. Clicking on the agent while deactivated activates, clicking while activated deactivates. This simple case is better achieved with CLIK, but CLAC can be more useful if some other action will deactivate the agent in some special way.

* activate script scrp 1 1 100 1 clac 1 endm
 * next click deactivates

scrp 1 1 100 0 clac 0 endm
 * deactivate script
 * next click activates