|
Odross Newbie
Joined: 05 Apr 2004 Posts: 4
|
Posted: 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 |
|
|
|
jessew Apprentice
Joined: 03 Mar 2003 Posts: 141
|
Posted: 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 |
|
|
|
Odross Newbie
Joined: 05 Apr 2004 Posts: 4
|
Posted: 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.
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: 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)))} |
|
|
|
|
|
|
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
|
|