Posted 15 July 2012 - 04:56 PM
How do I save a variable without using a custom api? I want to have my lock program preserve what side the redstone output is on when the world resets, but I cannot figure out how to go about it.
local function save(data)
f = io.open("rsData", "w")
f:write(tostring(data))
f:close()
end
local function load()
f = io.open("rsData", "r")
rData = f:read("*l")
if rData == "true" then
return true
elseif rData == "false" then
return false
else
return nil
end