Group timer in AddTimer

Posted by Cyb Ercho Lin on Sat 20 Jan 2018 06:23 PM — 3 posts, 17,793 views.

Argentina #0
Hello
I tried to do the following code using the addtimer command, but I can not define the group name within the addtimer function.
In the help :
http://www.gammon.com.au/scripts/function.php?name=AddTimer
it does not come like defining the group of the timer.


<timers>
  <timer name="label" enabled="y" minute="3" second="0.00" offset_second="0.00"    temporary="y"
group="testgroup" one_shot="y" >
  <send>look</send>

  </timer>
</timers>



in which part was the group name defined?

AddTimer ("label", 0, 3, 0, "look", timer_flag.Enabled + timer_flag.OneShot, "")
Amended on Sat 20 Jan 2018 06:25 PM by Cyb Ercho Lin
USA Global Moderator #1
AddTimer doesn't directly support group names, but you can use SetTimerOption to set the group right after adding it.
Amended on Sat 20 Jan 2018 08:12 PM by Fiendish
Australia Forum Administrator #2
You can also add timers in XML format which supports all of the possible options, as that is what is used by the client to load them from the world file. See:

http://www.gammon.com.au/forum/?id=7123

For example, in your case:


require "addxml"

addxml.timer {  
    name="label",
    enabled="y",
    minute="3",
    temporary="y",
    group="testgroup",
    one_shot="y",
}