Posted 18 September 2012 - 10:10 PM
So i am using file:write to record the user, pass and admin status of my program. It only writes them on the first line of the program. I want the name on the first line, pass on the second and admin status on the third line. Is there anyway to do this?
Heres some of my code-
Heres some of my code-
-- Part of detecting drive side
local driveSide
for _, side in ipairs(rs.getSides()) do
if peripheral.isPresent(side) and peripheral.getType(side) == "drive" then
driveSide = side
break
end
end
if driveSide then
local file = io.open("/disk/Users", "w")
print(file)
file:write(""..name.."") -- Trying to make them write on different lines. Only writes like "name""pass""admin"
file:write(""..pass.."")
file:write(""..admin.."")
file:close()
disk.eject(driveSide)
else
term.setCursorPos(1,10) -- Just fixing the GUI here
term.clearLine()
term.setCursorPos(1,10) -- And here
write("#")
term.setCursorPos(50,10) -- And here
write("#")
term.setCursorPos(12,14)
error("No disk drive found.")
end