16.06.2021, 09:19
Use this:
Code:
data = [[alert('testing')]]
name = 'imported_from_ftp'
item = script.get(name)
if item then
item.script = data
-- update script code in the database
db:update('scripting', { script = data }, { id = item.id })
-- update script code in the filesystem
script.save(item, true)
-- restart script
script.disable(name)
script.enable(name)
end