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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  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] Refresh page


Posted by Swalec   (24 posts)  [Biography] 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
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] 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
[Go to top] top

Posted by Swalec   (24 posts)  [Biography] 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

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


10,400 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]