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.
 Entire forum ➜ MUSHclient ➜ MXP and Pueblo ➜ MXP Bug & Question

MXP Bug & Question

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


Posted by Mleo2003   (32 posts)  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.
Top

Posted by Nick Gammon   Australia  (23,098 posts)  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
Top

Posted by Mleo2003   (32 posts)  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.
Top

Posted by Nick Gammon   Australia  (23,098 posts)  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
Top

Posted by Mleo2003   (32 posts)  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.
Top

Posted by Nick Gammon   Australia  (23,098 posts)  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
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.


19,339 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.