I have made an idle counter, as you appear to the MUD (so based on the last command sent) as opposed to the last command entered clientside.
I have a somewhat functioning implementation, using a redefined version of Send,
as inspired from http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=5434
and an alias,
This catches everything that does not begin with '/' (for script command), '#' (the chat plugin) or is another alias as it has the latest sequence in my list.
Between them, they appear to catch every sent command (be it from the command line or a macro), except when something uses the 'Send to World' option.
Of course, a work around for the 'Send to World' is to instead 'Send to Script' or 'Send to Execute', and just use Send...
I was wondering if there was a way to redefine the send from command line and 'Send to World' to use this new Send, without having to go through the extra alias or sending to script or execute.
Just so you know where I end up with all this, here is my status bar
which is called from a timer to update every second.
I have a somewhat functioning implementation, using a redefined version of Send,
OldSend=Send
function NewSend(...)
for i,v in ipairs(arg) do
OldSend(v)
end
option.idle=os.time()
end
Send=NewSend
as inspired from http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=5434
and an alias,
<aliases>
<alias
match="^((?<!/)|(?<!#)).*$"
enabled="y"
regexp="y"
send_to="12"
sequence="999"
>
<send>Send("%0")</send>
</alias>
</aliases>
This catches everything that does not begin with '/' (for script command), '#' (the chat plugin) or is another alias as it has the latest sequence in my list.
Between them, they appear to catch every sent command (be it from the command line or a macro), except when something uses the 'Send to World' option.
Of course, a work around for the 'Send to World' is to instead 'Send to Script' or 'Send to Execute', and just use Send...
I was wondering if there was a way to redefine the send from command line and 'Send to World' to use this new Send, without having to go through the extra alias or sending to script or execute.
Just so you know where I end up with all this, here is my status bar
function StatusBar()
local sb
sb="Idle: "..TimeSince(option.idle)
--sb=sb..whatever_else_I_deem_useful_to_display
--sb=sb..etc
SetStatus(sb)
end
which is called from a timer to update every second.