Guest
Sep 3, 2010, 2:52 am UTCHome arrow Getting Started arrow Actions, Timers, & Triggers
header image
Actions, Timers, & Triggers
Written by Dreamless Dancer   
Nov 25, 2007 at 02:07 AM

Probably the most asked question when people first start working with Furbot is how to make the bot "do something", and the answer is fairly obvious, you set up a command in one of the four programmable sections of Furbot to make it do something when certain conditions are met. While for the most part, the syntax is simple to understand, it does require a bit of thought, and knowledge, on when Furbot executes them. The whole idea of using a bot is not that you can convince it to stay online forever and ever, but to make it interactive with the dream and the visitors which come to it. With the right combination of commands, you can develop a complex bot that will be flexiable and easy to adjust as your needs grow.

First we should lay out some groundwork and define what each section of the bot's programming sections does so we have some definative terms on what we will be covering in this section. Actions is what I call verbiage, that is anything that would "print" in the client. Triggers are the non-printing server commands, this covers a wide range of events, DS triggers, Furre movement, the connection opening and closing, and certain types of verbage, like bot initiated banish commands and emits. Even though the last two are verbiage, they are processed as triggers in the system. Actions takes care of everything that someone says, does, whispers, and will handle anything that is "printed" but not done by a furre but is not captured by the trigger system. There is a whole bunch of checks ahead of the verbiage processor that looks at the server command for such triggering events before the command is finally passed to the whisper processor, as it is called in the code. If it finds one of these "trigger" events, the program executes specific commands for it and then exits the verbiage processor at that point. The order of processing is:

  1. Is it the results of a LOOK command? A look command is VALID when the bot spots the portrait string from the server, the portrait first sets the color variable in the bot when it's spotted, then sets the internal flag for the verbiage processor to take the description portion of the results from the command and put it into the description variable.
  2. Is it a You See event? This is considered a null action on the part of the bot, it does nothing with it, just exits from the verbiage processor without causing any triggers or whisper processing to be conducted on it.
  3. is it a DreamUrl? If so, then the bot sets the dreamurl variable.
  4. Is it Furcadian Time? Set the Furcadia Time variables then.
  5. Is it a Banish reply? These are only acted upon if the botscript initiated the banish command, if you type one in on the send text buffer and manually send it to the server, the banish check subsystem is not triggered.
  6. Is it a "Who" paw, specifically for this, the bot is looking for the system.fsh icon which precedes the text of the strings sent from the server, the who paw system fsh 86 causes this section to act upon it and once it figures out what sort of line it is, it exits. At this time, because of, for the most part, the server does not send the number of players in a dream, and who's in the dream, this part of the processor does not much. Should this part be dropped in favor of letting the bot handle this as an emit event?
  7. Is it an emit? Emits are any server strings which contains a system.fsh image, once it determines this, it will replace the icon with a text equivalent so you can check which emit it was based on a single character, there's a table for you to use in figuring out which icon is replaced by what text. The replacement will be in the form of {N} letting you use an additional check on the second character of the resulting string to execute a trigger event for specific emits.
  8. Is it a summon or join string? This will cause the bot to execute any triggers for that event.

And finally, once we wade through all the above checks, we reach the whisper preprocessor of the verbiage processor. The preprocessor breaks down the string, stripping out the wonderful formatting of the string, and attempts to extract a name and message, in addition to determining what type of verbiage it is. If the preprocessor detects the bot's name in the string, it will exit, if it spots the fact that the line contains "you say" or "you whisper", it exits. This is why you can't cause actions to be acted on by the bot, it's a safety system designed to keep you from accidentally causing an endless recursion event on the bot. You really don't want the bot to be triggering an action, then because the action causes the bot to say something which causes an action, well, it can lock the program solid into a non-responsive state which will require application of the three finger salute to dismiss the program. If the preprocessor cannot determine if a furre said the string, the whisper processor is called upon with the "anything" flag. That permits you to capture and process verbiage such as info lines.

Last Updated ( Apr 24, 2009 at 06:24 AM )
<Previous   Next>
header image