Logic Machine Forum
enable disable schedulers - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: enable disable schedulers (/showthread.php?tid=1141)



enable disable schedulers - emdolivier - 20.12.2017

Hi,

is there a way to enable, disable schedulers and scenes with a script like,


value1 = event.getvalue()
if value1 == true then
  schedulers.disable('name')
  scenes.disable('name')
end


RE: enable disable schedulers - Erwin van der Zwart - 20.12.2017

Hi,

You can't enable / disable schedulers by script, but you can create some logic and use a internal object for the scheduler and attach script below to it and create a internal object to set the en/disable state.
Code:
address_en_disable = '32/0/2'
address_output = '1/1/1'

if event.getvalue() == true and grp.getvalue(address_en_disable) == true then
 grp.write(address_output, true)
else
 grp.write(address_output, false)
end

For scenes commands see http://openrb.com/docs/lua.htm#11

BR,

Erwin


RE: enable disable schedulers - admin - 21.12.2017

There's an unfinished scheduler control library: https://gist.github.com/jsopenrb/e2eb174e243a791ef2ec252f633205de

Create new user library called scheduler, then use it in your code like this:
Code:
scheduler = require('user.scheduler')
scheduler.enable('name')

As Erwin mentioned, scene control is already built-in