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


Joined: 02 Oct 2004
Posts: 12

PostPosted: Sat Oct 09, 2004 9:25 am   

Substitute trigger
 
I made the next trigger:
pattern: ({@grouplist})( )
value: #IF (("%1" <> " ") and ("%1" <> "")) {#SUBSTITUTE {%1" (F"%ismember(1,@grouplist)") "}} {#NOOP}
The members of my group are in the @grouplist variable. I wanna display F1 F2 and so on after names. (I assign macros to these keys).
When grouplist is empty, %1= "" or " ". The #if command helps avoid trigger loop.
What is the problem? This trigger doesnt work, when there are 2 or more names in one line, but i dont know why. For example Xy is a member of group, and the message is Xy heals Xy, i expect a sub like this: Xy (F1) heals Xy (F1), but i get a sub like this: Xy (F1) heals ((Xy <> ) and (Xy <> )) {#SUBSTITUTE {Xy (F1) }} {#NOOP}.

Please help me someone!
Reply with quote
donki1
Beginner


Joined: 02 Oct 2004
Posts: 12

PostPosted: Sun Oct 10, 2004 5:32 pm   
 
I tryed other ways for substitute names, but none of them works.
For example i higlight three names, because they are enemy. They are AA BB and CC.
AA just make a title for self like "AA, son of BB and CC". That means 3 highlights in one line - for me, and my zmud display something very crazy things in 10 lines. Is it impossible to substitute two or more words in one line?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5187

PostPosted: Sun Oct 10, 2004 7:25 pm   
 
Try using #PSUB and turning off the Trigger on Trigger option.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Oct 10, 2004 7:49 pm   
 
Because of the way #SUBSTITUTE works, it should not be combined with other commands. Either don't leave the variable empty or use %if inside the #SUB command to exclude empty values.
Also corrected the typo of 1 rather than %1 in %ismember.
pattern: ({@grouplist})(%q)
value: #SUBSTITUTE {%if( "%1", "%1"" (F"%ismember( "%1", @grouplist)")")%2}
_________________
LightBulb
Senior member

Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious.
Reply with quote
donki1
Beginner


Joined: 02 Oct 2004
Posts: 12

PostPosted: Sun Oct 10, 2004 9:48 pm   
 
Thanks a Lots!
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