|
Mattsc23 Beginner
Joined: 07 Dec 2002 Posts: 12 Location: USA
|
Posted: 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.
|
|
|
|
fattony Apprentice
Joined: 27 Dec 2001 Posts: 105 Location: USA
|
Posted: Sat Dec 07, 2002 9:10 pm |
Try
#TRIGGER {DISARMS you and sends a (%*) flying.} {pick up %1}
Fat Tony |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: 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 |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: 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 |
|
|
|
Mattsc23 Beginner
Joined: 07 Dec 2002 Posts: 12 Location: USA
|
Posted: 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 |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: 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 |
|
|
|
|
|