What an command is going to be...

Posted by Swalec on Tue 07 Apr 2009 09:03 PM — 3 posts, 15,522 views.

#0
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
Australia Forum Administrator #1
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.
#2
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