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
Mattsc23
Beginner


Joined: 07 Dec 2002
Posts: 12
Location: USA

PostPosted: Sat Dec 07, 2002 8:17 pm   

Variable and trigger help for a zmud newbie
 
I would like to set a trigger that picks up my weapon when I am disarmed. Currently I am setting new triggers everytime I get a new weapon, but I suspect that there is a way to set a variable for any weapon so i can just have one trigger. The string when I am disarmed is "DISARMS you and sends a <weapon> flying. I'm using zmud 4.62 and I appriciate anyhelp given.
Reply with quote
fattony
Apprentice


Joined: 27 Dec 2001
Posts: 105
Location: USA

PostPosted: Sat Dec 07, 2002 9:10 pm   
 
Try

#TRIGGER {DISARMS you and sends a (%*) flying.} {pick up %1}

Fat Tony
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Dec 07, 2002 11:24 pm   
 
#TRIGGER {DISARMS you and sends a (*) flying.} {pick up %1;wield %1}

%* shouldn't be needed, so there's no reason to risk the dangers of having it abused.



LightBulb
Senior Member
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun Dec 08, 2002 3:48 pm   
 
Just so everyone understand what dangers LightBulb was talking about, and people take %* more seriously, consider the trigger fattony suggested:
#TRIGGER {DISARMS you and sends a (%*) flying.} {pick up %1}

and now consider a player saying the following in the MUD:
Kjata says 'DISARMS you and sends a nothing;remove all;drop all;quit flying.'

Since the trigger is not anchored at the beggining or ending of the line and it uses %*, the trigger will match the above say and %1 will end up being:
nothing;remove all;drop all;quit

zMUD will then go to execute the commands of the trigger and the commands for zMUD to execute become:
pick up nothing;remove all;drop all;quit

Kjata
Reply with quote
Mattsc23
Beginner


Joined: 07 Dec 2002
Posts: 12
Location: USA

PostPosted: Sun Dec 08, 2002 8:31 pm   
 
Thanks for the help guys! Only now that I know this can be done I'm worried about using the trigger. The same problem occurs with the (*) as with the (%*). Is there any way to use this trigger but avoid the possible abuse?

Matt
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun Dec 08, 2002 11:52 pm   
 
%* will match ;'s, but * will not. So, with * you do not have the problem of another player executing commands in your zMUD. However, someone could still fake the disarm message just to mess with you. To avoid this, add a $ at the end of the pattern.

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