require('addon')
local function reload_script()
local script_name = debug.getinfo(1, 'S').source:sub(2)
print(string.format('Script %s is reloaded!', script_name))
clearTasks()
collectgarbage()
dofile(script_name)
end
function onRunCommand(cmd)
if cmd:find('^!ref') then
reload_script()
return false
end
end
-- test flood
newTask(function()
while true do
wait(2000)
print('version: 1')
end
end)