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 ➜ Lua ➜ What an command is going to be...

What an command is going to be...

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


Posted by Swalec   (24 posts)  Bio
Date Tue 07 Apr 2009 09:03 PM (UTC)
Message
I want to set some triggers when certain commands are sent to the mud. Very easy, I hear you cry. Well, yes, but I would like to do it even when they are sent after alias expansion.

So, for instance, say I have a command

cast 'blindness'

with alias "bli". I would like a trigger to call when I type either.

What I would like, then is to be able to ask mushclient "what will this expand to" -- in otherwords, do "Execute" but don't send anything.

Alternatively, being able to find out what the last command sent by Execute was would be fine.

Is this possible?

Swalec
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #1 on Tue 07 Apr 2009 10:53 PM (UTC)
Message
See:

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

In a plugin, you could make a function OnPluginSend or OnPluginSent (OnPluginSent is probably what you want).

This lets you know that some text is definitely being sent to the MUD. Then by using a regular expression matcher in that function you could react appropriately.

- Nick Gammon

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

Posted by Swalec   (24 posts)  Bio
Date Reply #2 on Wed 08 Apr 2009 08:07 PM (UTC)
Message
Unfortunately, I was doing this inside my lua script rather than a plugin.

I guess I can either turn this into a plugin, or write a minimal plugin to grab the expansion, then set a variable.

Thanks!

Swalec

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.


13,414 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.