Guest
Feb 5, 2012, 8:59 pm UTCHome arrow Then Do Something arrow Then DO Something!
header image
Then DO Something!
Written by Dream Dancer   
Nov 26, 2007 at 07:10 AM

Then commands are the means by which you make the bot do something. It's a complete waste of time and effort to use a bot program in a dream if all you're going to do is let the bot sit there. Might as well put it to work. 

There is, currently, 104 effects you can use to cause things to happen with Furbot. Some of them no longer work as expected, or don't work the way you think they should, or what not. For example, there's a Boot {#0} command, but unless you have boot privileges on the server, it ain't going to do anything. There's a few commands which are currently disabled, like:

$DATABASE: (!) Set variable {#0} to contain list of all entrys in db {#1} in table {#2} value {#3} filter away if value is {#4}

Because I'm not certain how I'm going to implement that. And the command remains in the list because even though you're reading all that nice text concerning the command, internally, Furbot does things by the numbers. The above command for instance, is command #54. If I remove that command, it will cause errors and misfires in the program, and we can't have that. And, at some point in time, I might actually get around to implementing that command, whatever it's supposed to do.

Let's do an example:

Action Name: Help Me List A
 Stop Action Search if TRUE
If {*} Whispers me {help}
   No Additional Conditions.
THEN:
      $LOG: Set variable {[helplist]} to contain list of record names which logs contain {*} in file {[appdir]dmghelp.log} sorted
      Whisper back {help list: [helplist]}

Action Name: Help Me With
 Stop Action Search if TRUE
If {*} Whispers me {help *}
AND:
    if {[startingword2]} is on the list in file {[appdir]dmghelp.log}
THEN:
      $LOG: Set variable {[helplist]} to contain all entries in record {[startingword2]} in file {[appdir]dmghelp.log}
      Whisper back {[startingword2]: [helplist]}

Action Name: Help Me Not Listed
 Stop Action Search if TRUE
If {*} Whispers me {help *}
   No Additional Conditions.
THEN:
      $LOG: Set variable {[helplist]} to contain list of record names which logs contain {*} in file {[appdir]dmghelp.log} sorted
      Whisper back {help list: [helplist]}

Wordy! But fairly simple to understand. Furbot will accommodate a huge number of effects you can implement in any THEN section of the command, the limit is your imagination on how you want to use them. But the above is how I implement a help command with the bot, I put all the possible help commands into a logfile, then use the record name of the logfile to extract the specific help command I want, if it exists, and whisper it back to the triggering furre. Notice that I'm using two different syntax checks on the command, one is {help} while the other is {help *}. The * when used with initial command parameters on Actions, (which I call internally as verbage, that's when the server sends a command which is displayed in the target furre's chat buffer), causes everything after the first matching word, if any, to match whatever was "said". Which is why, unless you're writing an Action for a specific named furre, the default entry for triggering furre is *. But anywho, on just the word help, the bot fetches the list of records from the help file, and sends them back to the triggering furre. In the second and third commands, if there's a record matching [startingword2] in the list of records, that entry is whispered back to the triggering furre, and command processing stops because the command triggered. If it fails the Additional Condition check, that is, there is no record matching [startingword2], then the bot fetches the list of records from the help file, and whispers it back to the triggering furre.

I'll post more examples and usages of the syntax as time goes by. And you can help too if you want to expand the use and functionality of Furbot. 

Last Updated ( Nov 26, 2007 at 10:50 PM )
Next>
header image