Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Message
| A simple plugin that just shows the current exits is this:
 |
To save and install the Realm_Of_Magic_Exits plugin do this:
- Copy between the lines below (to the Clipboard)
- Open a text editor (such as Notepad) and paste the plugin into it
- Save to disk on your PC, preferably in your plugins directory, as Realm_Of_Magic_Exits.xml
- Go to the MUSHclient File menu -> Plugins
- Click "Add"
- Choose the file Realm_Of_Magic_Exits.xml (which you just saved in step 3) as a plugin
- Click "Close"
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<muclient>
<plugin
name="Realm_Of_Magic_Exits"
author="Nick Gammon"
id="b87d958aea751d19db10d734"
language="Lua"
purpose="For exits for Realm of Magic"
date_written="2014-10-21 10:00"
requires="4.61"
version="1.0"
>
<description trim="y">
Shows the current room name and exits in a miniwindow.
</description>
</plugin>
<!-- Script -->
<script>
<![CDATA[
-- rname
function handleRoomName (rname)
roomname = Trim (rname)
exits_str = ""
end -- handleRoomName
-- rexits
function handleRoomExits (exits)
exits_str = exits
win = GetPluginID () .. ":exits"
font = "f"
local what_to_show = roomname .. " " .. exits_str
WindowCreate (win, 0, 0, 1, 1, miniwin.pos_top_left, 0, 0)
WindowFont (win, font, "Lucida Sans Unicode", 10)
height = WindowFontInfo (win, font, 1) + 10
width = WindowTextWidth (win, font, what_to_show) + 10
WindowCreate (win, 0, 0, width, height, miniwin.pos_top_left, 0, ColourNameToRGB "sienna")
WindowText (win, font, what_to_show, 5, 5, 0, 0, ColourNameToRGB ("yellow"))
WindowShow (win, true)
end -- handleRoomExits
function OnPluginMXPcloseTag (name)
local tagname, text = string.match (name, "(%a-),(.*)")
if tagname == "rexits" then
handleRoomExits (text)
elseif tagname == "rname" then
handleRoomName (text)
end -- if
end -- OnPluginMXPcloseTag
]]>
</script>
</muclient>
If you want to make it fancier you can play with that.
BTW if you are on good terms with the MUD admins they could assist you greatly by letting you know the room numbers (or some consistent internal ID).
For example, instead of:
<RName>Town Street</RName>
They could include the room number:
<RName uid=123456>Town Street</RName>
Similarly instead of:
The could include where the exit goes:
<Ex dir=S uid=7654321>S</Ex>
That means instead of the mapper having to hash names, and deduce where the exits go by what you last typed and where you ended up, it is all provided. Then it would be 100% accurate. :)
The benefit to the MUD is you get - more or less for free - a nice fancy mapper that doesn't get confused. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|