[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Setting a timer to input a command every <#here> minutes
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

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

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Silverwood   (12 posts)  [Biography] bio
Date Sun 09 Aug 2009 09:13 PM (UTC)
Message
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
[Go to top] top

Posted by Nick Gammon   Australia  (21,396 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Sun 09 Aug 2009 09:43 PM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Silverwood   (12 posts)  [Biography] bio
Date Reply #2 on Sun 09 Aug 2009 11:37 PM (UTC)
Message
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?
[Go to top] top

Posted by Blainer   (191 posts)  [Biography] bio
Date Reply #3 on Mon 10 Aug 2009 12:21 AM (UTC)

Amended on Mon 10 Aug 2009 12:22 AM (UTC) by Blainer

Message

<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.
[Go to top] top

Posted by Silverwood   (12 posts)  [Biography] bio
Date Reply #4 on Mon 10 Aug 2009 07:41 PM (UTC)

Amended on Mon 10 Aug 2009 07:49 PM (UTC) by Silverwood

Message
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?)
[Go to top] top

Posted by Mm1mark   (24 posts)  [Biography] bio
Date Reply #5 on Mon 10 Aug 2009 08:48 PM (UTC)
Message
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.
[Go to top] top

Posted by Silverwood   (12 posts)  [Biography] bio
Date Reply #6 on Mon 10 Aug 2009 10:01 PM (UTC)
Message
Right - how would I disable the timer then? Thanks for bearing with me in the meantime. =)
[Go to top] top

Posted by Nick Gammon   Australia  (21,396 posts)  [Biography] bio   Forum Administrator
Date Reply #7 on Mon 10 Aug 2009 10:40 PM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Silverwood   (12 posts)  [Biography] bio
Date Reply #8 on Tue 11 Aug 2009 12:56 AM (UTC)

Amended on Tue 11 Aug 2009 01:35 AM (UTC) by Silverwood

Message
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. =)
[Go to top] top

Posted by Nick Gammon   Australia  (21,396 posts)  [Biography] bio   Forum Administrator
Date Reply #9 on Tue 11 Aug 2009 01:41 AM (UTC)
Message
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

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Blainer   (191 posts)  [Biography] bio
Date Reply #10 on Tue 11 Aug 2009 02:55 AM (UTC)
Message

<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.
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


8,303 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]