[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  MXP and Pueblo
. . -> [Subject]  MXP Bug & Question

MXP Bug & Question

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


Posted by Mleo2003   (32 posts)  [Biography] bio
Date Thu 20 Sep 2012 03:41 AM (UTC)
Message
2 things. First is, whenever I use the mxp callbacks in my plugin (simple test plugin, function only appends mxp arg to note), all my send tags break, and are no longer clickable, even when I explicitly return 0.

Second is a question. Is there a way to only pull MXP from certain lines? The mud uses mxp for clickable links in many places, but I only want to parse and use the information from certain lines. I'm not sure how to setup a trigger to enable/disable mxp parsing on that line. I don't know if the trigger function would fire after the mxp callback, or before, and how to handle pulling the information after that.
[Go to top] top

Posted by Nick Gammon   Australia  (22,982 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Thu 20 Sep 2012 04:37 AM (UTC)
Message
Can you show your example test plugin?

I don't know of an easy way to make MXP be only occasionally parsed, if that is what you are asking. If not, can you give more details?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Mleo2003   (32 posts)  [Biography] bio
Date Reply #2 on Thu 20 Sep 2012 12:34 PM (UTC)
Message
Well, the plugin is really empty, save for Notes on Install and Close, and then this:

function OnPluginMXPopenTag (name)
  AppendToNotepad ("MXP", "Opening tag: " .. name .. "\r\n")
  return 0
end -- function


This is all in Lua.

As for the conditional, the line I'm looking for contains an MXP entry in the middle of it, that displays one message, but when clicked sends another to the Mud. I'd like to watch for that line, and pull the href from only that line (it's a SEND tag). There are multiple SEND tags, though.

I was thinking if I had the script just put the last seen MXP information in a global variable in my script, then when the trigger fired, it could pull from there and use that, but I don't know if the MXP callback would fire before or after the trigger function to know if that would work.
[Go to top] top

Posted by Nick Gammon   Australia  (22,982 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Fri 21 Sep 2012 03:14 AM (UTC)
Message
You should be able to use OnPluginMXPopenTag where the arguments are passed to the function, eg.


function OnPluginMXPopenTag (name, args, mylist)


end -- function


I think this will be processed before the trigger because MXP tags are processed as they are hit, and the trigger is processed when the line ends.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Mleo2003   (32 posts)  [Biography] bio
Date Reply #4 on Fri 21 Sep 2012 04:06 AM (UTC)

Amended on Fri 21 Sep 2012 11:54 PM (UTC) by Mleo2003

Message
I tried that first, as the help files show. The last 2 arguments do not pass anything and are nil. Even the help files I found online mention this as intended behavior in Lua.

I think that hould work as well, so I can just let MXP set a variable and the trigger will pull from that. Only issue left is even if OnPluginMXPOpenTag just returns 0, I lose my clickable links.

*EDIT* I even just put the empty function you posted in a plugin, and tried it again. Even that causes my clickable links to go away. The text is still there, but they are no longer clickable at all.
[Go to top] top

Posted by Nick Gammon   Australia  (22,982 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Sat 22 Sep 2012 05:06 AM (UTC)
Message
This is a bug in that callback handler. Fixed in version 4.82.

(comma in the wrong place)

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] 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.


17,848 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]