Well, the function is in a api, anyway, heres the full code, and I have modified it a bit, but still the same problem, and it says its the line with shell.run("cd", "/home..etc…"):
And EveryOS, then how do you recommend doing it?
Function/API File:
local w,h = term.getSize()
function printCentered (y,s)
local x = math.floor((w - string.len(s)) / 2)
term.setCursorPos(x,y)
term.clearLine()
print(s)
end
local file = fs.open("/system/settings/users/water-usersettings", "r")
local settings = textutils.unserialize(file.readAll())
file.close()
function CheckPassword()
term.clear()
printCentered(math.floor(h/2) -4, " ___________________ ")
printCentered(math.floor(h/2) -3, "| Login Screen |")
printCentered(math.floor(h/2) -2, "|___________________|")
printCentered(math.floor(h/2) -1, "")
write("User: "..settings[1])
printCentered(math.floor(h/2) +1, "")
write("Pass: ")
local input2 = read()
if input2 == settings[2] then
term.clear()
sleep(1)
printCentered(math.floor(h/2) +0, "Password Accepted.")
printCentered(math.floor(h/2) +1, "Welcome back Water.")
sleep(1)
term.clear()
shell.run("cd", "/home/"..settings[1].."/desktop/")
shell.run("menu")
end
end
The 'login' file:
local w,h = term.getSize()
function printCentered (y,s)
local x = math.floor((w - string.len(s)) / 2)
term.setCursorPos(x,y)
term.clearLine()
print(s)
end
shell.run("cd", "/")
os.loadAPI("/system/software/utils/mainutils")
term.clear()
printCentered(math.floor(h/2) +0, "Loading Login Screen...")
sleep(2)
printCentered(math.floor(h/2) -4, " ___________________ ")
printCentered(math.floor(h/2) -3, "| Login Screen |")
printCentered(math.floor(h/2) -2, "|___________________|")
printCentered(math.floor(h/2) +0, "")
write("User: ")
inputlogin = read()
local file = fs.open("/home/userlist", "r")
local users = textutils.unserialize(file.readAll())
file.close()
for i=1,#users do
if users[i] == inputlogin then
os.loadAPI("/home/"..users[i].."/userutils")
userutils.CheckPassword()
else
term.clear()
sleep(1)
printCentered(math.floor(h/2) +0, "Username "..inputlogin.." was not found!")
sleep(1)
shell.run("/system/software/user/login")
end
end