Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user = user
- load1 = "[ ]"
- load2 = "[00 ]"
- load3 = "[0000 ]"
- load4 = "[000000]"
- os.pullEvent = os.pullEventRaw
- PVar={_PVarPath="/files/"}
- setmetatable(PVar,PVar)
- PVar._getVariablePath=function(name)
- local filepath = fs.combine(PVar["_PVarPath"],name..".var")
- if not fs.exists(PVar["_PVarPath"]) then
- fs.makeDir(PVar["_PVarPath"])
- end
- return filepath
- end
- function PVar._assertOnInvalidName(name)
- if name:sub(1,1)=="_" then
- error("Variable names cannot start with _")
- else
- local invalidCharPos,_ = name:find("[:/\*|<>;%s]")
- if invalidCharPos then
- error("Variable names contains invalid character '"..name:sub(invalidCharPos,invalidCharPos).."'")
- end
- end
- end
- function PVar.__index(tbl,name)
- PVar._assertOnInvalidName(name)
- local f = io.open(PVar._getVariablePath(name), "r")
- if f then
- local content = textutils.unserialize(f:read())
- f:close()
- return content
- else
- return nil
- end
- end
- function PVar.__newindex(tbl,name,value)
- PVar._assertOnInvalidName(name)
- if value then
- local f = io.open(PVar._getVariablePath(name), "w")
- assert(f,"FAIL: could not open file")
- if f then
- f:write(textutils.serialize(value))
- f:close()
- end
- else
- fs.delete(PVar._getVariablePath(name))
- end
- end
- os.pullEvent = os.pullEventRaw
- function printFrameLogin()
- term.setCursorPos(1,1)
- shell.run("clear")
- print("| ___ __ __ / \\_____________________|")
- print("| /___ / | /__ / |")
- print("| /____ /___| ____| / |")
- print("|__________________/ |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- sleep(0.1)
- print("| ___ __ __ / | |")
- print("| /___ / | /__ / \\_____________________|")
- print("| /____ /___| ____| / |")
- print("|__________________/ |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- sleep(0.1)
- print("| ___ __ __ / | |")
- print("| /___ / | /__ / | |")
- print("| /____ /___| ____| / \\_____________________|")
- print("|__________________/ |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- sleep(0.1)
- print("| ___ __ __ / | |")
- print("| /___ / | /__ / | |")
- print("| /____ /___| ____| / | |")
- print("|__________________/ \\_____________________|")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- sleep(0.1)
- end
- function printFrameLogin2()
- term.setCursorPos(1,1)
- shell.run("clear")
- print("| ___ __ __ / | |")
- print("| /___ / | /__ / | |")
- print("| /____ /___| ____| / | |")
- print("|__________________/ \\_____________________|")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- sleep(0.1)
- print("| ___ __ __ / | |")
- print("| /___ / | /__ / | |")
- print("| /____ /___| ____| / \\_____________________|")
- print("|__________________/ |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- sleep(0.1)
- print("| ___ __ __ / | |")
- print("| /___ / | /__ / \\_____________________|")
- print("| /____ /___| ____| / |")
- print("|__________________/ |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- sleep(0.1)
- print("| ___ __ __ / \\_____________________|")
- print("| /___ / | /__ / |")
- print("| /____ /___| ____| / |")
- print("|__________________/ |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- sleep(0.1)
- end
- term.clear()
- term.setCursorPos(1,1)
- printFrameLogin()
- term.setCursorPos(27,2)
- Ehwhatpass = PVar.pass
- sleep(0.3)
- write("Username: ")
- user = read()
- term.setCursorPos(49,2)
- write("|")
- if user == PVar.user then
- term.setCursorPos(27,3)
- write("Password: ")
- p1 = read("*")
- term.setCursorPos(49,3)
- write("|")
- if p1 == Ehwhatpass then
- printFrameLogin2()
- shell.run("gui1")
- else
- term.setCursorPos(27,4)
- print("Password Incorrect!")
- sleep(2)
- printFrameLogin2()
- shell.run("startup")
- end
- else
- term.setCursorPos(27,4)
- print("Username Incorrect!")
- sleep(2)
- printFrameLogin2()
- shell.run("startup")
- end
Add Comment
Please, Sign In to add comment