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


Joined: 21 Apr 2012
Posts: 1

PostPosted: Sat Apr 21, 2012 3:43 am   

Multi Line Trigger.
 
Trying to make a trigger that uses the same input, in this case someone entering the room. However I need it to change the command that it fires off each time somebody enters the room. Basically I am trying to set up something that will randomly sayto somebody something when they enter the room. I was trying to do it progressivly yet for some reason I can not find anything to use the same line and have it fire off in sequence the commands I want it to fire.

Basicly right now what I have is

%1 enters from the *


Sayto %1 blah blah blah blah

I need it to be more like

%1 enters from the *


sayto %1 line 1
sayto %1 line 2
sayto %1 line 3


how ever it only does one of the sayto commands at a time, each time somebody comes into the room.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Apr 21, 2012 5:25 pm   
 
1)don't use %1 in trigger patterns. It works, but it's a REALLY bad habit that can lead to unintended consequences (ranging from unexpected matches to security breaches a malicious player can exploit). See HELP PATTERNMATCHING for details on the alternatives.

2)when you want to capture something in the pattern to use it in the code, surround it in parentheses. If you wish to assign to a variable, you can also use &wildcardvarname without the parentheses. You cannot mix and match wildcards in this syntax, so only the %letter wildcards are valid choices and only one at a time (&%w%dvarname is not valid, for example). You may also be able to use *, but &*varname is equivalent to &varname.

3)check out the use of the #CASE command and the %ismember() function.
_________________
EDIT: I didn't like my old signature
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