Posted 25 December 2014 - 05:13 AM
So while trying to make a mini-os for my news station, I have come across a slight issue. When logging in, even if you get the correct password it still claims incorrect. It doesn't seem like I made any errors…. Any thoughts? Here's the snippit part with the login
my full code is here http://pastebin.com/MZZfrW14
term.clear()
term.setCursorPos(1,1)
cPrint("Hello, welcome to NYT head computer.")
while true do
cPrint("Enter editor name")
EN = read()
if fs.exists("Editors/" ..EN) == true then
file = fs.open("Editors/" ..EN, "r")
local fileData = {}
local line = file.readLine()
repeat
table.insert(fileData,line)
line = file.readLine()
until line == nil
file.close()
local PassFile = fileData[1]
break
else
cPrint("No Editor Found... Create One?")
sleep(1)
yyN()
end
end
local PW = false
repeat
cPrint("Please insert Password")
local pss = read()
if pss == PassFile or PW then
cPrint("Welcome!")
break
else
cPrint("Wrong Pass..")
end
until pss == PassFile
my full code is here http://pastebin.com/MZZfrW14