(26.11.2020, 07:35)admin Wrote: You can change the running time for a scheduled script via db queries.
This event script is attached to the time/day object and you need to change 3 to your scheduled script id (see this: https://forum.logicmachine.net/showthrea...0#pid19070):
Code:id = 3 -- scheduled script id
value = event.getvalue()
params = string.format('%d %d * * *', value.minute, value.hour)
db:update('scripting', { params = params }, { id = id })
script.reloadsingle({ type = 'scheduled' })
Wow this looks very simple, is there a manual for things like this?
it is working for me, but im wondering how you know this.
i made next script with knowing how to use it.
Code:
Airco_status = event.getvalue()
if Airco_status == true then
id = 110 -- scheduled script id
params = string.format('5 * * * *') --starts every 5 minutes
db:update('scripting', { params = params }, { id = id })
script.reloadsingle({ type = 'scheduled' })
else
id = 110 -- scheduled script id
params = string.format('* 1 * * *') --starts every hour
db:update('scripting', { params = params }, { id = id })
script.reloadsingle({ type = 'scheduled' })
end