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


Joined: 01 Jun 2006
Posts: 16

PostPosted: Fri Jun 02, 2006 8:09 pm   

pattern match an ANSI color code?/Discworld MUD mapping
 
is there a way to match an ANSI color code for a trigger?

because, i cannot get my automapper to get room descriptions properly without recognizing the color codes sent by the MUD.

please help anyone.. Shocked


Last edited by birkoff on Mon Jun 05, 2006 9:22 am; edited 1 time in total
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Jun 02, 2006 10:39 pm   
 
To create an ANSI color based trigger start by making a new trigger, then clicking on the Options tab in the Editor window for the trigger. Check the box that says "ANSI trigger". Then click the Pattern tab. Cick in your character window and select the text you want, then return focus to the Settings Editor window. Ensure that the cursor is inside the pattern box for your new trigger, then paste by pressing CTRL-V. Other pasting methods do not always provide the color codes as well. Finally edit your trigger to gneralize it as you need, see the help section Pattern Matching if you are unsure. This gives you a trigger that will fire correctly.

Now to make the automapper work with this you will have to use the #TAG command within the code section of the trigger. Please make sure you have thoroughly read the help on the automapper including the section "Overriding the Automapper" prior to doing this.

If you need further help with this please post some example mud outputs. For mapping purposes it is best if you post from prompt to prompt for 3 succesful movements and some varieties of failed movements. This should show us the commands issued as well as the responses, don't censor anything. In order to map happily your script have to be able to censor things for you, and the more information we have the closer we are able come up with a script that will properly do everything.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
birkoff
Beginner


Joined: 01 Jun 2006
Posts: 16

PostPosted: Sat Jun 03, 2006 10:25 am   
 
okay, i was able to paste the color codes, but i got in loads of other problems..

i've attached an image of 3 typical movements and outputs, and 2 unsuccesful ones. i couldn't find a way to paste the color codes here on the forum, that's why there's a image..



so, what i've managed to do is get the exits and the room name properly, all i have to do now is disregard the weather, and get the multiline room description..

can you please give me some hints as to what kind of triggers i should use?

edit:

okay, i will make a precise statement of what i need done:

the output is of the format

Code:
[room name]
..
.. <multiline room description>
..
weather <orange>
exits <green>


what needs to be said here, that this isnt necessarily by itself on a paragraph, so i need a precise trigger that recognizes the beginning "[room name]" pattern, and the ending "obvious exits:" pattern, and then, to tag the "room name" as the room name, the last (green) line as exit line, DISREGARD the weather (orange) line, and tag the remaining lines as description..

also, often it happens that the current walk output (after a direction command is sent) and the last output (the room you are in before sending the direction command) dont have a blank line between them, in which case the mapper consideres it all a single (last recieved) paragraph, and the trigger kicks off for the previous room's name, exits, etc.. SO, i'd have to add a forced blank line after sending every walk command to the MUD.

this sounds simple for a human, but i have absolutely no idea how to do this in zMUD, especially when i'm confused about what the various automapper configuration settings actually do. (those involving paragraphs and lines)


Last edited by birkoff on Sat Jun 03, 2006 11:59 pm; edited 1 time in total
Reply with quote
Arcane_of_Discworld
Wanderer


Joined: 29 Jan 2002
Posts: 99
Location: UK

PostPosted: Sat Jun 03, 2006 10:56 pm   
 
Off topic.. how did you get the 'room name' to display as this looks like Discworld and I didn't know it was possible
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Sat Jun 03, 2006 11:01 pm   
 
'verbose look', as far as i can tell
_________________
Discord: Shalimarwildcat
Reply with quote
birkoff
Beginner


Joined: 01 Jun 2006
Posts: 16

PostPosted: Sat Jun 03, 2006 11:57 pm   
 
Arcane_of_Discworld wrote:
Off topic.. how did you get the 'room name' to display as this looks like Discworld and I didn't know it was possible


options output shortinlong = on

i also found this out recently while experimenting with options.
Reply with quote
Arcane_of_Discworld
Wanderer


Joined: 29 Jan 2002
Posts: 99
Location: UK

PostPosted: Sun Jun 04, 2006 9:29 am   
 
Thanks for the tip about the option to display the short name in verbose look.. it makes mapping even easier =)

Outside rooms have changable descriptions based upon time of day, season and weather therefore I consider it a waste of effort to add descriptions for these rooms. Here is my solution for setting short name and description for inside rooms and short name only for outside rooms together with a roomnote stating the room is outside. I have not tried this out whilst mapping new rooms but it is set up to function whilst the map is locked to modify existing rooms.

This first trigger works off of the Short Name first disregarding 'Login' messages if you have them enabled in the Mud options, it also checks if the roomnames has been already set correctly. The 0.5 second delay in setting the roomname is to overcome the problem of zMud sometimes assigning the previous room's name to the current room.
Code:
#TRIGGER {^~[(*)~]} {#VARIABLE RoomName {%1};#IF (%word( @RoomName, 2, " ")!=enters and %word( @RoomName, 2, " ")!=leaves) {#T+ Descriptions;#IF (%roomname( )!=@Roomname or %null( %roomname( ))) {#ALARM +.5 {#NOOP %maplocked( 0);#NOOP %roomname( , @RoomName);#NOOP %maplocked( 1)}}} {#NOMAP}}

The second trigger I am using exists in its own class folder called Descriptions, it is disabled by default and enabled by the '#T+ Descriptions' component of the preceding trigger. This trigger works 90% of the time and I have chosen to match '%a' because in verbose look mode I have the in game map enabled, this pattern matching choice will not fire on map symbols, the trigger is:
Code:
#TRIGGER {^%a} {#VARIABLE Description {%trigger};#GAG;#NOOP %maplocked( 0);#NOOP %roomdesc( , @Description);#NOOP %maplocked( 1);#T- Descriptions}

You may notice I use #GAG to hide this text from the main window, if you prefer not to hide them simply remove the command, this trigger also serves to disable the class it is in after firing once.

The final trigger I use is a colour trigger based upon the weather messages sent by the mud, however you will almost certainly need to alter the colour the mud sends the messages in and/or the colour code I use in the trigger pattern. It has been years since I altered the weather colour and cannot even find the option to do so at the moment.

Here is the code I use:
Code:
#TRIGGER {^%e[34m} {#GAG;#ALARM +.5 {#NOOP %maplocked( 0);#NOOP %roomdesc( , %null);#NOOP %roomnote( ,Outside);#NOOP %maplocked( 1)}} "" {color}

The above trigger will clear the room description previously set if it fires, I do this for the reasons stated in my opening paragraph, namely that outside room descriptions are too variable. It also adds a note to the room stating that it is Outside

As far as multiple line triggers are concerned you can alleviate the need for them by setting your in game coloumns to 999, cols 999 from the command line. I also have my in game term set to ansi and not network, this way the column setting does not get altered automatically.

Hope this helps =)
Reply with quote
birkoff
Beginner


Joined: 01 Jun 2006
Posts: 16

PostPosted: Sun Jun 04, 2006 10:13 am   
 
It did help a lot, if not directly then to make me familiarize myself with such advanced coding in zMUD.

I still have major issues, because i would like the mapper to map automatically as i explore new areas. The Discworld output is fairly consistent, and it should be possible.
Using the triggers above, i noticed:

a) The room description of interor rooms gets set to lines like "A group of yokels enter the bar and eye you suspiciously.", which is just an event, nothing to do with the room description.
b) The slowwalking gets confused when there's no blank line before the current room's name
c) When i set to create room automatically as i walk, often it occurs that the current room's name is set to the previous one's, or, when the automapper fails to see the movement, it still assigns the current rooms name to the name of the room you actually DID move in..

but, you know, i think i'll just dig into some experimenting with this totally unintuitive code of zMUD, maybe i'll come up with something.

Thanks for you help !! Very Happy
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Jun 05, 2006 2:09 am   
 
There's a mapper preference called Room Description Changes that allows you to force ZMud to ignore room descriptions, Arcane. As long as ZMud can easily find your descriptions, this will make the weather/time changes irrelevent. Problems still exist when you get into mazy areas, but those usually have other quirks that make them more difficult or even impossible to map anyways.
_________________
EDIT: I didn't like my old signature
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