21.03.2018, 12:08
Try log variables and check in LM logs what could be the source of problem, like below:
Code:
You can try to log it like this:
<?
require('apps')
name = getvar('name')
scriptdata = getvar('script')
log(1, name, scriptdata)
if name and scriptdata then
item = script.get(name)
log(2, item)
if item then
item.script = scriptdata
log(3, item.script)
res = db:update('scripting', { script = scriptdata }, { id = item.id })
log(4, res)
-- save script data to file
script.save(item, true)
log(5, 'After script.save')
-- reload script/group monitor
script.reloadsingle(item)
print('update ok')
else
print('script not found')
end
else
print('invalid arguments')
end
Done is better than perfect