User Tools

Site Tools


public_scripts:randomrelay

RandomRelay

Randomly picks a link and relays the TurnOn or TurnOff along it. A weighted relay lets you use an uneven probability of choosing links. Instead of ControlDevice or SwitchLink, create ScriptParams links and set the data of each to a number greater than zero. Links with higher numbers are more likely to be chosen than lower numbers.

Inherits BaseTrap
Links ControlDevice, SwitchLink, ScriptParams(weight)
Parameters reusable (boolean) Like the trap control flag Once.
preserve (boolean) Don’t remove the link that is used.
weighted (boolean) Relay along ScriptParams links where some can be more likely than others.
rechargeable (boolean) Keep links, but don’t reuse a link until all others have been triggered. Requires weighted and implies preserve.
public_scripts/randomrelay.txt · Last modified: 2010/11/23 00:06 (external edit)