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
JDVyska
Beginner


Joined: 18 Oct 2002
Posts: 13
Location: USA

PostPosted: Fri Oct 18, 2002 8:32 pm   

Passing inline ANSI map to window
 
I'm trying to figure out how to use an ANSI map a mud I go to uses in a very particular way. Here's a sample:


+---------+   Hall of Enlightenment

| | | [ north south ]
| | You see in this hallway a fountain. To drink from the fountain,
| | | just use the DRINK command. You will get thirsty from time to
| * | time and fountains are where you go to get a drink.For a list of
| | | all commands that are available to you, type COMMANDS. This
| | will give you a list seperated into groups with different
| | | functions. If you have a question about a command, try
+---------+ accessing the help file for that command.

A bubbling fountain is here in the middle of the hallway.

<90/90 116/116 226/238>


There are some ANSI blocks that represent rooms that don't show up here in the forums, but they often contain numbers showing the quantity of individuals in the room. So, I'd like to pipe the ANSI map to another window, but still show the room text in the main window. Sometimes the room description is longer than the map, sometimes shorter.

Were it not on the same lines, I would have already setup a #cap to grab it, but instead I tried one that #window's the map part and #show's the description part. This did not seem to work.

Thoughts?
Jeremy
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri Oct 18, 2002 10:38 pm   
 
quote:

I'm trying to figure out how to use an ANSI map a mud I go to uses in a very particular way. Here's a sample:


+---------+   Hall of Enlightenment

| | | [ north south ]
| | You see in this hallway a fountain. To drink from the fountain,
| | | just use the DRINK command. You will get thirsty from time to
| * | time and fountains are where you go to get a drink.For a list of
| | | all commands that are available to you, type COMMANDS. This
| | will give you a list seperated into groups with different
| | | functions. If you have a question about a command, try
+---------+ accessing the help file for that command.

A bubbling fountain is here in the middle of the hallway.

<90/90 116/116 226/238>


There are some ANSI blocks that represent rooms that don't show up here in the forums, but they often contain numbers showing the quantity of individuals in the room. So, I'd like to pipe the ANSI map to another window, but still show the room text in the main window. Sometimes the room description is longer than the map, sometimes shorter.

Were it not on the same lines, I would have already setup a #cap to grab it, but instead I tried one that #window's the map part and #show's the description part. This did not seem to work.

Thoughts?
Jeremy




#trigger {(+---------+) (*)} {#win AnsiMap %1;#sub {%2}}

#trigger {(~|[~|~* ]~|) (%*)} {#win AnsiMap %1;#sub {%2}}

Those should be the only two you need. The first one will be able to capture the first and last lines of the map, while the second will be able to match any line containing the two bounding pipes (|) and any combination of spaces, pipes, or asterisks.

EDIT: both triggers also replace the line with just the room text on that line.

li'l shmoe of Dragon's Gate MUD
Reply with quote
JDVyska
Beginner


Joined: 18 Oct 2002
Posts: 13
Location: USA

PostPosted: Sat Oct 19, 2002 10:48 pm   
 
Pretty good, but the problem is not all of the ANSI characters are getting ported over to the AnsiMap window. (It's also not handling lines of map where the isn't desciption, but I can fix that.) My sample couldn't show all of the characters, so here's a screenshot of the MUD's transmission:



and this is the result:



Thoughts?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Oct 19, 2002 11:50 pm   
 
Ok, not sure if the gray blocks can ever be picked up, but the other problems are not too hard.

1)when sending %1 to the map window, enclose in quotes:

#win AnsiMap "%1"

This should line up all the edges properly.

2)try inserting the actual characters into the [] list. If that doesn't work, try inserting an %char() function into the list. Probably won't work, but I can't think of anything else that could possibly generate or match an ansi symbol.

3)create two more triggers with the map portions of the previous patterns.

li'l shmoe of Dragon's Gate MUD
Reply with quote
JDVyska
Beginner


Joined: 18 Oct 2002
Posts: 13
Location: USA

PostPosted: Sun Oct 20, 2002 3:47 pm   
 
Super! I didn't need the blocks themselves, but when there's a number in them, I wanted to have that... without proper spacing it was unreadable. The blocks don't get transferred, but all else is OK.

Thanks MattLofton!

Jeremy
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