Setting a timer to input a command every <#here> minutes

Posted by Silverwood on Sun 09 Aug 2009 09:13 PM — 11 posts, 47,545 views.

#0
The one thing I really need to get out of MUSHclient is this: repeating a text command to a server every, say, 5 minutes.

Could someone please provide an example as to how I can do this? I'm new to the program, so I would truly appreciate a detailed explanation.

Of course, if this question has already been answered, then a link to the topic would be good. If you can spare some time though, a direct response would be great!

Thanks to everyone for participating,
Silverwood
Australia Forum Administrator #1
You mean like this?


<timers>
  <timer enabled="y" minute="5" >

  <send>sigh</send>

  </timer>
</timers>


See: http://mushclient.com/pasting for how to copy that example into the client.
#2
Thanks! This code looks really intuitive ... hope I can get the hang of it soon.

One last question - it's a beginner's, but I can't seem to figure out how to solve it: how would I activate/deactivate the said timer?
#3

<timers>
  <timer name="New_Timer" enabled="y" minute="5" second="0.00" offset_second="0.00" >
  <send>Sign</send>

  </timer>
</timers>

<aliases>
  <alias
   match="StartTimer"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>EnableTimer ("New_Timer", true)</send>
  </alias>
</aliases>

The timer now has a name="New_Timer".
The alias is set to Send_To="12" for script and uses the function EnableTimer.

StartTimer from the command line will enable the timer.
Amended on Mon 10 Aug 2009 12:22 AM by Blainer
#4
Wow! I didn't expect anyone to give me the tags straight off - thanks!

I assume that the timer stops working and will need to be activated again after I turn off & turn on the client? (Which leads to another question as well: would I need to load this timer every time I turn on the client?)
Amended on Mon 10 Aug 2009 07:49 PM by Silverwood
#5
I assume that the timer stops working and will need to be activated again after I turn off & turn on the client? (Which leads to another question as well: would I need to load this timer every time I turn on the client?)


no, if you save your world settings you won't need to redo anything. if you leave the timer enabled it will still be enabled the next time you connect. and so long as you save the world stuff it will automatically have your scripts, variables, triggers and timers each and everytime.

the only time you have to worry about the triggers and timers is if your adjusting them. either from enabled to disabled or adjusting what each does, so instead of sigh you want it to do who. otherwise if it does what you want leave it.
#6
Right - how would I disable the timer then? Thanks for bearing with me in the meantime. =)
Australia Forum Administrator #7
Do you mean with an alias, or just if you happen to want to? There is a GUI interface you know. Press Alt+Enter and then look at the Timers list. If you edit your timer there is an Enabled checkbox. Just click that.
#8
OK, I see. As you can observe, my knowledge of this software is close to 0, so I appreciate everyone bearing with me in the meantime.

Thanks to everyone who helped. =)
Amended on Tue 11 Aug 2009 01:35 AM by Silverwood
Australia Forum Administrator #9
The "Getting Started" part of this forum has some useful tips, including screen shots and videos:

http://www.gammon.com.au/forum/?bbtopic_id=120
#10

<aliases>
    <alias
        match="ToggleTimer"
        enabled="y"
        send_to="12"
        sequence="100"
    >
    <send>if GetTimerInfo ("New_Timer", 6) then
            EnableTimer ("New_Timer", false)
            Note ("New_Timer timer disabled.")
        else
            EnableTimer ("New_Timer", true)
            Note ("New_Timer timer enabled.")
        end
    </send>
    </alias>
</aliases>

This will toggle New_Timer on and off when ToggleTimer is entered at the command line.

Quote:

The one thing I really need to get out of MUSHclient is this: repeating a text command to a server every, say, 5 minutes.

If you read "Edit Timer" from Help -> Contents menu you can see all the options for the Game -> Configure -> Timers dialog.
If you set the time to the time desired and leave the Send To to the default "World" you can put a list of commands in the Send box
that will be sent to the MUD every time the the timer fires.