Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.
 Entire forum ➜ MUSHclient ➜ Plugins ➜ Mapper Woes

Mapper Woes

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


Pages: 1 2  

Posted by Lmclarke   (26 posts)  Bio
Date Fri 12 Jan 2018 09:37 AM (UTC)
Message
Continuation of this thread, just a billion years later:
https://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=13823


Quote:
room.hovermessage = string.format (
"%s\t[ Exits: %s ]\n[ Air exits: %s ]\n\n%s",
room.name,
table.concat (texits, ", "),
uid:sub (1, 5),
room.description
)


I started using Nick Gammon's Lands of Redemption Mapper, because it seemed very close to what I needed. The above doesn't seem to work. It actually seems to "crash" the miniwindow somehow, in that once the plugin is installed uninstalling it doesn't remove the window, it can't be moved, etc.

What the above should be matching:

Quote:
The Royal Parlour
[Chilly]
Polished rosewood paneling lines the walls of this spacious and elegant
parlour. Though it is somewhat more modest than expected, particular
attention has been paid to the quality of materials in its decoration,
providing a rich, but subtle atmosphere that compliments the rest of the
Town Hall. A large hearth occupies the room's eastern wall, while solid
bronze candle holders line the perimeter of the room at regular intervals.
Along the south wall is a set of four large, floor-to-ceiling windows, each
curtained with silver-on-midnight brocade curtains. On the room's western
wall, one single, large panel has been fitted into its centre and painted
the crest of House ab Samael: a silver-painted hawk displayed upon a
black-and-silver chequered field. A single door leads back into the
central balcony.

In the last year:
(The room is cool as befits the time of year and has the neatness of a place
only recently occuppied, rather any sense of being 'lived in'. )

[ Exits: north ] [ Air exits: none ]
Top

Posted by Lmclarke   (26 posts)  Bio
Date Reply #1 on Fri 12 Jan 2018 05:30 PM (UTC)
Message
I'll be spending my day reading and rereading this to try and get it through my thick skull this time:
http://www.gammon.com.au/forum/?id=12635
Top

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #2 on Fri 12 Jan 2018 08:57 PM (UTC)
Message
Closing a plugin doesn't remove any associated miniwindows because, strictly speaking, a miniwindow doesn't "belong" to any plugin. That's why the documentation suggests putting the plugin ID into any miniwindows made by that plugin to stop name clashes. To close all miniwindows (so you can see what is on the screen) you can run this alias (close_miniwindows):


<aliases>
  <alias
   match="close_miniwindows"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>

if WindowList() then
  for _, v in ipairs (WindowList()) do 
    WindowDelete (v) 
  end
end -- if any

</send>
  </alias>
</aliases>


Template:pasting For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.


If you have other windows you want to leave open you could add some sort of "if" test, eg.



if WindowList() then
  for _, v in ipairs (WindowList()) do 
    if string.match (v, "_mapper") then
      WindowDelete (v) 
    end -- if a mapper window
  end
end -- if any





As for your problem, perhaps one of the things in the hovermessage is nil? Try printing each thing first and debugging, eg.


print (room)     --> should be a table
print (room.name)  --> should be a string (not nil)
print (texits)   --> should be a table
print (uid)      --> should be the room ID
print (room.description)  --> should be a string (not nil)

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #3 on Sat 13 Jan 2018 05:27 AM (UTC)
Message
Lmclarke said:

What the above should be matching: ...


The other thing is, what you posted won't "match" anything. It isn't code that does a match. It does a format, which is designed to make a "hover" tooltip when you mouse over a room.

To do matching you would expect to see string.match or string.find function calls.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Lmclarke   (26 posts)  Bio
Date Reply #4 on Sat 13 Jan 2018 11:21 AM (UTC)

Amended on Sat 13 Jan 2018 11:24 AM (UTC) by Lmclarke

Message
I think I completely misunderstood how the trigger is supposed to work. On the miniwindows - that is VERY helpful to me, thank you, Nick.

I managed to get through the guide to setting up a mapper to the point of "integrating for your own MUD", then got myself stuck with the UID/hashing portion -- not terribly far, unfortunately.

The administrator on the MUD I hoped to design the mapper for has agreed to let players have access to room vnum via a prompt variable, however, so that is going to sap the great, great majority of "nightmare mode" out of this.

Thank you as always for responding. I'm hoping that once the above change goes through I'll be able to work through it with a little more success.
Top

Posted by Lmclarke   (26 posts)  Bio
Date Reply #5 on Sat 13 Jan 2018 06:49 PM (UTC)

Amended on Sat 13 Jan 2018 09:47 PM (UTC) by Lmclarke

Message
Okay, got through the guide now that vnums are available. Sadly, it's obvious I'm doing something wrong.

This is what I have:
https://pastebin.com/Nhx2uLQ7

While it does appear to draw the room I'm in, walking around doesn't draw any other rooms. They don't draw at all, even if I stop and do an extra "look."

If I changed the color number to anything but 9, it grabs the word "fresh" from my prompt and seems to think that's the room name. I tried with every single other color. All of them but 9 grabbed "fresh." This was baffling. For reference, prompts look like this:

<RPXP Gain: Average> <HP:perfect MV:fresh P:walk> <Room: 11094> (bathed)


With the color set to 9, it grabs the "temperature" from the top of the room but not the room name. This is probably because the brackets around the temperature are also bold red. Can I make it skip triggering on anything that starts with a [ bracket?
Top

Posted by Lmclarke   (26 posts)  Bio
Date Reply #6 on Sat 13 Jan 2018 07:45 PM (UTC)
Message
I went back and changed the "match" on the prompt trigger to this:

match="*&lt;RPXP Gain: *&gt; &lt;HP:* MV:* P:*&gt; &lt;Room: *&gt;*"


Same issues, unfortunately.
Top

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #7 on Sun 14 Jan 2018 04:28 AM (UTC)
Message
Can you paste the actual trigger please?

Template:copying For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see Copying XML.


(Not the whole plugin, but the part you are expecting to match, which doesn't).

As for the rooms not being linked, it is probably (almost certainly) that you are not associating exits with rooms, and where they go.

As I think my tutorial mentioned, you need to detect when you change rooms (that is easy enough because the vnum changes) and then put in an exit from one room to the other.

eg.


  • You were in room 1000.
  • You go east (eg. you type "e")
  • You are now in room 1001


Therefore room 1000 has an east exit that leads to 1001. That needs to go into the rooms table, so that when the mapper asks what exits a room has, you can tell it "room 1000 has an east exit to 1001".

Look at the tutorial you referenced, around where there is a comment in the code "-- if we changed rooms assume that our last movement sent us here".

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #8 on Sun 14 Jan 2018 07:19 AM (UTC)
Message
Quote:

Therefore room 1000 has an east exit that leads to 1001.


Also, you can probably assume, which my code did, that going west from 1001 takes you to room 1000.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Lmclarke   (26 posts)  Bio
Date Reply #9 on Sun 14 Jan 2018 11:57 AM (UTC)

Amended on Sun 14 Jan 2018 12:15 PM (UTC) by Lmclarke

Message
The trigger for prompt:

<triggers>
  <trigger
   enabled="y"
   match="*&lt;RPXP Gain: *&gt; &lt;HP:* MV:* P:*&gt; &lt;Room: *&gt;*"
   script="got_prompt"
   sequence="100"
  >
  </trigger>
</triggers>


Trigger for room name:

<triggers>
  <trigger
   back_colour="8"
   bold="y"
   enabled="y"
   keep_evaluating="y"
   match="*"
   match_back_colour="y"
   match_bold="y"
   match_inverse="y"
   match_italic="y"
   match_text_colour="y"
   sequence="90"
   text_colour="9"
   script="got_room_name"
  >
  <send>say test of room name, which should be %1</send>
  </trigger>
</triggers>


I added the test in there to see what was happening. It IS pulling up the room name, apparently, but it goes on to grab the line below it as well (it starts with a bold red bracket). Policy is the room name, the line below is the "temperature":

Maker claims, "Test of room name, which should be Policy"
Maker states, "Test of room name, which should be [Play by the rules, but be ferocious."] "


I'm wondering if because movement from room to room is delayed on the MUD (e.g. You type "north", and this happens: "Maker begins to move north. Maker crosses the center of the room at a walk. Maker leaves north. Maker arrives from the south.") it might present some unique issues on the map drawing front?
Top

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #10 on Sun 14 Jan 2018 07:45 PM (UTC)
Message
Quote:

... but it goes on to grab the line below it as well (it starts with a bold red bracket).


They both start with bold red? Just ignore lines that start with the bracket.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Lmclarke   (26 posts)  Bio
Date Reply #11 on Sun 14 Jan 2018 08:15 PM (UTC)

Amended on Sun 14 Jan 2018 08:16 PM (UTC) by Lmclarke

Message
Fully revealing how bad I am at this, here, but how do I approach that? I read in the triggers/fun with triggers threads that I can accomplish it with ?! before the bit I want to avoid, but when I attempted it I must have done it incorrectly.

What I tried:
^\?![*$
Top

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #12 on Sun 14 Jan 2018 08:46 PM (UTC)

Amended on Sun 14 Jan 2018 08:49 PM (UTC) by Nick Gammon

Message
The simple thing would be to match everything and in the script discard any line that starts with a bracket. However you can make a regexp to do it:


^[^\[]


That matches any line that starts with any character except a left square bracket.

You need the backslash to "escape" the bracket inside the brackets.

The thing in square brackets is a "set" and by putting a carat at the start of the set you negate the set.

http://www.gammon.com.au/regexp

For example:


[abc]


Matches "a", "b" or "c" (in a single character) and:


[^abc]


Matches any single character except "a", "b" or "c".

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #13 on Sun 14 Jan 2018 08:56 PM (UTC)
Message
If you want to capture the matching line add some round brackets:



^([^\[].*)$

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #14 on Sun 14 Jan 2018 09:37 PM (UTC)
Message
What are the MUD details (IP and port)? I might take a poke around and see what it does. Also how do you put the vnum into the prompt?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


55,403 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 page

Go to topic:           Search the forum


[Go to top] top

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