31.05.2023, 06:44
Save all objects IDs with export enabled to storage:
Restore from storage:
Code:
ids = db:getlist('SELECT id FROM objects WHERE export=1')
storage.set('export_ids', table.concat(ids, ','))
Restore from storage:
Code:
ids = storage.get('export_ids')
if type(ids) == 'string' and #ids > 0 then
db:query('UPDATE objects SET export=1 WHERE id IN (' .. ids .. ')')
end
script.reloadbacnet()