YASSE
YASSE is the scripting engine developed for Avalon. It was developed mainly for DragonRealms and has many specific features for that. The scripting engine, itself, however, is very useful for Gemstone IV.
Script Compatibility
Most scripts written for the Wizard (Front End) are compatible, as are most written for StormFront. The major diffirence is simply variable naming conventions and it's normally straightforward to port scripts over.
Unique Features
- %roomname - This is a variable that all scripts have access to that is the name of the room you are in (or most recently PEERed into)
- %roomdescription - This variable contains the room description, as well as the "Also here:" and "Obvious exits:/paths:" line.
- Both of these variables are very useful for scripts that need to check the contents of a room without building a matchtable and then LOOKing. This makes scripts much faster and more effecient, as well as more precise. An example usage would be:
if %roomdescription contains miner BEGIN if %roomdescription contains Also goto move goto killminer END
- Triggers - These are basically match strings that will live in the memory, and every time they are matched will goto a subroutine of a running script, or call a separate script. Usage of this would be either in a script, such as this:
action [winks at you, flirting] goto flirtback
or from the command line you can set a trigger, such as:
-set trigger "winks at you, flirting" seduceher
which would run the script, "seduceher" when it matched that string. Triggers are cleared by the command:
-clear trigger
- getwordfrom - This command gets a word from a string variable and returns it to the variable %w. You simply tell it the variable, reference word, and then the number of words from that word you'd like. This is useful for when you'd like to work with the words around a match string, since every time a string matches, it saves that line to %l. For example:
action [I'll give you] goto getprice matchwait getprice: getwordfrom %l you 2
This will set a trigger to watch for the words "I'll give you" and then get the word two after the word "you" and save it to a variable. So when the, say, jeweler tells you how much they'll give you for the gem, it'll save that variable for you to echo out or save to a file. note: I can't actually make this work at the moment, though it did previously, it may be a bug in the version of YASSE I'm using or just user error.
- autostart script - This is a script that you can set to run each time that character is logged in. Usage would be from the command line and be:
-set autostart <scriptname>