Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ Version 2 of ariana is not to be edited by
- anyone other then Awesomesause200 but your more
- then welcome to look at it]]--
- --Get screen size
- local w,h = term.getSize()
- --Users and Passes
- local Usernames = {"guest","name","Admin"}
- local Passwords = {"guest","name","Admin"}
- --Versions
- local Version = "Ariana v.2.1"
- --Possible sides for modems
- local sides = {"top","bottom","left","right","back","front"}
- --Access state
- local Access = false
- --Colors
- local BarColor = colors.purple
- local TextColor = colors.white
- local BGReg = colors.black
- --Programs list
- local IM = ".os/Block_talk"
- local Browser = ".os/Browser"
- local This = shell.getRunningProgram()
- --Icons list
- local IMIcon = ".os/IMIcon"
- local BrowserIcon = ".os/FileExplore"
- --Options on menu
- local Options = {"Shutdown","Restart"}
- local OptiMax = 9
- local OptiMin = 1
- --Paint function
- local function setColor(col1,col2)
- term.setBackgroundColor(col1)
- term.setTextColor(col2)
- end
- --Print functions
- local function Reset(x,y)
- term.clear()
- term.setCursorPos(x,y)
- end
- local function printCentered(str,ypos)
- term.setCursorPos(w/2-#str/2,ypos)
- term.write(str)
- end
- local function printPos(str,x,y)
- term.setCursorPos(x,y)
- term.write(str)
- end
- --Login header
- local function login()
- term.setBackgroundColor(BGReg)
- paintutils.drawLine(1,1,w,1,BarColor)
- paintutils.drawLine(1,h,w,h,BarColor)
- printCentered("Welcome to "..Version.."-",1)
- term.setBackgroundColor(BGReg)
- printCentered("Sign in as guest",h/2-1)
- printCentered("Sign in as user ",h/2+1)
- local e,m,x,y = os.pullEvent("mouse_click")
- if m == 1 and x > 16 and x < 32 and y == 8 then
- Access = true
- elseif m == 1 and x > 16 and x < 32 and y == 10 then
- term.clear()
- paintutils.drawLine(1,1,w,1,BarColor)
- paintutils.drawLine(1,h,w,h,BarColor)
- printCentered("Welcome to "..Version.."-",1)
- printCentered("Username: ",h/2)
- local User = read()
- if User == "User" then
- Access = true
- else
- Access = false
- end
- else
- shell.run(This)
- end
- end
- --Menu decrotive
- local function menuFX()
- local xFX,yFX = 1,h-1
- for i = 1,#Options do
- for j = 1,#Options[i] do
- term.setCursorPos(xFX-#Options[i]+1,yFX)
- term.write(Options[i])
- xFX = xFX + 1
- sleep(0.05)
- end
- yFX = yFX - 1
- xFX = 1
- end
- end
- --Main screen after login
- local function mainScreen()
- term.clear()
- paintutils.drawLine(1,1,w,1,BarColor)
- term.setTextColor(TextColor)
- term.setBackgroundColor(BGReg)
- paintutils.drawLine(1,h,w,h,BarColor)
- printCentered("-Welcome to "..Version.."-",1)
- printPos("-Menu-",1,h)
- paintutils.drawImage(paintutils.loadImage(BrowserIcon),3,3)
- paintutils.drawImage(paintutils.loadImage(IMIcon),14,3)
- local e,m,x,y = os.pullEvent("mouse_click")
- if m == 1 and x > 3 and x < 10 and y > 3 and y < 10 then
- term.setBackgroundColor(BGReg)
- shell.run(Browser)
- term.clear()
- mainScreen()
- elseif m == 1 and x > 14 and x < 21 and y > 3 and y < 10 then
- term.setBackgroundColor(BGReg)
- shell.run(IM)
- term.clear()
- mainScreen()
- elseif m == 1 and x > 1 and x < 6 and y == h then
- term.setBackgroundColor(BGReg)
- menuFX()
- local e,m,x,y = os.pullEvent("mouse_click")
- if m == 1 and x > OptiMin and x < OptiMax and y == h-1 then
- os.shutdown()
- elseif m == 1 and x > OptiMin and x < OptiMax and y == h-2 then
- os.reboot()
- else
- term.clear()
- mainScreen()
- end
- else
- term.setBackgroundColor(BGReg)
- term.clear()
- mainScreen()
- end
- end
- Reset(1,1)
- login()
- if Access == true then
- term.setBackgroundColor(BGReg)
- Reset(1,1)
- term.setBackgroundColor(BGReg)
- mainScreen()
- end
Advertisement
Add Comment
Please, Sign In to add comment