Logic Machine Forum
Delete a script - 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: Delete a script (/showthread.php?tid=4625)



Delete a script - spyder - 06.03.2023

I accidentally created 200+ scheduled scripts, and want to now delete them.

Would this function work if I know the id of every script? Just want to be careful not interfering with internal script behaviour...

Code:
--------------------------------------------------------------------------------------------
-- Delete a script
--
-- @param id          number        id of script to delete
--
--------------------------------------------------------------------------------------------
function ScriptUtilities.delete(id)
 
  db:query('DELETE FROM scripting WHERE id = ' .. id)
 
  script.reload(true)
   
end



RE: Delete a script - admin - 06.03.2023

This should work. script.reload can be called once all scripts are deleted. There's no need to call it each time a single script is deleted.


RE: Delete a script - spyder - 06.03.2023

Thanks! Duplicates removed and script.reload called once.