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.

Backup/restore object values with storage.set/get?
#2
If this is inside a single script you don't need to use storage at all.
Code:
backuplist = { '1/1/1', '1/1/2' }
-- save current values
values = {}
for _, addr in ipairs(backuplist) do
  values[ addr ] = grp.getvalue(addr)
end

...

-- restore values
for addr, value in pairs(values) do
  grp.write(addr, value)
end
Reply


Messages In This Thread
RE: Backup/restore object values with storage.set/get? - by admin - 21.09.2021, 14:59

Forum Jump: