Core Help Root: Objects: Robot


$robot is an object for generic puppet type things. It can have reactions defined on it to respond to events in it's environment.

Commands

@reactions <this>
Lists information about the reactions defined on this. An asterisk in the left margin means that the reaction is activated. The numbers given here may be used by @activate-reaction and @deactivate-reaction.
@activate-r?eaction|@ar <number> on <this>
Activates the reaction number on the robot this. The number may be found by looking at @reactions this.
@deactivate-r?eaction|@dr <number> on <this>
Deactivates the reaction number on the robot this. The number may be found by looking at @reactions this.
@add-r?eaction <any> to <any> on <this>
Add a reaction with template to hook on this. Options follow the template and are as follows: +m?ethod Match the template with method. Accepted values are regexp, pattern, and template. The default is regexp. +t?ype Type of event to which to react. Valid values are tell to react to anything sent to .tell(), notell to react to everything not sent to .tell(), any to react to anything (inefficient and not recommended), or any social event (currently whisper, tosay, and remote). The default is tosay. +c?hance Percent chance that the reaction will be triggered. +ti?mes Number of times a reaction can be triggered before being deactivated. +a?rgs Arguments to give to hook after the match string, the output of the match method, and the sender. +min Minimum delay before triggering reaction (default: 0). +max Maximum delay before triggering reaction (default: same as min). If you wish to match any event of a given type, leave the template blank. If you give options, just don't specify a template at all. Otherwise, use "".
@del-r?eaction <number> from|on <this>
Delete reaction number from robot this, deactivating and unhooking if necessary.

Methods

How do I use it?

  1. Define the method to carry out the work of the response if needed. There are pre-defined utilty methods to help avoid this.
  2. Call @add-reaction and define your reaction.
  3. Call @activate-reaction to activate your new reaction.
  4. Experiment and have fun.



Colors | Trie | List Library | has_text | mutex | Heap | Weather System | Math Library | Integer | Data Lib | Object Lib | Help Node | Code Lib | Generic Map | Scrabble | World Time | Time | Robot | Native Function Reference | Complex Number Library | Bytecode Docs | motd | Mail List | Float | Collective | libraries | social_ui


the Cold Dark