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.

Any way to delete all NON LM objects?
#7
Use this for JSON:
Code:
require('json')
file = '/home/ftp/data.json'
data = json.pdecode(io.readfile(file))

if type(data) == 'table' and type(data.objects) == 'table' then
  for id, obj in pairs(data.objects) do
    id = tonumber(obj.id or id)

    if type(id) == 'number' and type(obj.name) == 'string' then
      db:update('objects', { name = obj.name }, { id = id })
    end
  end

  os.remove(file)
end
Reply


Messages In This Thread
RE: Any way to delete all NON LM objects? - by admin - 21.11.2018, 11:28

Forum Jump: