|
Mjelvis Newbie
Joined: 13 Feb 2002 Posts: 2 Location: Norway
|
Posted: Wed Feb 20, 2002 7:01 pm
Backstab script |
I'm trying to make a script, for Dragonstone, like so:
Trigger: bs [target name]
Effect: Sneak
Wear dagger
Backstab [target name]
Wear sword
Now, the problem is the target name part. How would I script so zMUD enters the name of the mob I entered after the trigger (bs)?
Any help would be much appreciated.
Really, really bad boy. |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Wed Feb 20, 2002 7:09 pm |
#ALIAS bs {sneak;wear dagger;backstab %1;wear sword}
Usage:
bs target
where target is a one word argument specifying who you want to backstab.
The %1 inside the alias tells zMUD to put there the first word that comes after the name of the alias.
Kjata |
|
|
|
Mjelvis Newbie
Joined: 13 Feb 2002 Posts: 2 Location: Norway
|
Posted: Thu Feb 21, 2002 12:10 am |
woo! Thanks!
Really, really bad boy. |
|
|
|
dracx Beginner
Joined: 14 Oct 2000 Posts: 26 Location: USA
|
Posted: Fri Feb 22, 2002 6:52 pm |
Not to dispute the guru or anything,
but in my opinion, you should %-1 instead of %1 on an alias like that incase you ever need to enter more than one word for the target. You may not have any such creature now, but using %-1 now will mean that if such a need should ever arise, you won't need to go digging through all your code to fix something with just one character.
with %-1...
"bs big dog"
will work.
Drac-X |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Fri Feb 22, 2002 7:18 pm |
Yup, that is correct. I used %1 instead, however, because most MUDs don't allow more than one keyword to refer to a mob. However, %-1 gives it extra functionality, like you said.
Kjata |
|
|
|
|
|