|
Krubba Newbie
Joined: 29 Apr 2004 Posts: 2 Location: Sweden
|
Posted: Thu Apr 29, 2004 11:21 pm
Auto Away trigger |
I'm trying to do an AutoAway trigger. Let's say I haven't
pressed the enter button for 10 minutes, then I will reply to
anyone that tells me anything that I'm autoaway, I have been
away for 10 minutes.
What I want to do is to reset the @AutoAway variable
everytime I press enter. So here is my problem, how do I
bind the RETURN button to reset a variable? |
|
|
|
Lirril Novice
Joined: 23 Oct 2000 Posts: 44 Location: Ireland
|
Posted: Fri Apr 30, 2004 1:19 pm |
It might be easier to do this win an input trigger, so anytime you type anything and send it to the mud, it resets the variable.
Something innefficient like #ONINPUT {*} {lastCommandTime=%ctime} would probably satisfy your requirements, though #ONINPUT {^$} {lastCommandTime=%ctime} might also work.
Then you can trigger something like:
#TRIGGER {(*) tells you, } {#if (%ctime-lastCommandTime)>120 tell %1 Info: I've been away from my keyboard for %eval((%ctime-@lastCommandTime)/60) minutes.}
- Lirril |
|
|
|
Krubba Newbie
Joined: 29 Apr 2004 Posts: 2 Location: Sweden
|
Posted: Mon May 03, 2004 1:49 am |
Ah, thanks Lirril. That helped me alot :-)
|
|
|
|
|
|