ComputerCraft Error code help

  • Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here

mobkiller326

New Member
Sep 6, 2020
4
0
2
Error code is "bios:339: [string "test"]:23: '<eof>' expected
Code:
if pt == (p) then
    print ("Loggin In..")
    sleep(2)
    print("Login succesful!")
    sleep(1)
    print("Welcome user")
    sleep(2)
    term.clear()
    print("Starting OS")
    sleep(4)
    term.clear()
    print("  Welcome to HQ Terminal 1  ")
    print("============================")
    end
else if pt == "admin" then
    term.clear()
    write("Admin Mode")
end

Until the else/if statement the program runs fine I've moved the last end around by tabbing it over, removing it, and removing the previous end, adding a second end after the last one. I can't figure out at this point what the error is. Please help. There is a section of code in front that assigns the variables, just didn't want to write out that much code.
I've checked a lot of forums but can't find the an answer that fixes the error.
 

InochiNV

New Member
Aug 10, 2020
4
0
2
What I see is the "end" just before the else. if , else, end. No sure, but that is what I see.
 

InochiNV

New Member
Aug 10, 2020
4
0
2
Okay, I looked at it again... the "else" does not need an "if" after it. Remove the "end" before the "else" and the 'if" after the 'else"

print("======")
else pt == "admin" then

if that doesn't work

try

else
pt == "admin"
term.clear()
write("Admin Mode")
end