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, 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 ➜ General ➜ Can triggers fire off MUSHclient output?

Can triggers fire off MUSHclient output?

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


Posted by Terrori   (3 posts)  Bio
Date Fri 26 Jun 2020 07:49 AM (UTC)
Message
All my triggers at the moment fire off what the MUD tells me, e.g. losing concentration, a mob dying etc etc. Is it possible to also trigger off MUSHclient output?

An example would be for the speedwalk plugin where at the end, it says "Speedwalk completed." but I can't figure out if it's possible to trigger off these kinds of output. For all intensive purposes, this output seems to be invisible.

Thank you very much for any suggestions.
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #1 on Fri 26 Jun 2020 12:30 PM (UTC)

Amended on Fri 26 Jun 2020 12:31 PM (UTC) by Fiendish

Message
Quote:
Is it possible to also trigger off MUSHclient output?

Yes, but only if you use Simulate to produce that output.

Quote:
For all intensive purposes

You mean "intents and purposes".

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

Posted by Nick Gammon   Australia  (23,070 posts)  Bio   Forum Administrator
Date Reply #2 on Fri 26 Jun 2020 10:27 PM (UTC)
Message
You could conceivably use the OnPluginScreendraw callback inside a plugin. There is an example below.

If you are not using this function elsewhere (eg. in a screen reader) then this should work:



<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>

<muclient>
<plugin
   name="OnPluginScreendraw_test"
   author="Nick Gammon"
   id="2769a929215da74418b0bfc4"
   language="Lua"
   purpose="tests OnPluginScreendraw"
   date_written="2020-06-27 09:11:00"
   requires="4.72"
   version="1.0"
   >

</plugin>

<!--  Script  -->

<script>
<![CDATA[
function OnPluginScreendraw(t, log, line)
  if t == 1 and line == "Speedwalk completed." then
    print "We detected the Speedwalk completed message"
  end -- if
end

]]>
</script>


</muclient>



It detects a "note" line (type 1) and checks for the message you are interested in, and then you could act on seeing that message.


http://www.gammon.com.au/scripts/doc.php?general=plugin_callbacks

- Nick Gammon

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

Posted by Nick Gammon   Australia  (23,070 posts)  Bio   Forum Administrator
Date Reply #3 on Sat 27 Jun 2020 05:50 AM (UTC)
Message
Terrori said:

...

Is it possible to also trigger off MUSHclient output?

An example would be for the speedwalk plugin where at the end, it says "Speedwalk completed." but I can't figure out if it's possible to trigger off these kinds of output.

...


Strictly speaking, that is not "output". The word output suggests it is going somewhere (like to the MUD). Messages like "Speedwalk completed." are really "note" messages, that is, they are notes on your screen which are neither received from the MUD, nor typed by you.

The two main things MUSHclient provides for you are:


  1. Triggers - which can react to messages from the MUD
  2. Aliases - which can react to things you type


Note messages are intended just to help you know what is going on, in this case that a speedwalk has completed.

You could conceivably amend the speedwalk plugin to do a BroadcastPlugin function call - that would notify other plugins that something had happened (like a speedwalk ending).

Or you could do an "Execute" call, which could then be picked up by an alias - since the Execute calls are sent to the command processor.

http://www.gammon.com.au/scripts/doc.php?function=BroadcastPlugin

http://www.gammon.com.au/scripts/doc.php?function=Execute

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


12,697 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.