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 ➜ General ➜ Transperant Alias...?

Transperant Alias...?

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


Posted by RasmusKL   (15 posts)  Bio
Date Sat 16 Dec 2006 10:59 AM (UTC)
Message
I'm trying to create a transperant alias, that is, one that reports every command (and alias) to a script function, but it's not really that easy it seems :-)

The purpose of the alias is to record user interaction, so it can be outputted (or repeated) later.

So, as an example:

e
n
ed [alias: open east door]
e

should give 4 calls to the function, one problem I can see atleast, even if I could make it work, is that the actual sequence is:

e
n
ed [alias: open east door]
<open east doodr>
e

with an extra command, that I'm not interested in..

Any hints, workarounds? I tried creating a '*' alias with "Keep Evaluating", but to no avail.

I'm -only- interested in recording user commands, not triggers etc.

Thanks,
- Rasmus.


Top

Posted by RasmusKL   (15 posts)  Bio
Date Reply #1 on Sat 16 Dec 2006 11:02 AM (UTC)
Message
Ahh...

I think I found a work-around, using GetCommandHistory() ;-)
Top

Posted by RasmusKL   (15 posts)  Bio
Date Reply #2 on Sat 16 Dec 2006 11:12 AM (UTC)
Message
Mmm.. Make that GetCommandList()... But it wasn't as smart as I'd hoped, it doesn't remember repeated commands :-(

so

e
s
s
s
w

becomes

e
s
w

... :-(
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #3 on Sat 16 Dec 2006 06:39 PM (UTC)
Message
See:

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

Look for OnPluginCommandEntered.

Inside a plugin, you can see what commands the player has actually typed when they pressed <enter>. This should do what you want.

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


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