This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Scheduler Status
#4
Hello, how can I simplify the script following this criterion?
Code:
-- scheduler1
id = 1
active = db:getone('SELECT active FROM schedulers WHERE id=?', id)
active = toboolean(active)
grp.checkupdate('40/0/' .. id, active)

-- scheduler2
id = 2
active = db:getone('SELECT active FROM schedulers WHERE id=?', id)
active = toboolean(active)
grp.checkupdate('40/0/' .. id, active)

-- scheduler3
id = 3
active = db:getone('SELECT active FROM schedulers WHERE id=?', id)
active = toboolean(active)
grp.checkupdate('40/0/' .. id, active)

-- scheduler4
id = 4
active = db:getone('SELECT active FROM schedulers WHERE id=?', id)
active = toboolean(active)
grp.checkupdate('40/0/' .. id, active)

-- scheduler5
id = 5
active = db:getone('SELECT active FROM schedulers WHERE id=?', id)
active = toboolean(active)
grp.checkupdate('40/0/' .. id, active)
Reply


Messages In This Thread
Scheduler Status - by Zandkever - 24.05.2021, 14:02
RE: Scheduler Status - by admin - 25.05.2021, 04:50
RE: Scheduler Status - by Zandkever - 25.05.2021, 13:59
RE: Scheduler Status - by davidchispas - 23.06.2022, 14:00
RE: Scheduler Status - by admin - 24.06.2022, 05:51
RE: Scheduler Status - by BartR - 25.06.2023, 19:46
RE: Scheduler Status - by admin - 26.06.2023, 08:36
RE: Scheduler Status - by BartR - 26.06.2023, 13:48

Forum Jump: