password = "kitfox"

os.pullEvent = os.pullEventRaw
shell.run("/boot/doAutoRuns")

--[[ Function declarations ]]--

function login(user)
	print("Welcome, " .. user)
	runFilesInDir("/boot/autorun/")
end

--[[ Begin Codey things ]]--

shell.run("/boot/splashScreen")

term.clear()
term.setCursorPos(1,1)
print("SnoFox's Console")
print("-- Mockingjay --")
failedCounter = 0
while(true) do
  print("Password: ")
  write("")
  reader = read("*")
  if(reader == password) then
	login("SnoFox")
    break
  elseif(failedCounter >= 3) then
    sleep(5)
    print("Too many failed passwords")
    sleep(10)
    print("Shutting down...")
    os.shutdown()
  else
    failedCounter = failedCounter + 1
    sleep(5)
    print("Incorrect password")
  end
end
