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
hoax808
Newbie


Joined: 05 Nov 2001
Posts: 3
Location: USA

PostPosted: Mon Nov 12, 2001 8:09 pm   

Triggers and variables
 
Ok, I'm trying to make a "follow script" so when an NPC leaves, I can follow it. But my mud output is weird. It goes like this:

Rat looks about wildly for an exit!
Rat leaves southeast.

As you can see it's a multiple line thingy. Kind of a pain in the butt. Can someone help me with this?

Hoax Latimer @ Moral Decay
131.247.113.1 3003
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Mon Nov 12, 2001 8:24 pm   
 
The quick and dirty method would be to use two triggers:


#TR {(%w) looks about wildly for an exit!} {#VAR prey %1}
#TR {{@prey} leaves (%w).} {%1;kill @prey; #VAR prey ""}


But that might cause problems if something flees from someone else in the room and you follow it. A safer way is to create an alias:


#AL k {#VAR prey %1; kill %1}
#TR {{@prey} looks about wildly for an exit!} {#VAR mobfled 1}
#TR {{@prey} leaves (%w).} {#IF @mobfled {#VAR mobfled 0; %1; kill @prey}}
#TR {You have KILLED {@prey}} {#VAR prey ""}





Troubadour
Reply with quote
Acaila
Apprentice


Joined: 30 Aug 2001
Posts: 187
Location: Netherlands

PostPosted: Mon Nov 12, 2001 10:01 pm   
 
Just something I've been wondering about lately, would the following be valid?

#TRIGGER {^Rat looks about wildly for an exit~!$Rat leaves southeast} {blahblah}

Acaila
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Nov 12, 2001 10:25 pm   
 
quote:

Just something I've been wondering about lately, would the following be valid?

#TRIGGER {^Rat looks about wildly for an exit~!$Rat leaves southeast} {blahblah}

Acaila



Definitely. Of course (as you know, though probably didn't spend the time on), I'd change Rat to @prey...

li'l shmoe of Dragon's Gate MUD
Reply with quote
Acaila
Apprentice


Joined: 30 Aug 2001
Posts: 187
Location: Netherlands

PostPosted: Mon Nov 12, 2001 11:17 pm   
 
I just used the rat as an example, but thanks

Acaila
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