Question about time <LUA>

Posted by AquaBrother on Sat 30 May 2009 03:58 PM — 7 posts, 28,743 views.

Brazil #0
hi folks, i'd like to make a trigger or timer that send a command to the world if i get iddle for 10 minutes or more, is that possible to be done? I tried to found a commando with theses properties but i couldnt find a properly one...

Thx for your support!

Regards
#1
What do you mean 10 minutes or more?

Do you need the command every 10 minutes? So first 10 minutes idle and then again at 20 minutes if you are still idle?


It's not quite what you want but every ten minutes this timer checks if you are looking at the world window, and if you aren't looking at the window the timer sends a command.

<timers>
  <timer name="look_if_inactive" enabled="y" minute="10" second="0.00" offset_second="0.00"    send_to="12"
>
  <send>active = GetInfo(113)

if active == false then
Send("look")
end</send>

  </timer>
</timers>
Amended on Sat 30 May 2009 06:22 PM by RichKK
Australia Forum Administrator #2
See http://www.gammon.com.au/mushclient/plugins/ and look for "AFK_timer" (near the top). That is what you want.
Brazil #3
i want just a simple trigger that send a message to the world if i'm not looking at the window at each interval of time. Lets say that i minimized the mushclient windown, so, i want that in each interval of 10 minutes the trigger send a simple command to the world, just to unable the game to kick me off for not being "playing"... just it, i dont think that's necessary to use a whole plugin... is it?

Regards



Australia Forum Administrator #4
Well it needs to know you are not playing, and the plugin I mentioned does that by checking if you have sent anything. Every time you send something it resets a timer, so that it starts counting again. If the time is up (and you can configure the time) it sends a specified command. So to stay logged in you could send "look" or "score" or some such thing.

The plugin is quite short, and the whole idea behind plugins was to save having to explain "make a trigger, two timers and an alias" to achieve something. It is all in the one spot.
Brazil #5
all right, i got it, the problem now is, how do i put this plugin in my mushclient? rofl... i'm sorry i'm newbie... xD
Australia Forum Administrator #6
The instructions are on the plugins page I linked to above. Look for "How to install a plugin" near the bottom of the page.