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


Joined: 15 Oct 2002
Posts: 10
Location: Poland

PostPosted: Wed May 21, 2003 2:25 pm   

Trigger 2 times in a line
 
Hello,

The trigger I have works just great when there is only one pattern which fires it in line. It looks like that:

pattern:
(%x %x {male|female} {human|elf|dwarf|hobbit|kender|gnome|minotaur|goblin})
script:
#IF %ismember("%1",@desclist) {#SUB {%1 "["%item(@namelist,%ismember("%1",@desclist))"]"}}

It fires when a player description shows on the screen and then adds that player's name after the description, for example:

blue-eyed black-haired male elf
changes to
blue-eyed black-haired male elf [Thardriel]

Desclist and namelist are string variables with descriptions and names in a proper order.

The problem is that when two descriptions show in one line, it works well only with the first one, and shows strange things in place of a second description.

blue-eyed black-haired male elf and tall muscular male goblin
changes to
blue-eyed black-haired male elf [Thardriel] and 150 {#SUB {tall muscular male goblin [Burk]}}

The number in red changes to a number that is a position of a name/desc in the list.

Does anybody have any clue how to change it?
Thanks in advance.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5187

PostPosted: Thu May 22, 2003 12:18 am   
 
Putting paranthesis around the #IF expression should help, but may not fix it.
#IF (%ismember("%1",@desclist)) {#SUB {%1 "["%item(@namelist,%ismember("%1",@desclist))"]"}}
Reply with quote
romciom
Beginner


Joined: 15 Oct 2002
Posts: 10
Location: Poland

PostPosted: Thu May 22, 2003 8:33 am   
 
Thanks, but it doesn't work. The only change is that now there is paranthesis around the number...

blue-eyed black-haired male elf [Thardriel] and (150) {#SUB {tall muscular male goblin [Burk]}}

Any more ideas?
Reply with quote
Dumas
Enchanter


Joined: 11 Feb 2003
Posts: 511
Location: USA

PostPosted: Thu May 22, 2003 10:44 am   
 
Hmm...try going to the options tab on the settings editor for this trigger and make sure Trigger on Trigger is off on the bottom left.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Thu May 22, 2003 11:34 am   
 
What version are you using?

Try changing the command of the trigger to:
#IF (%ismember("%1", @desclist)) {#SUB {%concat("%1", "[", %item(@namelist, %ismember("%1", @desclist)), "]")}}

If it doesn't work, then I think this is a bug with #SUB. I've sometimes seen #SUB work strangely when it is not the only command.

Kjata
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5187

PostPosted: Thu May 22, 2003 10:11 pm   
 
You can also change the trigger pattern to:
({@desclist})
This will allow you to eliminate the #IF check.
Reply with quote
romciom
Beginner


Joined: 15 Oct 2002
Posts: 10
Location: Poland

PostPosted: Fri May 23, 2003 3:58 pm   
 
Changing the pattern to ({@desclist}) and deleting the #IF part worked!

Thanks a lot everyone!
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