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
john_taylor_jr
Wanderer


Joined: 17 Jan 2003
Posts: 57
Location: USA

PostPosted: Sun May 09, 2004 1:33 am   

Repeating trigger
 
I get a who line like this

Daniel Fier June Minion Zithrine
Darlagr Fireball Kajai Mogato

As you can see the number of players on a line is variable in length
Is their a way I can set a trigger to repeat its self.
So that (%w)%s will repeat its self and capture each
name and then is their a way I can add each of the names I capture to a string list without knowing the number of names I will get.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sun May 09, 2004 1:52 am   
 
AS an example only and me being tired but still :P

#TRIGGER "whobegin" {LINE RIGHT BEFORE WHO LIST STARTS DISPLAYING NAMES} {who="";#D+ whonames}
#TRIGGER "whonames" {^*$} {#var who %concat(@who,|,%replace(%1," ",|)}
#TRIGGER "whoend" {LINE RIGHT AFTER WHO NAMES LINE} {#T- whonames}

if there is a blank line after the last of your names and not a pattern then use this for the pattern in the whoend trigger ^$
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun May 09, 2004 5:24 am   
 
#TR whonames {(*)} {#FORALL %replace( "%1", " ", "|") {#ADDI players {%i}}}
Of course, you'd need something similar to what nexela has so the trigger is only active during the who listing. Make sure the "whoend" trigger is higher in the trigger list than the "whonames" trigger, or you may have to constantly delete the last few items.

A speed menu item would be easier to control. Just right-click at the desired line and select Players, every word on that line will be added to the list.
#MENU Players {#FORALL %replace( %selline, " ", "|") {#ADDI Players {%i}}}
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