Enabling a Timer with a timer...having trouble

Posted by Tigers12 on Mon 15 Mar 2010 08:15 PM — 3 posts, 12,638 views.

#0

<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.
Amended on Mon 15 Mar 2010 08:26 PM by Tigers12
Australia Forum Administrator #1
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)

#2
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.