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


Joined: 05 Apr 2004
Posts: 4

PostPosted: Sat May 01, 2004 7:02 pm   

Help with Text Parsing
 
I'm trying to make a script that will take the exits in a room and put them into a list. The only problem is I can't seem to figure out how to parse out the individual exits. IE:

You see exits leading north, northeast, east, southeast, south, southwest

I want to make a list that contains all of those exits so that if I need to flee, I can type flee, and it will pick a random direction and go.

Any help would be appreciated
Reply with quote
jessew
Apprentice


Joined: 03 Mar 2003
Posts: 141

PostPosted: Sat May 01, 2004 10:25 pm   
 
#TRIGGER {You see exits leading (*)} {exitlist = %replace("%1",",","|")}

Just grab everything replace the commas with list seperator | and you have an insta-list

Jesse
Reply with quote
Odross
Newbie


Joined: 05 Apr 2004
Posts: 4

PostPosted: Sat May 01, 2004 11:58 pm   
 
Ok, sweet! Thanks for that. Just one more question. Is there anyway I can use %item(@exitlist,%random(1,@roomcount) to output the actual direction to the mud I'm playing? I've been messing around with it, and it just seems to put in a carriage return when I try and fire the alias.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun May 02, 2004 12:13 am   
 
Make sure you match up your parentheses, results are unpredictable when you don't close them all.
#AL flee {%item( @exitlist, %random( 1, %numitems( @exitlist)))}
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