Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Mjelvis
Newbie


Joined: 13 Feb 2002
Posts: 2
Location: Norway

PostPosted: 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.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: 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
Reply with quote
Mjelvis
Newbie


Joined: 13 Feb 2002
Posts: 2
Location: Norway

PostPosted: Thu Feb 21, 2002 12:10 am   
 
woo! Thanks!

Really, really bad boy.
Reply with quote
dracx
Beginner


Joined: 14 Oct 2000
Posts: 26
Location: USA

PostPosted: 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
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: 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
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net