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 ➜ General ➜ Yet another mapper thread. Almost got it.

Yet another mapper thread. Almost got it.

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


Pages: 1 2  

Posted by Engvar   (24 posts)  Bio
Date Thu 11 Apr 2019 11:04 PM (UTC)

Amended on Thu 11 Apr 2019 11:07 PM (UTC) by Engvar

Message
After a month of working on the basics of triggers, and realizing why I changed majors after one semester, I'm getting so close to getting a mapper working on the mud I'm playing.

I've abandoned creating unique room id's by using the room name and description, because I talked to the IMM's and they agreed to add VNUM as a prompt option! Progress!

I also found someone making a mapper with Nick that looked like it would be VERY similar to what I needed, so I've been working on adapting it. The mapper in question is the Inquisition_Mapper.
https://www.gammon.com.au/forum/bbshowpost.php?id=14139&page=2

I started it up, got it to match on my prompt for the VNUM, and it started mapping! Then I tried getting it to match for the room name, I broke it somehow, and even when I started completely over I can't seem to get it working again. So here I am, hoping for some spark of inspiration.

Here's what I'm trying to match from:
Quote:

A Small Immaculate Temple
This room holds a serene and peaceful look. The white walls stand unblemished
but for the gentle articulate carvings within their surfaces. A neat altar
stands at the southern end of the room, raised on a few steps. There are no
particular markings anywhere within the temple that would indicate which of
the gods the altar represents, although the white setting in which it stands
would give some sort of indication that it stands not for a god of the dark or
death. To the north stands an archway, the only entrance or exit to the small
temple, which leads to the rotunda.


[Exits: north]
(Golden Aura) Ryzfur is here.
(Charmed) A brawny black bear cub paws at the ground, snuffling.
(Pink Aura) (Golden Aura) (White Aura) Gwyn the Exemplar of Guile, Champion of the Crusade is here.

<1738/1738Hp 1752/1752Mn 622/622Mv | 52G 412S |84/205W| | Irlandia Castle | V2330>


The Triggers:

The room name, in this room "A Small Immaculate Temple", is always in bold white on black. The only other things I've found with that font are down by the players. "(White Aura)", and "(Charmed)" are both tags that are in the same font. I have to trigger on bold white on black, excluding those options. I also just copied this one in to the weather line, since this mud doesn't have a weather line, and it seems to be used for capturing the description somehow.


<trigger
   back_colour="8"
   enabled="y"
   match="^(?!\(White Aura\)|\(Charmed\))*$"
   match_back_colour="y"
   match_text_colour="y"
   script="got_room_name"
   text_colour="15"
   keep_evaluating="y"
   sequence="90"
   regexp="y"
   bold="y"
   match_bold="y"
   name="room_name"
  >
  </trigger>


Next up is the prompt. I have a feeling that the vertical bars are screwing this up, but it works for the healthbar plugin, so I'm trying for it. Further down in the plugin is a spot where you change the number to what place your vnum wildcard is. I adjusted it to [8].


<triggers>
  <trigger
   enabled="y"
   match="^\<(\d+)\s*\/(\d+)\s*Hp (\d+)\s*\/(\d+)\s*Mn (\d+)\s*\/(\d+)\s*Mv*V*>"
   script="got_prompt"
   sequence="100"
   name="prompt"
   keep_evaluating="y"
  >
  </trigger>


After that is the exits line. On the mud I'm playing, it changes color for day/night, so I was just trying to text match it.


<trigger
   back_colour="8"
   enabled="y"
   match="[Exits:*]"
   match_back_colour="y"
   match_bold="n"
   match_inverse="n"
   match_italic="n"
   match_text_colour="n"
   script="got_exits"
   sequence="100"
   text_colour="14"
  >
  </trigger>



Now after all this, I'm not getting anything on the map. I am getting this after my exits line though.
Quote:

Run-time error
Plugin: Inquisition_Mapper (called from world: GameName)
Function/Sub: got_exits called by trigger
Reason: processing trigger "" when matching line: "[Exits: north]"
[string "Plugin: Inquisition_Mapper"]:235: bad argument #1 to 'concat' (table expected, got nil)
stack traceback:
[C]: in function 'concat'
[string "Plugin: Inquisition_Mapper"]:235: in function <[string "Plugin: Inquisition_Mapper"]:231>


Any idea where I've gone wrong?
Top

Posted by Fiendish   USA  (2,558 posts)  Bio   Global Moderator
Date Reply #1 on Thu 11 Apr 2019 11:10 PM (UTC)

Amended on Thu 11 Apr 2019 11:12 PM (UTC) by Fiendish

Message
I see
Quote:
Function/Sub: got_exits called by trigger
Reason: processing trigger "" when matching line: "[Exits: north]"


So I go and look at the got_exits function in the plugin file and I find that it does

room_description = Trim (table.concat (description, "\n"))


Your error message said:
Quote:
bad argument #1 to 'concat' (table expected, got nil)

So the first argument given to table.concat is nil when it expects to get a table. The first argument is
description
so the problem is that your description variable hasn't been set.

I see that the description variable is set in a function called got_description_line which is run by the trigger called description_line which is enabled in a function called got_weather_line which is run by a trigger called weather_line. Do you have a weather line like that plugin expects? If not, you'll need a different set of triggers for getting the room description.

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

Posted by Engvar   (24 posts)  Bio
Date Reply #2 on Thu 11 Apr 2019 11:16 PM (UTC)
Message
I can't for the life of me figure out how it gets the room description, and it DID work at one point without anything except the vnum being captured, so that boggles me even more. Here's all the triggers that I'm working with.


<triggers>
  <trigger
   enabled="y"
   match="^\<(\d+)\s*\/(\d+)\s*Hp (\d+)\s*\/(\d+)\s*Mn (\d+)\s*\/(\d+)\s*Mv*V*>"
   script="got_prompt"
   sequence="100"
   name="prompt"
   keep_evaluating="y"
  >
  </trigger>


<trigger
   back_colour="8"
   enabled="y"
   match="^(?!\(White Aura\)|\(Charmed\))*$"
   match_back_colour="y"
   match_text_colour="y"
   script="got_room_name"
   text_colour="15"
   keep_evaluating="y"
   sequence="90"
   regexp="y"
   bold="y"
   match_bold="y"
   name="room_name"
  >
  </trigger>

<trigger
   back_colour="8"
   enabled="y"
   match="^(?!\(White Aura\)|\(Charmed\))*$"
   match_back_colour="y"
   match_text_colour="y"
   script="got_room_name"
   text_colour="15"
   keep_evaluating="y"
   sequence="90"
   regexp="y"
   bold="y"
   match_bold="y"
   name="weather_line"
  >
  </trigger>

<trigger
   back_colour="8"
   enabled="y"
   match="[Exits:*]"
   match_back_colour="y"
   match_bold="n"
   match_inverse="n"
   match_italic="n"
   match_text_colour="n"
   script="got_exits"
   sequence="100"
   text_colour="14"
  >
  </trigger>

  <trigger
   enabled="n"
   match="*"
   script="got_description_line"
   sequence="200"
   name="description_line"
  >
  </trigger>


I thought maybe the description line trigger was somehow getting what was between the weather line and the exit line, so without the weather line substituting the room name should(?) work.
Top

Posted by Fiendish   USA  (2,558 posts)  Bio   Global Moderator
Date Reply #3 on Thu 11 Apr 2019 11:20 PM (UTC)
Message
Quote:
I thought maybe the description line trigger was somehow getting what was between the weather line and the exit line, so without the weather line substituting the room name should(?) work.

Yes. It basically just marks the start of the room description for that particular MUD. Any other marker for the start of the description will work just as well.

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

Posted by Fiendish   USA  (2,558 posts)  Bio   Global Moderator
Date Reply #4 on Thu 11 Apr 2019 11:22 PM (UTC)
Message
This assumes that you actually care about storing the room description in the mapper. If you don't, then you could just delete the offending line of code and I think it will just work without having descriptions.

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

Posted by Engvar   (24 posts)  Bio
Date Reply #5 on Fri 12 Apr 2019 12:38 AM (UTC)
Message
Ok, I tried deleting the weather trigger and the room description trigger. Still getting this after the [Exits: ] line on the first room after reloading the plugin.

Quote:

Run-time error
Plugin: Inquisition_Mapper (called from world: GameName)
Function/Sub: got_exits called by trigger
Reason: processing trigger "" when matching line: "[Exits: south]"
[string "Plugin: Inquisition_Mapper"]:235: bad argument #1 to 'concat' (table expected, got nil)
stack traceback:
[C]: in function 'concat'
[string "Plugin: Inquisition_Mapper"]:235: in function <[string "Plugin: Inquisition_Mapper"]:231>


On subsequent rooms I get:
Quote:

Trigger function "got_exits" not found or had a previous error.
Top

Posted by Fiendish   USA  (2,558 posts)  Bio   Global Moderator
Date Reply #6 on Fri 12 Apr 2019 02:21 AM (UTC)

Amended on Fri 12 Apr 2019 02:22 AM (UTC) by Fiendish

Message
Ah. I didn't mean to delete the triggers. I meant to delete just the line that says
room_description = Trim (table.concat (description, "\n"))

Leave everything else as it was before.

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

Posted by Engvar   (24 posts)  Bio
Date Reply #7 on Fri 12 Apr 2019 02:35 AM (UTC)

Amended on Fri 12 Apr 2019 02:42 AM (UTC) by Engvar

Message
Ok, put the triggers back in, took that line out, and now I get no errors at least, but still nothing on the map. It's killing me, if I'd been ok without room names, it worked before. He's what I see with Trace on.

Quote:

The Rising End of a Damaged Pier
Rotting fragments of the old pier stick out from between the smooth rocks of
this pier as they rise upward to the north, preventing furture travel. Loops
of drying seaweed hang on the blackened rocks, some of which have cracked from
the immense heat of the catastrophe. To the west, an opening in the wall of a
dilapidated structure has been patched with a scavenged door wedged into the
slot. The fetid smell of intermingled ash, brine, and decay hang in the air
despite the relentless ocean winds from the east. The pier continues
southward toward the remains of the boardwalk and the wreck of a boat.


[Exits: south west]
TRACE: Matched trigger "[Exits:*]"
TRACE: Executing trigger script "got_exits"
(Magical) A fount of clean water flows freely here.
Flimsy cloth and canvas tents line the street here, threatening to topple.
Ryzfur is here, floating in the air.
Thasyl is here.

<1773/1773Hp 1698/1739Mn 649/651Mv | 54G 953S |90/205W| | Ruins of Lords | V1944>
TRACE: Matched trigger InfoBar
TRACE: Matched trigger "^\<(\d+)\s*\/(\d+)\s*Hp (\d+)\s*\/(\d+)\s*Mn (\d+)\s*\/(\d+)\s*Mv "
TRACE: Executing trigger script "DoPrompt"
TRACE: Executing trigger script "do_prompt"


It doesn't look like it's matching on the room name for some reason though. A test trigger that's got an identical target hits it though.

It also doesn't seem to be picking up my prompt. This is the trigger I have for the prompt at the moment.


<triggers>
  <trigger
   enabled="y"
   match="^\<(\d+)\s*\/(\d+)\s*Hp (\d+)\s*\/(\d+)\s*Mn (\d+)\s*\/(\d+)\s*Mv*V*>"
   script="got_prompt"
   sequence="100"
   name="prompt"
   keep_evaluating="y"
  >
  </trigger>


And I have the target for the vnum as wildcard 8. Did I not format correctly to find the vnum?
Top

Posted by Fiendish   USA  (2,558 posts)  Bio   Global Moderator
Date Reply #8 on Fri 12 Apr 2019 03:01 AM (UTC)

Amended on Fri 12 Apr 2019 03:04 AM (UTC) by Fiendish

Message
Quote:
This is the trigger I have for the prompt at the moment

That is a weird mixture of regex but is not marked as a regex trigger. It definitely won't work.


Quote:
TRACE: Matched trigger "^\<(\d+)\s*\/(\d+)\s*Hp (\d+)\s*\/(\d+)\s*Mn (\d+)\s*\/(\d+)\s*Mv "

Suggests that something is matching your prompt. Why not make your bad trigger match the good one?

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

Posted by Engvar   (24 posts)  Bio
Date Reply #9 on Fri 12 Apr 2019 03:15 AM (UTC)
Message
That was the healthbar plugin that was matching on the prompt. All I did to get the trigger target I'm using is take what was in it when I installed the plugin, then move that and add the Vnum that I added to the prompt.

Healthbar

^\<(\d+)\s*\/(\d+)\s*Hp (\d+)\s*\/(\d+)\s*Mn (\d+)\s*\/(\d+)\s*Mv


Mapper

^\<(\d+)\s*\/(\d+)\s*Hp (\d+)\s*\/(\d+)\s*Mn (\d+)\s*\/(\d+)\s*Mv*V*>


The only thing I changed was adding "*V*>" to the end in order to capture the vnum at the end of the prompt.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #10 on Fri 12 Apr 2019 05:52 AM (UTC)

Amended on Fri 12 Apr 2019 05:53 AM (UTC) by Nick Gammon

Message
Yes, but you didn't tell the client that rather complicated sequence was a regexp. Thus it tries to match it literally.

It would be good to see:


  regexp = "y"


... in the trigger.

- Nick Gammon

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

Posted by Engvar   (24 posts)  Bio
Date Reply #11 on Sat 13 Apr 2019 03:27 PM (UTC)
Message
Ok, I changed the target for the prompt so something less complicated that I think should still work. Here's what my triggers look like now.


<triggers>
  <trigger
   enabled="y"
   match="<*Hp * V*>"
   script="got_prompt"
   sequence="100"
   name="prompt"
   keep_evaluating="y"
  >
  </trigger>

<trigger
   back_colour="8"
   enabled="y"
   match="^(?!\(White Aura\)|\(Charmed\)|You).*$"
   match_back_colour="y"
   match_text_colour="y"
   script="got_room_name"
   text_colour="15"
   keep_evaluating="y"
   sequence="90"
   regexp="y"
   bold="y"
   match_bold="y"
   name="room_name"
  >
  </trigger>

<trigger
   back_colour="8"
   enabled="y"
   match="^(?!\(White Aura\)|\(Charmed\)|You).*$"
   match_back_colour="y"
   match_text_colour="y"
   script="got_weather_line"
   text_colour="15"
   keep_evaluating="y"
   sequence="90"
   regexp="y"
   bold="y"
   match_bold="y"
   name="weather_line"
  >
  </trigger>

<trigger
   back_colour="8"
   enabled="y"
   match="[Exits: * ]"
   match_back_colour="y"
   match_bold="n"
   match_inverse="y"
   match_italic="y"
   match_text_colour="n"
   script="got_exits"
   sequence="100"
   text_colour="14"
  >
  </trigger>

  <trigger
   enabled="n"
   match="*"
   script="got_description_line"
   sequence="200"
   name="description_line"
  >
  </trigger>


And now here's what I'm getting when I turn on trace. It looks like it's at least triggering on everything. I'm not sure what the run-time errors are indicating though.

Quote:

Shrine to Mercy and Deliverance
TRACE: Matched trigger weather_line
TRACE: Matched trigger room_name
TRACE: Executing trigger script "got_weather_line"
TRACE: Executing trigger script "got_room_name"
Run-time error
Plugin: Inquisition_Mapper (called from world: GameName)
Function/Sub: got_room_name called by trigger
Reason: processing trigger "room_name" when matching line: "Shrine to Mercy and Deliverance"
[string "Plugin: Inquisition_Mapper"]:217: attempt to get length of local 'name' (a nil value)
stack traceback:
[string "Plugin: Inquisition_Mapper"]:217: in function <[string "Plugin: Inquisition_Mapper"]:213>
A sweet, soporific scent lingers upon the air within this shrine, the calming
TRACE: Matched trigger description_line
TRACE: Executing trigger script "got_description_line"
smell drifting from the riots of fresh red and purple poppies that completely
TRACE: Matched trigger description_line
TRACE: Executing trigger script "got_description_line"
blanket the floor. Wide chevrons of vivid red ibha decorate the dark stone
TRACE: Matched trigger description_line
TRACE: Executing trigger script "got_description_line"
walls of the shrine. The gems glimmer in the soft, flickering candlelight of
TRACE: Matched trigger description_line
TRACE: Executing trigger script "got_description_line"
braun sconces ringing the room. The glass-smooth domed ceiling reflects hazy
TRACE: Matched trigger description_line
TRACE: Executing trigger script "got_description_line"
images of the blooms on the ground and curves to a sharp point at the center.
TRACE: Matched trigger description_line
TRACE: Executing trigger script "got_description_line"
Two oversized misericorde daggers cross above the archway to the south, their
TRACE: Matched trigger description_line
TRACE: Executing trigger script "got_description_line"
blades flecked with dried red blood.
TRACE: Matched trigger description_line
TRACE: Executing trigger script "got_description_line"
TRACE: Matched trigger description_line
TRACE: Executing trigger script "got_description_line"

[Exits: south]
(Glowing) A poppy-shaped braun pedestal holds a book on its open petals here.

<1738/1738Hp 1730/1752Mn 622/622Mv | 54G 903S |89/205W| | City of the Gods | V862>
TRACE: Matched trigger prompt
TRACE: Executing trigger script "got_prompt"
Run-time error
Plugin: Inquisition_Mapper (called from world: GameName)
Function/Sub: got_prompt called by trigger
Reason: processing trigger "prompt" when matching line: "<1738/1738Hp 1730/1752Mn 622/622Mv | 54G 903S |89/205W| | City of the Gods | V862>"
[string "Plugin: Inquisition_Mapper"]:170: bad argument #2 to 'format' (string expected, got nil)
stack traceback:
[C]: in function 'format'
[string "Plugin: Inquisition_Mapper"]:170: in function <[string "Plugin: Inquisition_Mapper"]:162>
Top

Posted by Fiendish   USA  (2,558 posts)  Bio   Global Moderator
Date Reply #12 on Sat 13 Apr 2019 03:32 PM (UTC)

Amended on Sat 13 Apr 2019 03:34 PM (UTC) by Fiendish

Message
Interpreting error messages is the most important skill a programmer can have.

Let's start with
Quote:

Function/Sub: got_room_name called by trigger
Reason: processing trigger "room_name" when matching line: "Shrine to Mercy and Deliverance"
[string "Plugin: Inquisition_Mapper"]:217: attempt to get length of local 'name' (a nil value)


Your room_name trigger calls a function named got_room_name. Does your got_room_name function populate the name variable before trying to find its length? It sounds like the answer is no.

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

Posted by Engvar   (24 posts)  Bio
Date Reply #13 on Sat 13 Apr 2019 03:40 PM (UTC)

Amended on Sat 13 Apr 2019 04:00 PM (UTC) by Engvar

Message
Here's what it has at the moment.


-- Here on room name
-- -----------------------------------------------------------------
function got_room_name (name, line, wildcards)
  local name = wildcards [1]

  -- ignore really long lines
  if #name > 60 then
    return
  end -- if

  room_name = name
  current_exits = nil
  description = { }
  room_description = nil

end -- got_room_name
Top

Posted by Fiendish   USA  (2,558 posts)  Bio   Global Moderator
Date Reply #14 on Sat 13 Apr 2019 04:03 PM (UTC)

Amended on Sat 13 Apr 2019 04:05 PM (UTC) by Fiendish

Message
Here's an experiment for you to run:

On the first line of your function, right after the line that says
function got_room_name (name, line, wildcards)
Insert
require "tprint"
print("MY WILDCARDS ARE")
tprint(wildcards)


Also inspect your room name trigger pattern to see if it matches and captures what you think it should.

https://github.com/fiendish/aardwolfclientpackage
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.


69,396 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.