Hi
I was wondering if there is any way to trigger an event randomly from a group of 10, over a period of time ?
I have 10 UDP-connected lights that I would like to randomly sequence.
Any ideas ?
Thanks in advance
Si
Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
Random Triggers
Re: Random Triggers
think you'd do it with a scritp..
i'm not good at python but a quick google search gave me this:
http://effbot.org/pyfaq/how-do-i-genera ... python.htm
import random
print random.randrange(1,10)
so i guess your scritpt would be something like this:
import random
eg.TriggerEvent("randomBlinkingLight." + random.randrange(1,10))
if i'm not mistaken it would trigger an event named:
randomBlinkingLight.1 to randomBlinkingLight.10
then you can drag that to the correct udp command macro.
So step-by-step:
1, set an timmer with scheduleghost or simmular to trigger event "myBlinkingLightTrigger" or something.
2, drag this trigger to a macro with the above script, (also if you want the other lights to turn off here could be a good place to add udp commands to turn all lights off)
3, drag the triggers from the script to macros containing the corresponding udp command.
i'm not good at python but a quick google search gave me this:
http://effbot.org/pyfaq/how-do-i-genera ... python.htm
import random
print random.randrange(1,10)
so i guess your scritpt would be something like this:
import random
eg.TriggerEvent("randomBlinkingLight." + random.randrange(1,10))
if i'm not mistaken it would trigger an event named:
randomBlinkingLight.1 to randomBlinkingLight.10
then you can drag that to the correct udp command macro.
So step-by-step:
1, set an timmer with scheduleghost or simmular to trigger event "myBlinkingLightTrigger" or something.
2, drag this trigger to a macro with the above script, (also if you want the other lights to turn off here could be a good place to add udp commands to turn all lights off)
3, drag the triggers from the script to macros containing the corresponding udp command.
-
holdestmade
- Experienced User
- Posts: 182
- Joined: Thu Dec 04, 2014 2:44 pm
Re: Random Triggers
Brill, worked a treat !
Thanks very much.
Thanks very much.
Re: Random Triggers
Thanks for the great info!
I had to make a teeeny little change to get it working, but otherwise it was perfect!
I had to make a teeeny little change to get it working, but otherwise it was perfect!
Code: Select all
import random
eg.TriggerEvent("Playlist." + str(random.randrange(1,4)))