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="/vvSystem/"}
- 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("|---00000 000 0000 -| |--|")
- print("|---00 00 00 00 -| |--|")
- print("|---0000 00 00 0000 -| |--|")
- print("|---00 00 00 00-| |--|")
- print("|---00000 000 0000 -| |--|")
- print("+-----------------------------------------------+")
- end
- term.clear()
- term.setCursorPos(1,1)
- printFrameLogin()
- term.setCursorPos(26,2)
- Ehwhatpass = PVar.pass
- sleep(1)
- write("Username: ")
- user = read()
- term.setCursorPos(46,2)
- write("|--|")
- if user == PVar.user then
- term.setCursorPos(26,3)
- write("Password: ")
- p1 = read("*")
- term.setCursorPos(46,2)
- write("|--|")
- if p1 == Ehwhatpass then
- term.clear()
- term.setCursorPos(1,1)
- printFrameLogin()
- term.setCursorPos(26,3)
- write("Loading "..load1.."")
- sleep(1)
- term.clear()
- term.setCursorPos(1,1)
- printFrameLogin()
- term.setCursorPos(26,3)
- write("Loading "..load2.."")
- sleep(1)
- term.clear()
- term.setCursorPos(1,1)
- printFrameLogin()
- term.setCursorPos(26,3)
- write("Loading "..load3.."")
- sleep(1)
- term.clear()
- term.setCursorPos(1,1)
- printFrameLogin()
- term.setCursorPos(26,3)
- write("Loading "..load4.."")
- sleep(1)
- shell.run("gui1")
- else
- term.setCursorPos(26,4)
- print("Password Incorrect!")
- sleep(2)
- os.shutdown()
- end
- else
- term.setCursorPos(26,3)
- print("Username Incorrect!")
- sleep(2)
- os.shutdown()
- end
Add Comment
Please, Sign In to add comment