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, confirm your email, resolve issues, 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.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Plugins ➜ Mapper Help (Alter Aeon)

Mapper Help (Alter Aeon)

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


Posted by Branagh   (5 posts)  Bio
Date Tue 05 Mar 2019 12:38 AM (UTC)
Message
I previously got help with an old mapper that was mostly functional but often could not detect room names correctly.
The mud recently added kxwt support for room name so I'm trying to make a simpler version but having trouble so far.
The output from the mud now looks like this:

Quote:

kxwt_rvnum 50005
kxwt_terrain 2
kxwt_rshort The healer's tent
kxwt_area 5000 You are near the refugee encampment.
kxwt_walkdir 2
The healer's tent

[Exits: north east south ]


Triggers to detect roomnum, areanum, room name and exits work fine when tested individually but I need help with generating room uid.
The mud has instanced areas which expire after 30 mins when not in use and can recycle old rvnums. So to get a unique id, you have to concatenate areanum and roomnum together.
The mapper here (https://github.com/Neurrone/Mushclient-Plugins) did this but I don't see how.
I tried this but I don't think it's right:
function generate_uid (areanum, roomnum)
uid = (string.format("%s.%s", areanum, roomnum)
end 
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Tue 05 Mar 2019 04:43 AM (UTC)
Message
Assuming things always come in that order, when you get the room vnum just remember it in a variable. Then when you get the area number concatenate it with the room vnum and there is your unique ID.

- Nick Gammon

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

Posted by Branagh   (5 posts)  Bio
Date Reply #2 on Wed 06 Mar 2019 (UTC)
Message
Thank you.
Now my mapper can capture the main info it needs and draw rooms walking around. I'm stuck on the next step, trying to create the tables in sqlite to store the data in. The tables are not being created at all.
What I have so far is here:
https://pastebin.com/pu164Vk5
Could you have a quick look in case it's something obvious that I'm missing?
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #3 on Wed 06 Mar 2019 07:52 AM (UTC)
Message

      areanum            TEXT NOT NULL CHECK (area_num <> %s),    


What's the %s here?

- Nick Gammon

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

Posted by Death   (55 posts)  Bio
Date Reply #4 on Sun 10 Mar 2019 01:05 AM (UTC)

Amended on Sun 05 Jan 2020 06:01 AM (UTC) by Death

Message
Branagh, I've already made a total graphical mudder for Alter Aeon, using Mush. What is your contact information on the mud?
Get in contact with me and we can talk about sharing it.

Otherwise, I can help.
Top

Posted by Fiendish   USA  (2,534 posts)  Bio   Global Moderator
Date Reply #5 on Sun 10 Mar 2019 02:45 PM (UTC)
Message
Quote:

Get in contact with me and we can talk about sharing it.


If you don't mind my asking...
If you're already willing to share it with other people, why not just put it online and share the link?

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #6 on Sun 09 Feb 2020 06:07 AM (UTC)
Message

The Learning Mapper I developed recently seems to work OK with Alter Aeon (at least as far as I tested it).

See Nick’s Learning Mapper post for details about it.

Configuration

mapper config when_to_draw                             exits
mapper config activate_description_after_exits         No
mapper config activate_description_after_room_name     No
mapper config add_newline_to_prompt                    No
mapper config blank_line_terminates_line_type          Yes
mapper config exits_on_room_name                       No
mapper config include_exits_in_hash                    Yes
mapper config exits_is_single_line                     Yes
mapper config prompt_is_single_line                    Yes
mapper config exit_lines_start_with_direction          No
mapper config sort_exits                               No

Notes

To help the mapper learn the exits lines the following triggers should be added to your world file.

See http://www.gammon.com.au/pasting for how to copy from below and paste into your world file.

<triggers>

<!-- Room names -->

  <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"
   send_to="12"
   sequence="100"
   text_colour="15"
  >
  <send>  
  function callmap (...)
    CallPlugin ("99c74b2685e425d3b6ed6a7d", unpack ({ ... }) )
  end -- callmap

  callmap ("set_line_type", "room_name")     -- this is a room name
  callmap ("do_not_deduce_line_type", "room_name") -- so don't try to deduce them
  callmap ("deduce_line_type", "description")      -- start deducing descriptions
</send>
  </trigger>

<!-- Prompt lines -->

  <trigger
   enabled="y"
   match="&lt;*&gt;*"
   send_to="12"
   sequence="100"
  >
  <send>  
  function callmap (...)
    CallPlugin ("99c74b2685e425d3b6ed6a7d", unpack ({ ... }) )
  end -- callmap

  callmap ("set_line_type", "prompt")                     -- this is a prompt
  callmap ("do_not_deduce_line_type", "prompt")           -- so don't deduce prompts
  callmap ("do_not_deduce_line_type", "description")           -- descriptions follow room names
</send>
  </trigger>

<!-- Exit lines -->

  <trigger
   enabled="y"
   match="[Exits: *]"
   match_bold="y"
   match_inverse="y"
   match_italic="y"
   match_text_colour="y"
   send_to="12"
   sequence="100"
   text_colour="15"
  >
  <send>  
  function callmap (...)
    CallPlugin ("99c74b2685e425d3b6ed6a7d", unpack ({ ... }) )
  end -- callmap

  callmap ("set_line_type", "exits", "%1")
  callmap ("do_not_deduce_line_type", "exits")
  callmap ("do_not_deduce_line_type", "description")
</send>
  </trigger>
</triggers>

- Nick Gammon

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

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #7 on Sun 09 Feb 2020 06:49 AM (UTC)

Amended on Sun 09 Feb 2020 06:51 AM (UTC) by Nick Gammon

Message

It looks like I should have re-read the first posts in this thread first. :)

The “kxwt_” messages make mapping much more reliable. You need to turn it on:

 set kxwt on

Then the kxwt messages (which are omitted from output) give you a vnum and room description.

Then use the triggers below, instead of the ones in my previous post.

See http://www.gammon.com.au/pasting for how to copy from below and paste into your world file.

<triggers>

<!-- kxwt messages -->

  <trigger
   custom_colour="2"
   enabled="y"
   match="^kxwt_([a-zA-Z]+)( .*)?$"
   omit_from_output="y"
   regexp="y"
   send_to="12"
   sequence="1"
  >
  <send>

local command = "%1"
local params = Trim ("%2")

function callmap (...)
  check (CallPlugin ("99c74b2685e425d3b6ed6a7d", unpack ({ ... }) ))
end -- callmap

-- vnum
if command == "rvnum" then
  vnum = string.match (params, "^(%d+)")  -- not local, save for later
  if vnum then
    callmap ("deduce_line_type", "description")      -- start deducing descriptions
    callmap ("deduce_line_type", "room_name")        -- start deducing room names
  end
  return

-- room short description
elseif command == "rshort" then
  callmap ("set_line_type_contents", "room_name", params)
  return

-- area name
elseif command == "area" then
  local areanumber, areaname = string.match (params, "^(%d+) (.*)$")
  if areanumber and vnum and areaname then
    callmap ("set_area_name", areaname)
    -- UID is unique if you use the area number and the room number
    callmap ("set_uid", areanumber .. "/" .. vnum)  -- see: http://www.gammon.com.au/forum/?id=14420
  end -- if
  return
end -- if

  </send>
  </trigger>

<!-- Room names -->

  <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"
   send_to="12"
   sequence="100"
   text_colour="15"
  >
  <send>  function callmap (...)
    check (CallPlugin ("99c74b2685e425d3b6ed6a7d", unpack ({ ... }) ))
  end -- callmap

  callmap ("set_line_type", "room_name")     -- this is a room name
  callmap ("do_not_deduce_line_type", "room_name") -- so don't try to deduce them
  callmap ("deduce_line_type", "description")      -- start deducing descriptions
</send>
  </trigger>

<!-- Prompts -->

  <trigger
   enabled="y"
   match="&lt;*&gt;*"
   send_to="12"
   sequence="100"
  >
  <send>  
  function callmap (...)
    check (CallPlugin ("99c74b2685e425d3b6ed6a7d", unpack ({ ... }) ))
  end -- callmap

  callmap ("set_line_type", "prompt")                     -- this is a prompt
  callmap ("do_not_deduce_line_type", "prompt")           -- so don't deduce prompts
  callmap ("do_not_deduce_line_type", "description")           -- descriptions follow room names
</send>
  </trigger>

<!-- Exits -->


  <trigger
   enabled="y"
   match="[Exits: *]"
   match_bold="y"
   match_inverse="y"
   match_italic="y"
   match_text_colour="y"
   send_to="12"
   sequence="100"
   text_colour="15"
  >
  <send>  
  function callmap (...)
    check (CallPlugin ("99c74b2685e425d3b6ed6a7d", unpack ({ ... }) ))
  end -- callmap

  callmap ("set_line_type", "exits", "%1")
  callmap ("do_not_deduce_line_type", "exits")
  callmap ("do_not_deduce_line_type", "description")
</send>
  </trigger>
</triggers>

- 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.


23,546 views.

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.