Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Fewyn
Wanderer


Joined: 27 Sep 2002
Posts: 83

PostPosted: Wed May 19, 2010 12:22 am   

Trying to add to a list
 
I'm attempting to take the output below and put it into already existing variable list but I'm not having any luck.

Code:
0 Creators:
22 Players: Acantha Falafel Huggy Ilde Inige Inskeme Karl Keita Kylmet Kyrnin Latanza Laule Nue Phagius Rolhan Shenandoah StYx Thakh Trqs Virga Viviene Zexium
22 Players, 22 Total


What I'm trying to use is below.

Code:
#trigger {* Players~: *} {priesttemp = %replace(%2," ", "|")}


For some reason it's not capturing all the names. Any ideas?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Wed May 19, 2010 12:32 am   
 
First off, you aren't doing any capturing so there's nothing %1 or %2:

* -- match but don't capture
(*) -- match and capture

If you need to preserve whatever is in @priesttemp, then you need to use a different tactic. The %replace() function as you are using it will overwrite whatever was already in @priesttemp.
_________________
EDIT: I didn't like my old signature
Reply with quote
Fewyn
Wanderer


Joined: 27 Sep 2002
Posts: 83

PostPosted: Wed May 19, 2010 12:44 am   
 
Ok I get that, but the replace doesn't seem to be working. It's fine that it'll replace it as all I want to do after I get the data into priesttemp is add it back to the main variable.

All I'm getting in @priesttemp atm is
Code:
Acantha Cthulhu Dasnamenlose Falafel Huggy Ilde Inige Inskeme Kaedes Karl Keita Kylmet Kyrnin Latanza Laule Noelle Nue Phagius Rolhan Thakh Trqs Virga Zexium
Which if I didn't royally duck up the replace it should have put the | where the spaces are should it not?
Reply with quote
Fewyn
Wanderer


Joined: 27 Sep 2002
Posts: 83

PostPosted: Wed May 19, 2010 12:48 am   
 
Nevermind I'm a moron, I fixed it. Thanks Matt
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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