Transperant Alias...?

Posted by RasmusKL on Sat 16 Dec 2006 10:59 AM — 4 posts, 17,804 views.

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


#1
Ahh...

I think I found a work-around, using GetCommandHistory() ;-)
#2
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

... :-(
Australia Forum Administrator #3
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.