CMUD dbm map file and where should it go

Posted by Crate on Wed 15 Oct 2014 08:32 PM — 30 posts, 110,259 views.

#0
I have been using mushclient ver 4.94 on Ubuntu under wine for a while now and it is awesome. I recently started playing muds and this was one of the first clients i tried.

My question surrounds me recently acquiring a Zmud map database, which I converted to dbm and can view it in sqlitebrowser.

What I want to know is how do i integrate the database to mushclient's mapper?

Which map plugin should I use to display the db and update the db given the output below?

appreciate any assistance and advice.

Fields Beside the Path [ N E S W ]
You trample through a field of oat which seems to have been sewn by some
wild and unorganized people. Their ways of agriculture seem to be rather
primitive for there seems to be no order within these fields. It is quite
foggy here. The field continues to the north and south. To the west there is
the path leading to Moonglow. To the east you can leave the oat fields and
enter another grain field.
An orcish scout is snuffling on the ground here. (Red Aura)
|447(79%)H|384(73%)M|160(100%)V|1536054 TNL|0 TNQ|4am|
Australia Forum Administrator #1
The CMud database and the one my plugin uses will be quite different. I have no idea of the format of the CMud one so it is hard to advise.

The first thing you really need to do is make the mapper work with an empty database, just to make sure it recognizes moving around etc. Then you could try to get the data from the CMud one, if you could work out things like how the data is stored.
#2
I turned on the mapper, under game, and the mxp_roomdesc, mxp_roomexit and mxp_roomname are all populated with the current room I'm in when i check the world properties.

From my reading, I know these are entered into a database, can you direct me to it?

Note though, when i turn on the mapper, I dont see a window with it drawing the places I've been, I am guessing, I'm supposed to use a plugin to get the display.
Australia Forum Administrator #3
Crate said:

Note though, when i turn on the mapper, I dont see a window with it drawing the places I've been, I am guessing, I'm supposed to use a plugin to get the display.


Turn on the mapper? It is a plugin.

Oh, that mapper. That just builds up aliases. It isn't a graphical mapper. The graphical mapper is separate and somewhat newer.

Which MUD are you playing?
#4
Playing one of the many really awesome muds, called Realm of magic. lots of zones and really cool people.

Regarding the mapper building aliases, I'll definitely need to read more about it, but at a glance assuming its function is to gets data based on certain criteria.

But in terms of the graphical mappers, based on the excerpt in my first post for the location, which mapper plugin would you recommend to be able to work for mine though.

And also, from the recommendation, where would the database be located.

Almost forgot to mention, the mud uses MXP for certain tags, but for Rooms, only Room Name, Exits and Room Description are shown, no room Numbers.
Amended on Thu 16 Oct 2014 06:55 AM by Crate
Australia Forum Administrator #5
I've been having a bit of a play on Realm of Magic, because making the mapper work with MXP could be useful for quite a few MUDs. Here is the current version, it's a bit flaky but seems to work reasonably well:

Template:saveplugin=Realm_Of_Magic_Mapper
To save and install the Realm_Of_Magic_Mapper plugin do this:
  1. Copy the code below (in the code box) to the Clipboard
  2. Open a text editor (such as Notepad) and paste the plugin code into it
  3. Save to disk on your PC, preferably in your plugins directory, as Realm_Of_Magic_Mapper.xml
    • The "plugins" directory is usually under the "worlds" directory inside where you installed MUSHclient.
  4. Go to the MUSHclient File menu -> Plugins
  5. Click "Add"
  6. Choose the file Realm_Of_Magic_Mapper.xml (which you just saved in step 3) as a plugin
  7. Click "Close"
  8. Save your world file, so that the plugin loads next time you open it.


Initial version:

https://github.com/nickgammon/plugins/blob/6c36f332db9/Realm_Of_Magic_Mapper.xml

Current version:

https://github.com/nickgammon/plugins/blob/master/Realm_Of_Magic_Mapper.xml

(Instead of "copying between the lines" grab the source from GitHub. Click on the "Raw" button to get the pure plugin source, or RH-click it to get a file to download).

It uses the MXP tags to find when it changes rooms. It generates a room ID by hashing up the room name, description and exits.

Because we don't know where rooms lead, you have to "train" it by going from one room to another (eg. go east) and then go back again so it knows they connect both ways (eg, go back west).

After you've done this a bit the map should start to fill out in a reasonable way. Type "mapper help" to see the sorts of things you can do.

You have to manually enter shops and trainers by RH-clicking on the map square and selecting "toggle shop" or "toggle trainer". You can bookmark interesting places.

Example of it in use:

Amended on Tue 21 Oct 2014 04:47 AM by Nick Gammon
Australia Forum Administrator #6
Crate said:

My question surrounds me recently acquiring a Zmud map database, which I converted to dbm and can view it in sqlitebrowser.


The mapper plugin above also uses SQLite3, using a fairly simple system, so if you are keen you could work out how to import all your rooms. The tricky part might be working out what sort of unique ID Zmud used for rooms, it almost certainly won't be what I did.
#7
Nick you are AAAWWWEEESSSOOOMMMEEE!!!,
I sincerely appreciate this!!!

I installed the plugin and got two errors thus far, but sorted it out by moving the previous .db, .db-shm and .db-wal files which were created previously when i was testing other mappers. On my to-do list will be to determine what the shm and wal files do exactly.

Logged in, when I arrived in the world, i was in my mud apartment with no visible exits, which the mapper updated the db, then when i opened the door, it mapped the room south of my apartment, and then i got back into the apartment, it mapped a different id since the number of exits had changed from nil to [S].

At this point i confirmed the db file was recreated and the other 2.

Time was short since i had to leave, I walked up and down the apartment complex, went onto the street, then retraced all the steps, but nothing past my apartment exit room and apartment were mapped, though.

Had to head out at this point, and after seeing at least the apartment created, I am seriously stoked to test some more, and am feeling anxious to get home, honestly.

Will test and let you know.

As a side note, is it possible to add an input section in the mapper window, or iirc, you had created a plugin to create another miniwindow to show the current room u were in and the respective exits.
Possibly have it there to be able to input notes on how to open certain scripted room doors, push button, knock certain pattern, ... etc, and send this to the db as additional notes.

Probably over thinking due to my excitement.
I'll test and let you know how it goes.

Thanks again Nick
Australia Forum Administrator #8
Let me know how it goes. :)

If the number of exits changes, try changing:


  uid = utils.tohex (utils.md5 (roomname .. roomdesc .. exits_str))


to:


  uid = utils.tohex (utils.md5 (roomname .. roomdesc))
Australia Forum Administrator #9
Crate said:

On my to-do list will be to determine what the shm and wal files do exactly.



Temporary files used by SQLite3.

https://www.sqlite.org/wal.html
Australia Forum Administrator #10
Found a bug. Change:


    table.remote (moves, 1)


to:


    table.remove (moves, 1)


And also:

Change:


    room.exits [last_direction_moved] = current_room


to:


    if room then
      room.exits [last_direction_moved] = current_room
    end -- if room


Both changes made in above post, now.
Amended on Sun 19 Oct 2014 07:58 PM by Nick Gammon
Australia Forum Administrator #11
I've been wandering around a bit. The database entries grow quite quickly:


sqlite> select uid, name, notes from rooms;
41EF698D31|Temple Board Room|
5D593169E4|Center Temple|
460E5AD455|Temple Board Room|
88E724CA80|Center Temple|fountain
7817DB52E5|Main Road|
DFAE45D29A|Small Alley|
58A6CB4095|Small Alley|
6736B0875A|Main Road|
F0416F0F94|Side Road|
4144968C51|Side Road|
D19E4FB517|Main Road|
F17D66856B|Welcome to Entrancity|
BF43E49DF5|Treasure Store|
6FAC92C612|Small Alley|
60C5555AA5|Cleric Guild|
AAFF032A6F|Druid Guild|
6EFE98C603|Mage Guild|
BB9BFBF3C5|Small Alley|
57901EB3AC|Side Road|
DFAAD45422|Side Road|
E154E4B390|Armor Store|
4A1C413773|Weapon Store|
BCF1171A19|Entrancity Map Room|
64FF28D2D0|Entrancity Shrine Room|
399B0C232B|General Store|Food, containers, torches etc.
C3CC8CC073|Thief Guild|
ED40B2706E|Warrior Guild|
9391FE5E36|The Entrancity Academy|
2C9D29FEC7|First Step of Knowledge|
E66CFB07B6|The Large MUD Clock|
FB51A4BFEF|Before A Tattered Tent|has ladder to next level
7ABB9C28A4|Bags, Boxes and Chests|
20264E6B0D|Time for a Good Rest|
C20E24A2CD|The Greyish Light|
1E2D7291F3|Your Equipment and You|
5BC50580BA|The Dark Corner|
167C05ABFF|The Meat Locker|
850540B413|A Peaceful Inn|
E937CCD182|Main Road|
A5D9B2B45D|The Great Temple of Moonglow|
B9D771B0C5|Temple Street|
341BDD7BFA|Palace of the Advisors|
7262DE865E|A Hallway|
1738B0FEA0|The Moonglow Donation Room|
6E86078D74|The News-Reading Room|
3ED7399FD4|The Reading Room|
A1107211CF|Small Alley|
850903311D|Practice Arena Entrance|
3BBE6437B3|Southwestern Corner|
DCE87271D4|Southeastern Corner|
EEF56F5324|Practice Arena Center|
9C9ECABE62|Western Arena Wall|
AB8C4E7259|Eastern Arena Wall|
9070CE36DF|Northwestern Corner|
5828CD7751|Battle Master's Throne|ladder up to next level
5B188E6F0B|Northeastern Corner|
19D34F0728|The Basics of Skills and Spells|
88EAA599D1|Using Skills and Spells|
A9F2AF9AFB|Spells of Harm|
C1DA5539D4|Skills for Combat|
ED093C894E|Miscellaneous Skills|
6B3946FB3C|Miscellaneous Spells|
57FB3603E4|Spells of Healing|
09909CF703|Master Illusionist's Sanctuary|ladder up to next level
1F36964BD6|Helpful Skills|
75A9D69ED2|Travelling the World|room with maps
0AF76F3327|Swimming the Channels|
A559BFBB11|Help From Others|
0985E549EB|Walking Around|
4407283A26|Powerful Rings of Stone|
400EFD3262|Study Full of Maps|ladder up to next level
C5EAB778B6|Sailing the Seas|
91FC30DA94|Travel by Magic|
A9ED2B1D56|Coach Travel|
09FA61764A|Exploring Your Surroundings|
591CA9A601|The Box|
4DE9C06019|Large Library|
F31A0B280D|Harbour-Street|
43C97BB1BC|Temple Street|
5256DFCE24|Market Hall|
5D1B5ADA4C|A Passageway|
77FEB7DEB5|A Passageway|
73FD7B3B29|An Alley Near the Harbour|
6DFA477830|River Road|
4A150C0624|A Dark Passageway|
D0FF6EFCF4|Large Library|
A5BF50E425|Room of Infinite Space|
F73253C0AC|Little Buttons Everywhere!|
12C0F16C20|Gallery of Art|
A2EC9ACD47|Lair of the Golden Dragon|
31B3CFE5DA|Simple Bedroom|
A77BE00922|The Center-Place of Moonglow|
176774981B|Market Hall|
19EA584AC0|Market Hall|
C1CC6FE5B7|Market Hall|
5B19FBDA1F|Main Street|
08D67DF9AF|The Big Intersection|
7499122B78|Market Hall|
044C522F92|The Old-Map-Shop|
3E9C23D994|Before the Great Blue Bridge|
927A8CA62C|Market Hall|
5F7ED42410|Market Hall|
0152257D3D|Sailor Shop|
BEC21DED18|General-Store|
288F6925D1|Town Street|
EB1D68DC8C|Town Street|
F92B92D9D5|Town Street|
A8ACA553B2|An Intersection|
CC473A413E|Weapon Shop|
D4C21B9D1F|The Great Blue Bridge|
293C40FA1E|The Great Blue Bridge|
E4BC11F326|River Inn|Inn
B1707B6C4A|The Stairs|
0A8C8D3530|An Underground Way|
C33CD78600|An Underground Intersection|
30E6CD4691|Market Hall|
935D41F990|Magic Shop|
6A0C6D5060|Armour Shop|
DB7B275080|Treasure Shop|
D6CC4EFD54|The Northern Wall Road|
0CF42B5B5F|Before the Great Blue Bridge|
78F1820320|The Chamber of Fun|
1C5C5BFB65|The Shrine of the Holy Token|
F3C2612865|River Road|
46AE85DDFE|River Road Bridge|
2C3B8C45AA|Main Street|
ED0CB77814|Main Street|
BA71FB9A45|The Post Office of Moonglow|
033E89FFD6|Entrance Hall of the Library of Moonglow|
DA1A579F87|The Lawyers Part of the Library|
6F03082AD7|The History Part of the Library|
C5C2D16687|The Town Part of the Library|
239C5D3244|The Story Part of the Library|
5E3FF8664A|The Item Part of the Library|
4B512A9CAE|The Weapon Part of the Library|
5ED42562A6|The Armor Part of the Library|
B5146A978B|The Social Part of the Library|


The UIDs on the left are the generated "room numbers" used to identify rooms uniquely. If exits change it will mistake one room as two rooms, which is why you might want to omit the exits from the UID hash.

Some of the exits are:


267|n|08D67DF9AF|5B19FBDA1F|2014-10-19 10:52:05
268|e|08D67DF9AF|F3C2612865|2014-10-19 10:52:05
269|s|08D67DF9AF|2C3B8C45AA|2014-10-19 10:52:05
270|w|08D67DF9AF|46AE85DDFE|2014-10-19 10:52:05
...
339|n|2C3B8C45AA|08D67DF9AF|2014-10-19 19:59:46
340|s|2C3B8C45AA|ED0CB77814|2014-10-19 19:59:46
341|n|ED0CB77814|2C3B8C45AA|2014-10-19 19:59:48
342|w|BA71FB9A45|5B19FBDA1F|2014-10-19 19:59:53
343|n|033E89FFD6|DA1A579F87|2014-10-19 19:59:56
344|e|033E89FFD6|5B19FBDA1F|2014-10-19 19:59:56
345|s|033E89FFD6|6F03082AD7|2014-10-19 19:59:56
346|w|033E89FFD6|C5C2D16687|2014-10-19 19:59:56
347|u|033E89FFD6|239C5D3244|2014-10-19 19:59:56
348|d|033E89FFD6|5E3FF8664A|2014-10-19 19:59:56
349|s|DA1A579F87|033E89FFD6|2014-10-19 20:00:01
350|n|6F03082AD7|033E89FFD6|2014-10-19 20:00:05
351|e|C5C2D16687|033E89FFD6|2014-10-19 20:00:09


That is basically saying that, for example, going north from from 2C3B8C45AA takes you to room 08D67DF9AF. And, further up, going south from 08D67DF9AF takes you to 2C3B8C45AA (the same room) which makes sense. Thus those two rooms are linked in a logical way.
Australia Forum Administrator #12
I've mapped out part of the town of Moonglow. You're on your own after this, but if you find some bugs, and fix them, it would help others if you post what they are.



Once you mark rooms as shops (RH click them to do this) try typing:


mapper shop


... to see where they are.


Sailor Shop (0152257D3D) - 3 rooms away
General-Store (BEC21DED18) - 3 rooms away
Armour Shop (6A0C6D5060) - 3 rooms away
Weapon Shop (CC473A413E) - 3 rooms away
The Old-Map-Shop (044C522F92) - 3 rooms away
Treasure Shop (DB7B275080) - 3 rooms away
There were 4 matches which I could not find a path to within 30 rooms.
#13
Nick, Again many many thanks.

I got back home after my small trip, away from keyboard lol and finally got to do some testing with the plugin.

Based on my testing, I started to map only moonglow, there were some issues encountered where when training the mapper, some rooms were mapped incorrectly, where rooms would change their exits in the mapper and the db entries, but I had no issue with it since I could manually edit same using the RH menu. My main thing using the plugin thus far is not having to copy and paste Room names, or even use pen and paper to map lol.

I am thinking of a miniwindow noting your current room and its relevant exits. Thinking I could use this to do edits for the rooms next to it in case of issues. From what I've seen, it should be to setup another miniwindow and call the exits using the fromuid and touid as well the exits. Side note though, Was wondering if instead of using a dir to list individual directions for the touid, I can probably manipulate it to do a single fromuid and multiple dir columns, dirN, dirS, ...etc where a touid would be stored in the relevant dir.

One other thing I was thinking of, was tagging zones to the maps. I think there exists possibly over 130 different zones of which I know off, City of Moonglow is one of those zones which is part of the continent Omelas, so for the initial map I would tag the zone to the rooms.
Maybe possibly create a subminiwindow to get the zoneID or create a new zone if it isn't in the table.

Also, in the mud there are skills called spy and wizards' eye which allow you to peak at the rooms around and view the rooms names and description. When I looked into the room using these skills, in the mapper miniwindow it moved my position to there instead of the current. Will try and check into it some more.

Note also, from the code you did, I am feeling abit more empowered lol, and from this I am thinking of adding a spell/skill and item tables so I can list the spells/skills/items at trainers or shops and have them recorded. Again, I possibly add another subminiwindow to the mapper where I can search for the relevant skill,spell or items and add to the shop or have an option to create a new one.

Still learning to understand lua, and mushclient, as well as mxp, but I am extremely glad for all the work you put in and definitely am very appreciative of the results As I said before, it gives me a great stepping stone to possibly start building some of my ideas into the plugin.

Again many many thanks for the help, and definitely big big thanks for MushClient.
Australia Forum Administrator #14
I've been having a bit more of a play today. There was definitely an issue about rooms being linked to the wrong exits, and I think the main reason for that was not interpreting all the messages about "you can't go that way".

For example, if you type E and get the message:


You need a boat or be an excellent swimmer to go there.


Then the mapper thinks you went east when you didn't.

I've added a few more of those to the "Cannot_Go" triggers.

I've also added the concept of reverse exits. That is, if you go east from A and get to B, then it assumes that going west from B gets you back to A. This helps the map fill out faster without walking backwards and forwards all the time.

You may be able to import your CMud database if you have enough information in it to generate the room UIDs. At present (in this version) I am hashing the room name combined with the description. Now if the CMud database has both of those then you should be able to generate the same UIDs (it might need fiddling to add/subtract carriage-returns maybe).

If you want detailed debugging information change this line near the top:


  <!ENTITY debugging "false" > 


Change "false" to "true".

There is also a new alias "mapper rooms" which echoes back all of the room information (all rooms and where the exits go).




Template:saveplugin=Realm_Of_Magic_Mapper
To save and install the Realm_Of_Magic_Mapper plugin do this:
  1. Copy the code below (in the code box) to the Clipboard
  2. Open a text editor (such as Notepad) and paste the plugin code into it
  3. Save to disk on your PC, preferably in your plugins directory, as Realm_Of_Magic_Mapper.xml
    • The "plugins" directory is usually under the "worlds" directory inside where you installed MUSHclient.
  4. Go to the MUSHclient File menu -> Plugins
  5. Click "Add"
  6. Choose the file Realm_Of_Magic_Mapper.xml (which you just saved in step 3) as a plugin
  7. Click "Close"
  8. Save your world file, so that the plugin loads next time you open it.


This version:

https://github.com/nickgammon/plugins/blob/1ec1843da8e/Realm_Of_Magic_Mapper.xml

Current version:

https://github.com/nickgammon/plugins/blob/master/Realm_Of_Magic_Mapper.xml

(Instead of "copying between the lines" grab the source from GitHub. Click on the "Raw" button to get the pure plugin source, or RH-click it to get a file to download).
Amended on Tue 21 Oct 2014 04:50 AM by Nick Gammon
Australia Forum Administrator #15
A simple plugin that just shows the current exits is this:


Template:saveplugin=Realm_Of_Magic_Exits
To save and install the Realm_Of_Magic_Exits plugin do this:
  1. Copy the code below (in the code box) to the Clipboard
  2. Open a text editor (such as Notepad) and paste the plugin code into it
  3. Save to disk on your PC, preferably in your plugins directory, as Realm_Of_Magic_Exits.xml
    • The "plugins" directory is usually under the "worlds" directory inside where you installed MUSHclient.
  4. Go to the MUSHclient File menu -> Plugins
  5. Click "Add"
  6. Choose the file Realm_Of_Magic_Exits.xml (which you just saved in step 3) as a plugin
  7. Click "Close"
  8. Save your world file, so that the plugin loads next time you open it.



<?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:


<Ex dir=S>S</Ex>


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.
Amended on Tue 21 Oct 2014 12:21 AM by Nick Gammon
#16
Hey Nick,

I spoke to one of the mods recently about including the Room Numbers or something which would assist in room identifications, where he indicated this is something, they're looking at, possibly not the room numbers but something which could identify the rooms.

Actually thinking about it, I could probably recommend using a similar step as currently in the mapper where the room name and description are md5, instead, the server would md5 the rnum and room name and this id could be sent as the UID for the RName.

Regarding the cmud db, I got a zmud one from this link (https://drive.google.com/folderview?id=0BzBwCAxH0OGINzMxMjg0NWEtMGRjZC00MTkwLThlNGMtZjBmNTg2YjY0OWU4&usp=drive_web&ddrp=1#list) and converted to a dbm using zuggsoft zmud to cmud converter.

Dumped the schema for each table and have been trying to correlate how it works, so have been researching and trying to find out. At least right now within that database though, the room names and descriptions are listed, so was considering running them through and md5 to add to the current db, however, I recall one of the mods doing a major update to grammatical errors in alot of the zone files so it may not be consistent with the current.

Regarding the exits miniwindow, much thanks again. I was planning to include the open db function and utilize the get_rooms and relevant exits function to print the hash and relevant settings. Was considering including a button at the beginning, which when clicked would allow you to edit the the location and/or delete if mis mapped.

Did a bit of a sketch, where I want to include checkboxes in the exits miniwindow, to include trainer, shops, Death Traps (which I will scan with my wizards eye, and spy skills and not jump inside, which I have been known to do lol). Also, a checkbox if I want to include notes, which when checked will present a notes section where text can be entered.

Some of the functions used in the plugin, I believe I can also copy some of those and include in the exits window.
Australia Forum Administrator #17
I've put the mapper on GitHub now, to avoid spamming this thread with huge slabs of code.

This will always be the current version:

https://github.com/nickgammon/plugins/blob/master/Realm_Of_Magic_Mapper.xml

And the commit history:

https://github.com/nickgammon/plugins/commits/master/Realm_Of_Magic_Mapper.xml
Amended on Tue 21 Oct 2014 06:28 AM by Nick Gammon
Australia Forum Administrator #18
I've fixed a few more oddities. Speedwalking seems better if you change the "walk delay" in the mapper to zero. Click on the asterisk in the bottom LH corner of it to do that.

Now it attempts to detect shops and inns and display a yellow warning line, for you to notice and mark a room as an inn or shop, which helps find them later.

You can look at the "diffs" to see what the changes are. eg.

https://github.com/nickgammon/plugins/commit/1de18ba1910cb9131e
#19
Again sincerest thanks Nick
Was looking for the initial one though to extract some of the code, but in Git I'm seeing version 1.2.

I should know better, but I replaced the initial code with the newer ones instead of saving em to different versions.
Australia Forum Administrator #20
Crate said:

I spoke to one of the mods recently about including the Room Numbers or something which would assist in room identifications, where he indicated this is something, they're looking at, possibly not the room numbers but something which could identify the rooms.


The important thing is that they are definitely unique, and not going to change.

Quote:

I recall one of the mods doing a major update to grammatical errors in alot of the zone files so it may not be consistent with the current.


This is the problem, even with my system. One spelling correction and it throws it out.

I don't see what the problem is with room numbers, but if they don't want to give away stuff (eg. gaps in room numbers) then just MD5 the room number (plus area number if necessary) so it doesn't "leak" information about the MUD structure.
Australia Forum Administrator #21
Crate said:

Again sincerest thanks Nick
Was looking for the initial one though to extract some of the code, but in Git I'm seeing version 1.2.


I must have been modifying the post in-place. All the more reason to use Git.

I dug up my first post from the forum audit trail. For reference, here it is:

http://gammon.com.au/files/mushclient/Realm_Of_Magic_Mapper_orig.xml

(RH-click to save the file, it will look weird in the web browser).

Note: That is the original one I posted, not the latest.

The latest one is on GitHub.
Amended on Tue 21 Oct 2014 06:27 AM by Nick Gammon
Australia Forum Administrator #22
If you already have a database, you need to add a couple more fields with the SQLite3.exe command-line program.

Edit the database like this (your file name might be a bit different):


sqlite3 realmofmagic.org_4000.db


You can check the current schema with:


.schema rooms


Then type:


 alter table rooms add inn integer;
 create index inn_index on rooms (inn);
 alter table rooms add guild integer;
 create index guild_index on rooms (guild);
Australia Forum Administrator #23
Just a reminder that I am fixing various bugs and cleaning up code.

This will always be the current version:

https://github.com/nickgammon/plugins/blob/master/Realm_Of_Magic_Mapper.xml

And the commit history:

https://github.com/nickgammon/plugins/commits/master/Realm_Of_Magic_Mapper.xml

Check the commit history for recent changes.
#24
Hey Nick,

Again much thanks for plugin, you wont believe how awesome and how helpful it has been thus far.
Haven't had much time to play over the last week due to a lot of work, stuff comes up when u dont want it, but paying bills lol.

I did some checking into the code, and saw a column listed as room.area, however, I'm not seeing it in the database, nor in the create table. Was trying to determine what the field actually does. Hoping its a field to show the zone name.

What I've done though is manually update some rooms I've been in to reflect the zone name, by doing adding a column called zone to the room table, then UPDATE the rows. Thus far this is something I've been looking at for placing the zone name under the Room Name in the mapper

Since I haven't been venturing as much due to time wasn't as time consuming to sort through the db.

My thoughts for it as follows
get zonename from room.zone
Store zone name in variable eg currentzone
This will be the default zone unless it is changed.
Rooms will map and add the zone name to the db as well for the UID being stored.
This will be a manual process to change and add zone names but it beats having to write it down.

Still working on developing the code for it.

Another item I was looking at were shops, where after the shop lists the items, I saw the list encapsulated by ------
Have been watching this and thinking to filter and store between the dash link and format the items to another table. Further since the items and the respective fields, gold, level etc are tabbed, possibly filter for that. table will list the shopkeeper name and the items with the uid of the room.

Again probably rambling. But it is pretty awesome seeing your code in action, and opening my eyes to the awesome things I can try and achieve with mush.
Australia Forum Administrator #25
Sounds good. One of your admins (Taran) has been asking where the (plugin) code is kept, and I seem to keep missing him on the MUD.

Do you want to let him know, next time he is on, where the GitHub link is? Thanks.
Amended on Mon 27 Oct 2014 06:33 AM by Nick Gammon
#26
Definitely will do

Regarding the column area in the plugin
What does it do though since I'm not seeing it in the create tables function
Australia Forum Administrator #27
The "area" part of the room table does not exist in the database, hence I was just setting it to the MUD name.

That is the thing that gets displayed at the bottom of the mapper window.

You can, of course, add it to the database (do an ALTER TABLE if you already have lots of stuff there). Then you could populate room.area from the database area. Of course, you need to have a way of working out what area you are in.
#28
Hey Nick,

I spoke to one of the mods recently about including the Room Numbers or something which would assist in room identifications, where he indicated this is something, they're looking at, possibly not the room numbers but something which could identify the rooms.

Actually thinking about it, I could probably recommend using a similar step as currently in the mapper where the room name and description are md5, instead, the server would md5 the rnum and room name and this id could be sent as the UID for the RName.
Australia Forum Administrator #29
Good idea. Doing an MD5 of the rnum would probably be enough, that allows for them changing the room name because of typos. Maybe they could include some secret "salt" to make it harder to reverse-engineer the rnums from the MD5.

eg.


id = md5 (rnum .. "somerandomphrase");