Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Version = "1.0.0"
- local ComputerVersion = "1.0.0"
- local System = os -- Used for System things like os.time() to System.time()
- local Screen = term -- Used for Screen thing on the turtle or computer like term.clear() to Screen.clear()
- local Per = peripheral -- Used shortcut for peripheral
- local Text = textutils -- Used shortcut for textilils
- local Pack = Text.serialize -- Makes a new command for packing ( shortcut used from local Text)
- local UnPack = Text.unserialize -- Makes a new command for unpacking ( shortcut used from local Text)
- local OldpullEvent = System.pullEvent
- System.pullEvent = System.pullEventRaw
- local Computer = { ComputerName = "Computer",
- Status = true,
- LogOn = false
- }
- local User = { }
- local Temp = { }
- function SaveTemp()
- Computer.UserName = User.UserName
- local Data = Pack(Computer)
- File = fs.open("OS/Temp/Temp.Tem", "w")
- File.write(Data)
- File.close()
- end
- function Saving()
- local Data = Pack(User)
- local MapOne = fs.exists("OS/Users")
- if not(MapOne) then
- fs.makeDir("OS/Users")
- end
- local File = fs.exists("OS/Users/."..User.UserName..".Acc")
- if not(File) then
- File = fs.open("OS/Users/."..User.UserName..".Acc", "w")
- File.write(Data)
- File.close()
- return true
- else
- Screen.clear()
- local X, Y = Screen.getSize()
- local Y2 = Y / 2
- Screen.setCursorPos(1, Y2)
- print(User.UserName.." already exists!!!")
- sleep(3)
- return false
- end
- end
- function AanMaken()
- Screen.clear()
- local X, Y = Screen.getSize()
- local Temp = X / 2
- local X2 = Temp - 2
- Screen.setCursorPos(X2, 1)
- print("Make Account :")
- Temp = Y / 2
- local Y2 = Temp - 1
- Screen.setCursorPos(1, Y2)
- write("UserName: ")
- User.UserName = io.read()
- Screen.setCursorPos(1, Y2+1)
- write("Password: ")
- User.Pass = read("*")
- local Safed = Saving()
- if Safed then
- Computer.LogOn = true
- SaveTemp()
- elseif not(Safed) then
- User.UserName = nil
- Computer.UserName = User.UserName
- User.Pass = nil
- sleep(3)
- end
- end
- AanMaken()
Add Comment
Please, Sign In to add comment