Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Enabling a Timer with a timer...having trouble

Enabling a Timer with a timer...having trouble

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


Posted by Tigers12   (10 posts)  Bio
Date Mon 15 Mar 2010 08:15 PM (UTC)

Amended on Mon 15 Mar 2010 08:26 PM (UTC) by Tigers12

Message

<timers>
  <timer name="autop" enabled="y" minute="1" second="30.00"    send_to="12"
>
  <send>EnableTimer(PY1, true)
EnableTriggerGroup(PickY, true)</send>

  </timer>
</timers>


I would like to keep a timer running that will start/enable a different timer and a trigger group (of 2 triggers)every 90 seconds.


I keep getting a run-time error:

[string "Timer: autop"]:1: bad argument #1 to 'EnableTimer' (string expected, got nil)
stack traceback:
[C]: in function 'EnableTimer'
[string "Timer: autop"]:1: in main chunk


I am a newb (as you can see), though I have learned how to use triggers and aliases and combine them pretty well at this point. I have less to no experience with timers.

If anyone can point out mistake, I will appreciate it.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Mon 15 Mar 2010 08:28 PM (UTC)
Message
It says argument 1 is expected to be a string but you sent nil.

This is what you did:


EnableTimer(PY1, true)


I presume you mean:


EnableTimer("PY1", true)


This is because "PY1" is a string. However PY1 on its own is a variable, which will be nil if you don't put anything in it.

This would work:


timername = "PY1"
EnableTimer(timername, true)


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Tigers12   (10 posts)  Bio
Date Reply #2 on Mon 15 Mar 2010 08:33 PM (UTC)
Message
I apologize for my density and for your time. I have a hundred or more Triggers and Aliases that contain EnableTrigger("X", true/false) with the quotations, and I have no idea when I typed the first EnableTimer I left them out. I am embarrassed, and I thank you very much.
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.


12,259 views.

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

Go to topic:           Search the forum


[Go to top] top

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