10.11.2022, 09:43
Create a scheduled script that runs every minute. Make sure that the event you want to check has a unique name.
Code:
now = os.date('*t')
now_mins = now.hour * 60 + now.min
name = 'unique event name'
evt = db:getrow('SELECT * FROM scheduler_events WHERE name=?', name)
if evt then
evt_mins = evt.start_hour * 60 + evt.start_min
delta = evt_mins - now_mins
if delta == 30 then
-- 30 minutes before the event
-- do something here
end
else
alert('event not found')
end