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


Joined: 09 Jun 2009
Posts: 6

PostPosted: Wed Jun 24, 2009 6:23 pm   

Converting a load of junk into something readable, help please!
 
Quote:
---------------------------------------------------------------------------------------------------------------------------------


A happy monkey is one south, a short monkey is one east, a rabid monkey is one southeast, a short monkey is one south and one northeast, a rabid monkey is one south and one east, a fluffy monkey is one south and one southeast, a rabid monkey is one east and one south, the limit of your vision is one southeast and one northeast from here, a fluffy monkey is one southeast and one south, a short woman and an old tabby cat are two southeast, the limit of your vision is two southeast from here, the limit of your vision is one south, one northeast and one east from here, the limit of your vision is one south, one northeast and one southeast from here, the limit of your vision is one south, one east and one northeast from here, a fluffy monkey is one south, one east and one south, the limit of your vision is one south, one east and one south from here, the limit of your vision is one south and two east from here, a short woman and an old tabby cat are one south, one east and one southeast, the limit of your vision is one south, one east and one southeast from here, the limit of your vision is one south, one southeast and one northeast from here, a short woman and an old tabby cat are one south, one southeast and one east, the limit of your vision is one south, one southeast and one east from here, the limit of your vision is one east, one south and one northeast from here, the limit of your vision is one east, one south and one east from here, a short woman and an old tabby cat are one east, one south and one southeast, the limit of your vision is one east, one south and one southeast from here, the limit of your vision is two east and one south from here, a short woman and an old tabby cat are one east, one southeast and one south, the limit of your vision is one east, one southeast and one south from here, a short woman and an old tabby cat are one southeast, one south and one east, the limit of your vision is one southeast, one south and one east from here, a short woman and an old tabby cat are one southeast, one east and one south and the limit of your vision is one southeast, one east and one south from here.
---------------------------------------------------------------------------------------------------------------------------------


A happy monkey, a gloating terrorist and a playful monkey are one northwest, a short monkey is one north, a fluffy monkey is one south, a short woman and an old tabby cat are one southeast, a happy monkey is one west, a happy monkey is one northwest and one south, a short monkey is one northwest and one east, the limit of your vision is one northwest and one east from here, a happy monkey is one north and one southwest, a happy monkey is one south and one northwest, a short woman and an old tabby cat are one south and one east, an accountant and a short monkey are one south and one southeast, a door northwest of one east and one northeast, a door north of one east and one northeast, Bob is one east and one northeast, a short woman and an old tabby cat are one east and one south, a shoe-shine boy and a sad monkey are two east, a tired-looking servant and an old tabby cat are one east and one southeast, a shoe-shine boy and a sad monkey are one southeast and one northeast, the limit of your vision is one southeast and one northeast from here, an accountant and a short monkey are one southeast and one south, a tired-looking servant and an old tabby cat are one southeast and one east, the limit of your vision is two southeast from here, the limit of your vision is two west from here, the limit of your vision is one northwest, one south and one west from here, the limit of your vision is one north, one southwest and one west from here, a door northwest of one north and two east, a door north of one north and two east, Bob is one north and two east, the limit of your vision is one north and two east from here, a shoe-shine boy and a sad monkey are one north, one east and one southeast, the limit of your vision is one north, one east and one southeast from here, a door northwest of one north, one southeast and one northeast, a door north of one north, one southeast and one northeast, Bob is one north, one southeast and one northeast, the limit of your vision is one north, one southeast and one northeast from here, a shoe-shine boy and a sad monkey are one north, one southeast and one east, the limit of your vision is one north, one southeast and one east from here, a tired-looking servant and an old tabby cat are one north and two southeast, the limit of your vision is one north and two southeast from here, a door northwest of one northeast, one south and one northeast, a door north of one northeast, one south and one northeast, Bob is one northeast, one south and one northeast, the limit of your vision is one northeast, one south and one northeast from here, a shoe-shine boy and a sad monkey are one northeast, one south and one east, the limit of your vision is one northeast, one south and one east from here, a tired-looking servant and an old tabby cat are one northeast, one south and one southeast, the limit of your vision is one northeast, one south and one southeast from here, the limit of your vision is one south, one northwest and one west from here, a door northwest of one south and two northeast, a door north of one south and two northeast, Bob is one south and two northeast, the limit of your vision is one south and two northeast from here, a shoe-shine boy and a sad monkey are one south, one northeast and one east, the limit of your vision is one south, one northeast and one east from here, a tired-looking servant and an old tabby cat are one south, one northeast and one southeast, the limit of your vision is one south, one northeast and one southeast from here, a shoe-shine boy and a sad monkey are one south, one east and one northeast, the limit of your vision is one south, one east and one northeast from here, an accountant and a short monkey are one south, one east and one south, the limit of your vision is one south, one east and one south from here, a tired-looking servant and an old tabby cat are one south and two east, the limit of your vision is one south and two east from here, the limit of your vision is one south, one east and one southeast from here, a tired-looking servant and an old tabby cat are one south, one southeast and one northeast, the limit of your vision is one south, one southeast and one northeast from here, the limit of your vision is one south, one southeast and one east from here, a shoe-shine boy and a sad monkey are one east, one northeast and one south, the limit of your vision is one east, one northeast and one south from here, a shoe-shine boy and a sad monkey are one east, one south and one northeast, the limit of your vision is one east, one south and one northeast from here, a tired-looking servant and an old tabby cat are one east, one south and one east, the limit of your vision is one east, one south and one east from here, the limit of your vision is one east, one south and one southeast from here, a tired-looking servant and an old tabby cat are two east and one south, the limit of your vision is two east and one south from here, the limit of your vision is one east, one southeast and one south from here, the limit of your vision is one southeast, one south and one east from here and the limit of your vision is one southeast, one east and one south from here.
---------------------------------------------------------------------------------------------------------------------------------


How can I convert stuff like this into something readable? i really have no idea how to start... as well as simplifying things to make it less of a scary wall of text I would like to stop it repeating alternate directions (the more obscure directions like "SE N from here" rather than the simpler "E from here" seem to come after)

basically I am after having it all replaced on my screen with something nice and simple like N: rabid monkey E: Bob (keeping the colour triggers for red/green etc I have)

thank you for any help at all :s
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed Jun 24, 2009 11:37 pm   
 
This is coming from your mud? That seems a bit warped--having it duplicate things like "one west" and "one south and one northwest" like that. If that's the normal output from the mud, I'd complain to the admins.

Restructuring this output yourself will be a bit tricky (but I do love challenges Smile ). First, is this all in one continuous line? That will make it much easier. Do you already have an easy way to trigger off this line? For now, I'll assume you do, and start thinking about how to parse the line itself.

The first step is breaking it into pieces. It looks like there are several patterns for the pieces:
<mobs> {is|are} <directions>{ and |,|.}
the limit of your vision is <directions> from here{ and |,|.}
a door <direction> of <directions>{ and |,|.}

So, the procedure I'd use is to break the text into these pieces, parse the directions into a coordinate system, and create a database variable containing the contents of each point in the coordinate system. As a first try, I'd use a regex (actually, probably several regexes, for the different patterns) to parse the text into a first piece and remainder, and repeat it on the remainder until complete. When done, you simply loop through the db variable, formatting the output the way you want. I will think further about an exact procedure. Two questions for you: do you want to display the doors? the limits of vision?
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Thu Jun 25, 2009 1:05 am   
 
Is that some sort of crazy labyrinth that is supposed to confuse you? If not, that is insane. I wouldn't even play that MUD. It would take you 10 minutes just to figure out where you are and what is in the room. I'd at least ask the admins to do something about it since the whole point is they are supposed to be providing an environment that allows people to play their game, not scare them off. Unless of course they don't want players, but well...why have an online game then.
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