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.

Delete a script
#1
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
Reply
#2
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.
Reply
#3
Thanks! Duplicates removed and script.reload called once.
Reply


Forum Jump: