[MudWalker] sample aliases/triggers
Blastron
blastron
Thu Nov 27 10:09:18 PST 2003
Sure! Not sure how these would help with your particular
MUD/MUSH/whatever, but you could look at 'em and see how they're put
together. All of these scripts are written in Lua in substitution.
I'll follow each one with a little explanation so you can see why I do
things this way...
Alias Name: Set Target
Command: target
Script:
@@target=arg[1]
@@message("You have targeted " .. target .. ". Have a nice day!")
The @@ tells MudWalker that this line is written entirely in Lua, and
the text is not to be sent literally to the MUD server.
arg[1], arg[2], arg[3], and so forth are additional arguments that you
can add to the script directly from the prompt. For example, if you
wanted to target a werewolf, you would type TARGET WEREWOLF into your
prompt. After that, for every instance that arg[1] appears in the
script, it would be replaced by the text "werewolf".
target=arg[1] sets a global variable named "target" to whatever
argument you added in for arg[1]. A global variable is a variable that
remains constant until you quit MudWalker or change the variable,
whichever comes first.
message("whatever") causes text to appear on your screen. It doesn't
do it for anyone else, just you. This could be reminder text,
confirmation text, etc. If you have a variable that you wish to
include in your text, close the quote, add two periods, the variable
name, then two more periods, then open the quote again.
Alias Name: Punch Target
Command: pt
Script:
punch $(target)$
Very simple script: It calls upon the variable "target" that you set
using the above script and sends the command to punch that target to
the server. The only thing of note is that you can use Lua commands
inside a line that does not start with @@ by enclosing them in dollar
signs and parentheses $(like this.)$ Doing this will cause the Lua
commands to execute, then place whatever results they return into the
place where the commands were in the text.
Alias Name: Crystalism-Tremors Vibration
Command: tremors
Script:
outr egg
outr disc
spin egg
spin disc
embed tremors
You don't have to use any Lua code at all, if you don't want it.
Aliases can be used simply for automating tedious tasks. Or, if you
want, you could set a longer command to be executed by one or two
letters, for instance, touching a shield tattoo, which generates a
handy, protective magical shield, would ordinarily be "touch shield",
which might be tough to type in combat, but "ts" would be very easy to
type.
Now, on to some triggers.
Trigger Name: Follow Detector
Match Patterns: ^(.*) begins to follow you.
Make command link: Yes
Command Link command: lose $(arg[1])$
Substitute text: Yes
Substitute text text: $(arg[1])$ begins to follow you. Click here to
give 'em the boot.
Script: None
This is a deceptively complicated script, but it shows you just how
powerful the MudWalker trigger engine is. When someone starts
following you, this script will change the "Whomever begins to follow
you." into "Whomever begins to follow you. Click here to give 'em the
boot." and make it into a clickable link that will lose whomever
started to follow you.
^(*.) is used whenever you want MudWalker to recognize one word of text
in a line sent to you and use it in a script. arg[1], arg[2], etc.
will recognize each ^(*.) and use it in a command.
And now for my awe-inspiring power-up script...
Alias Name: Start Powering Up
Command: Powerup
Script:
@@ message("Beginning powerup sequence.")
channel earth
@@ powerup=1
@@ message("Channels 25% open.")
Trigger Name: Continue Powerup Sequence
Match Patterns: You have recovered equilibrium.
Script:
@@ if powerup==1 then
channel fire
@@ powerup=2
@@ message("Channels 50% open.")
@@ elseif powerup==2 then
channel water
@@ powerup=3
@@ message("Channels 75% open.")
@@ elseif powerup==3 then
channel air
@@ powerup=4
@@ message("Channels 100% open. Now casting defensive spells.")
@@ elseif powerup==4 then
cast stoneskin
@@ powerup=5
@@ message("Stoneskin armor cast.")
@@ elseif powerup==5 then
cast reflection at me
@@ powerup=6
@@ message("Reflection cast.")
@@ elseif powerup==6 then
cast chargeshield at me
@@ powerup=7
@@ message("Electric dispersal shield cast.")
@@ elseif powerup==7 then
@@ powerup=0
@@ message("Startup sequence complete. You are at full combat
readiness.")
@@ end
Big, complicated script. The alias sets it all in motion, and the
trigger continues it until you finish powering up. In the MUD I play,
equilibrium is temporarily lost when you cast a spell, although you
automatically regain it after a brief duration.
You can have MudWalker test existing conditions by using the
if/elseif/else/end command. YOU MUST USE TWO EQUALS SIGNS INSTEAD OF
ONE WHEN TESTING VARIABLES! Otherwise, the if statement would set the
variable to whatever it was looking for instead of testing to see if
the variable is what you were looking for.
Hm, I think that's about it. If you have any questions or anything,
don't hesitate to send me a reply.
On Wednesday, November 26, 2003, at 08:04 AM, Y. J. Chun wrote:
> Hello.
>
> Does anyone have sample aliases and triggers so i can
> start with? I used to play with tinyfugue but lost the
> script file and starting with MudWalker now.
>
> Thanks.
More information about the MudWalker
mailing list