Posted 12 February 2013 - 11:48 AM
how do i save
door1 = open
so when it reboots it nows door1 equals open
door1 = open
so when it reboots it nows door1 equals open
door1 = "open"
-- lets write it to a file
file = fs.open("myConfigFile", "w") -- 'w' for write mode
file.write(door1)
file.close() -- always close a file handle
-- lets read it from a file
file = fs.open("myConfigFile", "r") -- 'r' for read mode
door1 = file.readLine()
file.close()
print("The door is currently " .. door1)