Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Information about the OS is stored here--
- version = 0.8
- --Variables
- w, h = term.getSize()
- ---Colors
- blue = colors.blue
- black = colors.black
- white = colors.white
- red = colors.red
- yellow = colors.yellow
- lightBlue = colors.lightBlue
- lightGray = colors.lightGray
- green = colors.green
- lime = colors.lime
- pink = colors.pink
- purple = colors.purple
- magenta = colors.magenta
- gray = colors.gray
- brow = colors.brown
- cyan = colors.cyan
- orange = colors.orange
- --Functions
- function clear()
- term.clear()
- end
- function setBackgroundColor(...)
- term.setBackgroundColor(...)
- term.clear()
- end
- function clearLine(y, c)
- term.setCursorPos(1,y)
- term.setBackgroundColor(c)
- term.clearLine()
- end
- function setTextcolor(...)
- term.setTextColor(...)
- end
- function printCenter(y, s)
- local x = math.floor((w - string.len(s))/2)
- term.setCursorPos(x,y)
- write(s)
- end
- function slowPrint(...)
- textutils.slowPrint(...)
- end
- function slowWrite(...)
- textutils.slowWrite(...)
- end
- function setCursorPos(x, y)
- term.setCursorPos(x,y)
- end
- function background(...)
- term.setBackgroundColor(...)
- end
- function drawImage(x,y,s)
- paintutils.drawImage(paintutils.loadImage(s),x,y)
- end
- oldPull = os.pullEvent;
- os.pullEvent = os.pullEventRaw;
- setBackgroundColor(white)
- setCursorPos(1,1)
- setTextcolor(lightBlue)
- print("ACEOS X "..version)
- if fs.exists("privacy/password") and fs.exists("privacy/username") then
- local fl = fs.open("privacy/username","r")
- username = fl.readLine()
- fl.close()
- setTextcolor(blue)
- printCenter(7,username)
- setCursorPos(21,9)
- m = fs.open("/privacy/password","r")
- pass = tostring(m.readLine())
- m.close()
- a = read("*")
- if a == pass then
- setTextcolor(colors.lime)
- printCenter(10,"Acces Granted")
- sleep(0.3)
- shell.run("/swfiles/ACEOS.lua")
- else
- setTextcolor(red)
- printCenter(10,"Acces Denied")
- sleep(0.5)
- shell.run("swfiles/login.lua")
- end
- elseif not fs.exists("/privacy/password") and not fs.exists("/privacy/username") then
- setBackgroundColor(black)
- setTextcolor(yellow)
- setCursorPos(1,1)
- print("Username: ")
- print("Password: ")
- setCursorPos(1,4)
- setTextcolor(lightBlue)
- print("No more than eight characters in the password")
- setTextcolor(white)
- setCursorPos(11,1)
- u = read()
- setCursorPos(11,2)
- p = tostring(read())
- if string.len(p) >= 9 then
- shell.run("swfiles/login.lua")
- else
- fs.copy("/privacy/file","/privacy/username")
- fs.copy("/privacy/file","/privacy/password")
- local c = fs.open("/privacy/username","w")
- c.writeLine(u)
- c.close()
- local h = fs.open("/privacy/password","w")
- h.writeLine(p)
- h.close()
- shell.run("/swfiles/login.lua")
- end
- end
- os.pullEvent = oldPull;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement