[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Miniwindows
. . -> [Subject]  Miniwndows and discworld mud
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Miniwndows and discworld mud

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Pages: 1 2  

Posted by Garrion   (21 posts)  [Biography] bio
Date Sun 21 Sep 2008 09:28 AM (UTC)
Message
Hi,

I have tried to read all the posts I could find but I am pretty new to these things. I saw Nicks Aardwolf map pluggin and wondered how it could be adjusted to the discworld mud.

As far as I can see there are no start and stop tags for the trigger to fire off. Are they hidden? if so how would you go about finding them?

If it is a stupid question please forgive, as I said I am still new to all this but am trying to learn.

Thanks,
Garrion.
[Go to top] top

Posted by Nick Gammon   Australia  (21,379 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Sun 21 Sep 2008 11:27 PM (UTC)
Message
It's a good question. :)

When I wrote the map plugin I was fortunate that Aardwolf had <MAPSTART> and <MAPEND> tags around its map, specifically put there for clients to detect the map. Both MUSHclient and zMUD users use those to detect when to start copying the map data to a different window or place.

If your MUD doesn't have helpful tags like that, you would need to try to detect the map by making a trigger that looks for something unique in the first line of the map (eg. a line of hyphens), and then detect somehow when the map has ended (eg. a prompt).

Maybe there is a command to turn tags on, on Aardwolf there was a configuration option (maptags or something like that) to do so.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Garrion   (21 posts)  [Biography] bio
Date Reply #2 on Mon 22 Sep 2008 11:55 PM (UTC)

Amended on Tue 23 Sep 2008 06:31 AM (UTC) by Nick Gammon

Message
Hi Nick,

I cannot see any thing that the trigger may fire off but have copied an example of the output in case I am missing something.


    |     
  *-@-$   
  | | |   
   -$-    
    |     
    $     
    |     

This is the entrance hall to the Sour-Toe-May School of Martial Arts and Dojo. Hiding most of the wall here is a very large display cabinet filled with trophies and lots of lethal looking weapons. The floorboards have been polished to a bright shine and reflect everything that passes over them. To the south lies a large central courtyard and the buildings continue to the east and west. Students wander in and out, admiring the weapons and trophies. A sturdy looking door lies to the north, it looks like it might hold something interesting.
There are four obvious exits: east, west, south and north.
Holy Grendel, Hitcher, Dark Calosal the Archangel and an Imperial guard are fighting here, Sly Pinman is standing here and a grey cloud is floating in the air here.


The small map at the top of the output is in this case 7 lines high but this hieght and width varies depending on what you can see.

I have looked at the map options and can see nothing about tags. There are options to place this map at the top, right, bottom or frame but right and frame say they are not supported and default to top instead when picked.

I am hoping this info will give you some insights on a solution that I am missing.

Thanks,
Garrion.
[Go to top] top

Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Reply #3 on Tue 23 Sep 2008 07:04 AM (UTC)
Message
You could use either an empty line or a line starting with text that lacks whitespaces to trigger the end of the map.

How it starts though, I have no clue. Show some output including what comes -before- the map, please?
[Go to top] top

Posted by Garrion   (21 posts)  [Biography] bio
Date Reply #4 on Tue 23 Sep 2008 07:28 AM (UTC)
Message
Here is an example of me moving through a few rooms:


*-
|
+*
|
@
|
*-
The corridor here extends to the north and the south. To the south it turns abruptly at a right angle to continue to the west. The bulk of the officer's quarters for the barracks lie off to the south, and the officer's lounge lies off to the north. A number of interesting portraits hang from the walls here, and a window in the east wall overlooks the parade grounds below.
There are two obvious exits: north and south.
+*
|
*
|
@-*-$-
The corridor here forms a right angle allowing passage to the east and north. Along the east corridor lie the officers quarters, where the higher ranking soldiers of the barracks have their lodgings. Along the length of both corridors can be seen a range of windows looking out over the parade grounds of the barracks. The corridor to the north extends past the officer's lounge, on its way to the stairs to the ground floor of the barracks.
There are two obvious exits: east and north.
Your divine protection expires.
| |
*-@-$-*
The corridor here extends to the east and to the west. To the west it makes a sharp turn to the north. This part of the barracks is where the officer quarters are housed, and the corridor here passes by the lodgings provided for officers and Knights of the barracks. A window in the north wall overlooks the parade grounds below.
There are two obvious exits: west and east.
| |
*-*-@-*
The corridor here passes by one of the officer's suites provided for members of the Genuan Knights. At regular intervals along the corridor can be seen the doors that lead into the comfortable quarters afforded to high-ranking soldiers staying at the barracks. The corridor here extends off to the west and to the east where it turns at right-angles to the north. A window in the north wall looks out onto the parade grounds below.
There are two obvious exits: west and east.
A muscular soldier is standing here.



Hope thats what you were after.
[Go to top] top

Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Reply #5 on Tue 23 Sep 2008 08:26 AM (UTC)
Message
You can use a trigger with a regular expression resembling ^\s{2,} for lines in your map, although that would trigger on anything with an indentation.

Likewise, if your map has a really limited amount of symbols it uses (no letters but only symbols, etc), you could try the following regular expressions:

^\s{2,}[@-*$+| ]+$

I was almost going to suggest something to make it even more strict, but looking at the HTML of the page (to see the precise characters since you forgot to put code-tags around your input) I see that making the regular expression require trailing whitespace for every line in the map won't work.

So, summary:

^\s{2,}[@-*$+| ]+$
is your best chance for triggering actual lines in your map. Set a variable sawmap=true when it fires.
^\w+
is your best chance to trigger the first line following a map. Make sure to put it keep_evaluating="y". Have it go 'if sawmap then sawmap = false; Displaymap(); end' or something along those lines.

It won't be foolproof, but it is the best I can think of for you.


[Go to top] top

Posted by Nick Gammon   Australia  (21,379 posts)  [Biography] bio   Forum Administrator
Date Reply #6 on Tue 23 Sep 2008 09:36 AM (UTC)
Message
It is hard without some identifiable start tag, but what might work is to make a "catch-all" trigger that matches all the possible things that might appear in the map (judging by your examples this would exclude lines with numbers or letters on them).

Then when you get a batch of them (ie. from non-map lines to map lines would start it, and then from map lines to non-map lines would end it), and if you had more than 1 or 2 lines, then you could assume you had a map.

It is a bit hard for me to work out a test example right now, but I think it could be done.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Hoax   (14 posts)  [Biography] bio
Date Reply #7 on Mon 24 Nov 2008 06:38 AM (UTC)

Amended on Mon 24 Nov 2008 06:40 AM (UTC) by Hoax

Message
I would suggest to turn on the 'shortinlong' in the output options, and so the output will be:

[southern end of Long Street]
*
|
+*
|
@
|
-*+
|
*
|
Long Street, the longest street in Bad Poo-Ning, ends (or starts) here, stretching off to the north. This end of Long Street walks straight
into the Red Triangle area and isn't particularly pleasant itself. Only fairly low-quality houses wall the street here. Nevertheless, a
steady flow of people populates the street.
It is a pleasantly warm summer prime's afternoon with almost no wind and a beautifully clear sky.
There are two obvious exits: north and south.
A string of lanterns is hanging across the street.


Then you can use the short description as the start trigger and ends when the length of the line is > 10, since the map is only 10 characters length.

Cheers.
[Go to top] top

Posted by Garrion   (21 posts)  [Biography] bio
Date Reply #8 on Tue 25 Nov 2008 06:48 AM (UTC)
Message
Thanks for all your tips!

I have now been able to capture the map reliably. As I said I am using the Aardwolf pluggin that Nick made. It is currently sending the first two lines of the map to the title window and the rest to the map window.

The line I am using to start the capture is being removed completely (this is the room name as suggested by Hoax). I can see that Nick designed it like this for Aardwolf but cannot see where in the code I need to make the changes.

I appreciate all the help so far it is a great learning experience.

Thanks,
Garrion.

[Go to top] top

Posted by Teapot   Australia  (9 posts)  [Biography] bio
Date Reply #9 on Sun 09 May 2010 12:42 AM (UTC)

Amended on Sun 09 May 2010 12:43 AM (UTC) by Teapot

Message
Hallo!

Discworld MUD seems to have put in <mapstart> and <mapend> tags to help capture the map. I don't seem to be able to use them, though... I've tried ordinary triggers on <mapstart> and <mapend>, the Aardwolf map plugin, and MXP callbacks, but nothing seems to notice the tags. Can anyone advise me?

Thank you!

This is the debug of just the bits with the tags (so I know they're there!):

.[0;10m.[4z<BR><   1b 5b 30 3b 31 30 6d 1b 5b 34 7a 3c 42 52 3e 3c
mapstart>          6d 61 70 73 74 61 72 74 3e 20 20 20 20 20 20 20

   .[4z<BR><mape   20 20 20 1b 5b 34 7a 3c 42 52 3e 3c 6d 61 70 65
nd>.[4z<BR>.[4z<   6e 64 3e 1b 5b 34 7a 3c 42 52 3e 1b 5b 34 7a 3c


MXP debugging reveals this, which is I think why the callbacks don't work:

E 1023: ( 7099) Unknown MXP element: <mapstart>
E 1023: ( 7106) Unknown MXP element: <mapend>
[Go to top] top

Posted by Nick Gammon   Australia  (21,379 posts)  [Biography] bio   Forum Administrator
Date Reply #10 on Sun 09 May 2010 02:39 AM (UTC)

Amended on Sun 09 May 2010 02:40 AM (UTC) by Nick Gammon

Message
Sigh. I don't know what they were thinking of, but they have introduced a non-existant tag <mapstart> into the output stream. As far as I know, there is no official <mapstart> or <mapend> tag in MXP, so MUSHclient is rejecting it (hence the error message you see). To use it in this way they should have used &lt;mapstart&gt;. And in any case it doesn't make sense because <mapstart> should be followed by </mapstart> to close the tag (or be written as <mapstart/>).

No doubt zMUD and cMUD handle this OK, however their processing of MXP tags is different to MUSHclient's.

The simplest thing is to install this plugin:

Template:saveplugin=Mapstart_fixer To save and install the Mapstart_fixer plugin do this:
  1. Copy between the lines below (to the Clipboard)
  2. Open a text editor (such as Notepad) and paste the plugin into it
  3. Save to disk on your PC, preferably in your plugins directory, as Mapstart_fixer.xml
  4. Go to the MUSHclient File menu -> Plugins
  5. Click "Add"
  6. Choose the file Mapstart_fixer.xml (which you just saved in step 3) as a plugin
  7. Click "Close"



<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>

<muclient>
<plugin
   name="Mapstart_fixer"
   author="Nick Gammon"
   id="6995f4518679ac5c5c9ce43e"
   language="Lua"
   purpose="Changes &lt;mapstart&gt; to [mapstart]"
   date_written="2010-05-09"
   requires="4.30"
   version="1.0"
   >

</plugin>

<script>
<![CDATA[

function OnPluginPacketReceived (s)
  s = string.gsub (s, "<mapstart>", "[mapstart]")
  return (string.gsub (s, "<mapend>", "[mapend]"))
end -- OnPluginPacketReceived 

]]>
</script>
</muclient>



What this does is convert "<mapstart>" to "[mapstart]" and "<mapend>" to "[mapend]". Now they will no longer be rejected as incorrect MXP.

Then change the trigger to detect "[mapstart]" and "[mapend]" and it should work OK.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Teapot   Australia  (9 posts)  [Biography] bio
Date Reply #11 on Sun 09 May 2010 10:54 AM (UTC)
Message
Works perfectly. Thank you!
[Go to top] top

Posted by Neves   USA  (78 posts)  [Biography] bio
Date Reply #12 on Wed 09 Oct 2013 09:36 PM (UTC)
Message
Hello, I am trying to get this mapper plugin working for Discworld, I started the aardwolf mapper and also the mapstart fixer, and it ins't capturing anything. Do I need to edit any parts of the aardwolf mapper?

Teapot: If you have a plugin working, can you maybe e-mail me a copy of it: pragisfieryfriend@gmail.com. Big thanks!
[Go to top] top

Posted by Nick Gammon   Australia  (21,379 posts)  [Biography] bio   Forum Administrator
Date Reply #13 on Wed 09 Oct 2013 11:08 PM (UTC)
Message
The mapper interface looks for very specific things. It is unlikely one written for one MUD will work unchanged on another. Sorry.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Neves   USA  (78 posts)  [Biography] bio
Date Reply #14 on Thu 10 Oct 2013 12:10 AM (UTC)
Message
It is looking for the <mapstart>, and that is the same, why would it not work?
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


16,733 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]