AFK Trigger/Replier

Posted by Calimun on Wed 18 Jul 2007 12:16 AM — 7 posts, 33,411 views.

#0
Heya,

I probably passed over it somewheres in the forum, and probably sticking out like a sore thumb. But I was wondering if anyone knew if there was a plugin/script trigger that allowed the client to go afk when I don't manually input anything for so long, then automatically reply to Tells while I'm set afk. When a manual input is made, it then snaps awake. Ya know what I mean?

Thanks to anyone who can point me in the right direction/create such a script for me. I just upgraded to MUSHclient 4.01.
USA #1
Well, I don't know if I'll write if for you, but I can tell you what you need, if you know how to script you could do it yourself(It's always good to know how something works in case you need to mod/fix it), otherwise maybe somebody else here would have the time to help you with it.


OK, the things you'd need are as follows:

* A reply trigger to reply to the tells. Initially disabled, it would be activated/deactivated by a script.
* An 'afk' alias to do all the script stuff required to enable the reply trigger, both by a timer, and if you type afk manually. This would also disable the timer if it wasn't already so(In case you typed afk manually).
* A one-shot timer(Meaning 'only fire once' not 'temporary', it needs to be reused but it only needs to send AFK once until you send another command.) set to whatever duration you want it to wait before sending the AFK, with the Send To box set to Execute so it'll run the afk alias.
* A script in the OnPluginCommandEntered/OnPluginSent callback to reset the timer so that it won't run for another <duration>, reenable it if it's already run, and disable the reply trigger. Hmm... this /might/ conflict with the AFK alias, so be careful.
* Optionally a script variable(Not world variable since you don't need to save across sessions) to record whether you are in AFK "mode" or not for use in the various script routines, this /should/ be identical to whether the reply trigger is enabled though, so you could just check the trigger's enabled status instead, although the variable would probably be easier to check.

I /think/ that is it, I could be wrong though.

Whew, that took me half-an-hour, maybe I should've just wrote the darn thing instead, it probably would've been faster, but then again, then you wouldn't learn anything.
USA #2
It is almost always better to teach how to fish than to just give a fish. :-)

(If anything, because you usually field less questions yourself as time goes on! :P)
#3
Yeah, about that...

I tried scripting at many points in my life. I was acturally in a Information Technology college course. I used to be really good at it, but as years go by, it just frustrates the heck outta me when it comes to creating my own stuff from scratch. If I was to have a piece of script in front of me, I can usually pick it apart and find out how it ticks, but that's it.

I want to make my own, I would rather be self-sufficient, but I know it would be a couple months before I would ever produce it. I'd rather have it now, as my client has a anti-idle timer (which I need, because for some reason, my router cuts the connection after it idles for so long...and I haven't figured out why) So at times when I'm afk, my friends think I'm ignoring them.

I mean, if you guys have anything simpler already made, that's awesome. (instead of replying, I just need it to send 'page #away' and 'page #!away' when afk/back) If not, if you feel like making a script, that's cool too.

Thanks in advance.
USA #4
Without knowing what mud/mush you play on, it's hard to create a script for that purpose. I'll start poking around with making one for myself, but I'm having some severe issues with scripting with Lua for some reason I can't figure out. Due to the large possibility of me randomly crashing my client, I can't promise to have anything working anytime soon.
#5
I didn't think the script would depend on the muck, as the script I had in mind would be mostly client-side. Anything that had to do with the muck, I could then just fill in myself.

Though, since I don't know much scripting myself, maybe you had a better idea.
Australia Forum Administrator #6
There is something similar described here:

http://www.gammon.com.au/forum/?id=7488

That one actually disconnects after you are AFK for a while - but the general technique of detecting if you are AFK is there. It keeps track of when you last entered a command, and uses a timer.

Now rather than disconnecting, it could enable a trigger, and that trigger could auto-reply to people. Once you type something, it disables that trigger.