Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Welcome to the Mainframe edit
- --This program was written by me, Barlender
- --Functions
- function boot()
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.blue)
- term.clear()
- term.setCursorPos(1,1)
- print("Welcome to the Barlender OS 1.0!")
- print("Starting Up")
- term.setCursorPos(12,2)
- textutils.slowPrint(".....................")
- term.setTextColor(colors.green)
- term.setCursorPos(1,5)
- print("001010101010010010010101111110000010100001110101110")
- sleep(.1)
- print("111010000110101110101011001010111010100011010101011")
- sleep(.1)
- print("010110011010110101001100101101000111011010101000100")
- sleep(.1)
- print("100010101101101101010010110101100011010101110010111")
- sleep(.1)
- print("101010101101000110111011101000101101010001110001100")
- sleep(.1)
- print("101010010101010101000100101010011101111101010101010")
- sleep(.1)
- print("001010101010110010101101110101001010100101001101110")
- sleep(.1)
- print("100001111101010100101110101101001101011010101110010")
- sleep(.1)
- print("001010101011010111101010101101010101110100110110101")
- sleep(.1)
- print("100101000101110110010101111000101000101001110101011")
- sleep(.1)
- print("010101101101101010011101010010010010000101101000111")
- sleep(.1)
- print("010101011011101000011100000101010111100100110100111")
- sleep(.1)
- print("001110110111010101000101011010111010101011100101001")
- sleep(.1)
- print("011101111010111110111101010011110101010101000111010")
- sleep(1)
- end
- function QR()
- term.setCursorPos(4,16)
- term.setBackgroundColor(colors.red)
- term.setTextColor(colors.black)
- print("Q")
- term.setCursorPos(6,16)
- term.setBackgroundColor(colors.orange)
- print("R")
- term.setBackgroundColor(colors.blue)
- term.setTextColor(colors.white)
- end
- function shutdown()
- term.setBackgroundColor(colors.lightGray)
- term.clear()
- sleep(.2)
- term.setBackgroundColor(colors.gray)
- term.clear()
- sleep(.2)
- os.shutdown()
- end
- function reboot()
- term.setBackgroundColor(colors.lightGray)
- term.clear()
- sleep(.2)
- term.setBackgroundColor(colors.gray)
- term.clear()
- sleep(.2)
- os.reboot()
- end
- function screenPrep()
- term.setBackgroundColor(colors.blue)
- term.clear()
- local borderTop = paintutils.loadImage(".borderTop")
- paintutils.drawImage(borderTop,1,1)
- local borderBottom = paintutils.loadImage(".borderBottom")
- paintutils.drawImage(borderBottom,1,2)
- local borderRight = paintutils.loadImage(".borderRight")
- paintutils.drawImage(borderRight,3,1)
- local borderRight2 = paintutils.loadImage(".borderRight2")
- paintutils.drawImage(borderRight2,3,2)
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.blue)
- end
- function passwordScreen()
- screenPrep()
- term.setCursorPos(20,4)
- term.setBackgroundColor(colors.blue)
- print("Select User:")
- QR()
- local user1 = paintutils.loadImage(".user1")
- paintutils.drawImage(user1,9,6)
- local user2 = paintutils.loadImage(".user2")
- paintutils.drawImage(user2,21,6)
- local user3 = paintutils.loadImage(".user3")
- paintutils.drawImage(user3,33,6)
- end
- function userCheck(userslot)
- if not fs.exists("users/"..userslot) then
- userCreator(userslot)
- elseif fs.exists("users/"..userstot) then
- term.setCursorPos(19,4)
- print("Enter Password:")
- end
- end
- function userCreator(userslot)
- screenPrep()
- term.setCursorPos(3,3)
- textutils.slowPrint("You are creating a user under the save")
- term.setCursorPos(42,3)
- term.setTextColor(colors.yellow)
- textutils.slowPrint("user "..userslot)
- sleep(1)
- term.setTextColor(colors.white)
- term.setCursorPos(3,4)
- textutils.slowPrint("What would you like your username to be?")
- QR()
- term.setBackgroundColor(colors.blue)
- term.setCursorPos(3,5)
- local function type()
- username = read()
- local file = fs.open(".users/"..userslot,"w")
- file.writeLine(username)
- file.close()
- end
- local function click()
- event,side,x,y = os.pullEvent("mouse_click")
- while true do
- if x == 4 and y == 16 then
- shutdown()
- break
- elseif x == 6 and y ==16 then
- reboot()
- break
- end
- end
- end
- parallel.waitForAny(type,click)
- screenPrep()
- QR()
- term.setCursorPos(3,3)
- textutils.slowPrint("Ok then, "..username..". Would you like to")
- term.setCursorPos(3,4)
- textutils.slowPrint("change your profile picture?")
- term.setCursorPos(3,5)
- term.setBackgroundColor(colors.green)
- print("Yes")
- term.setCursorPos(7,5)
- term.setBackgroundColor(colors.red)
- print("No")
- event,side,x,y = os.pullEvent("mouse_click")
- while true do
- if x >= 3 and x <= 5 and y == 5 then
- screenPrep()
- term.setCursorPos(3,3)
- term.setTextColor(colors.orange)
- textutils.slowPrint("Please only paint within the blue box")
- sleep(1.5)
- shell.run("paint .user"..userslot)
- userCreator2()
- elseif x >= 7 and x <= 8 and y == 5 then
- userCreator2()
- elseif x == 4 and y == 16 then
- shutdown()
- elseif x == 6 and y == 16 then
- reboot()
- end
- end
- end
- function userCreator2()
- screenPrep()
- QR()
- term.setCursorPos(3,3)
- textutils.slowPrint("Would you like to set a password?")
- term.setCursorPos(3,4)
- term.setBackgroundColor(colors.green)
- print("Yes")
- term.setCursorPos(7,4)
- term.setBackgroundColor(colors.red)
- print("No")
- event,side,x,y = os.pullEvent("mouse_click")
- if x >= 3 and x <= 5 and y == 4 then
- local function passwordMaker()
- term.setCursorPos(3,3)
- term.setBackgroundColor(colors.blue)
- textutils.slowPrint("What would you like your password to be?")
- term.setCursorPos(3,4)
- local password = read()
- screenPrep()
- QR()
- term.setCursorPos(3,3)
- textutils.slowPrint("Please re-enter your password")
- term.setCursorPos(3,4)
- local passwordCheck = read()
- if password == passwordCheck then
- screenPrep()
- QR()
- term.setCursorPos(3,3)
- textutils.slowPrint("Correct")
- sleep(1)
- reboot()
- else
- screenPrep()
- term.setCursorPos(3,3)
- textutils.slowPrint("Password doesn't match")
- sleep(1)
- passwordMaker()
- end
- end
- passwordMaker()
- elseif x >= 7 and x <= 8 and y == 4 then
- elseif x == 4 and y == 16 then
- shutdown()
- elseif x == 6 and y == 16 then
- reboot()
- end
- end
- function barlenderScreen()
- term.clear()
- screenPrep()
- local user1 = paintutils.loadImage(".user1")
- paintutils.drawImage(user1,21,6)
- term.setCursorPos(19,4)
- term.setBackgroundColor(colors.blue)
- print("Enter Password:")
- term.setCursorPos(22,14)
- term.setBackgroundColor(colors.blue)
- term.setTextColor(colors.white)
- guess = read("*")
- if "sumc" == guess then
- term.setBackgroundColor(colors.white)
- term.clear()
- local check = paintutils.loadImage(".check")
- paintutils.drawImage(check,1,4)
- sleep(1)
- term.setBackgroundColor(colors.lightGray)
- term.clear()
- sleep(.1)
- term.setBackgroundColor(colors.gray)
- term.clear()
- sleep(.1)
- term.setBackgroundColor(colors.lightGray)
- term.clear()
- sleep(.1)
- menuSkin()
- menu1()
- options1()
- else
- passwordScreen()
- password()
- term.setCursorPos(11,15)
- term.setTextColor(colors.red)
- print("Nope.")
- end
- end
- function password()
- event,side,x,y = os.pullEvent("mouse_click")
- if x >= 10 and x <= 17 and y >= 7 and y <= 12 then
- userCheck("1")
- elseif x >= 22 and x <= 29 and y >= 7 and y <= 12 then
- userCheck("2")
- elseif x >= 34 and x <= 41 and y >= 7 and y <= 12 then
- userCheck("3")
- elseif x == 4 and y == 16 then
- shutdown()
- elseif x == 6 and y == 16 then
- reboot()
- else
- passwordScreen()
- password()
- end
- end
- function menuSkin()
- term.setBackgroundColor(colors.blue)
- term.clear()
- local menu1 = paintutils.loadImage(".menu1")
- paintutils.drawImage(menu1,1,1)
- local menu2 = paintutils.loadImage(".menu2")
- paintutils.drawImage(menu2,3,1)
- local menu3 = paintutils.loadImage(".menu3")
- paintutils.drawImage(menu3,1,2)
- local menu4 = paintutils.loadImage(".menu4")
- paintutils.drawImage(menu4,3,2)
- local sumc = paintutils.loadImage(".sumc")
- paintutils.drawImage(sumc,32,8)
- QR()
- end
- function menu1()
- term.setCursorPos(3,7)
- term.setBackgroundColor(colors.blue)
- term.setTextColor(colors.white)
- print("Function Menu")
- term.setCursorPos(3,8)
- term.setTextColor(colors.orange)
- print("Program Edit Menu")
- term.setCursorPos(3,9)
- term.setTextColor(colors.purple)
- print("Enter Console")
- term.setCursorPos(3,10)
- term.setTextColor(colors.brown)
- print("Reboot Mainframe")
- term.setCursorPos(3,11)
- term.setTextColor(colors.black)
- print("Shut Down Mainframe")
- term.setTextColor(colors.white)
- term.setCursorPos(34,4)
- print("The Mainframe")
- end
- function options1()
- event,side,x,y = os.pullEvent("mouse_click")
- if x > 3 and x < 30 and y == 7 then
- menuSkin()
- menu2()
- options2()
- elseif x > 3 and x < 30 and y == 8 then
- menuSkin()
- menu3()
- options3()
- elseif x > 3 and x < 30 and y == 9 then
- term.setCursorPos(1,1)
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.yellow)
- term.clear()
- print("CraftOS 1.7")
- term.setCursorPos(1,2)
- elseif x == 4 and y == 16 then
- shutdown()
- elseif x == 6 and y == 16 then
- reboot()
- else
- menuSkin()
- menu1()
- options1()
- end
- end
- function menu2()
- term.setCursorPos(3,4)
- term.setBackgroundColor(colors.blue)
- term.setTextColor(colors.white)
- print("Launch Todo")
- term.setCursorPos(3,5)
- print("Open Hidden Door (5 Sec.)")
- term.setCursorPos(3,6)
- print(" ")
- term.setCursorPos(3,7)
- print(" ")
- term.setCursorPos(3,8)
- print(" ")
- term.setCursorPos(3,9)
- print(" ")
- term.setCursorPos(3,10)
- print(" ")
- term.setCursorPos(3,11)
- print(" ")
- term.setCursorPos(3,12)
- print(" ")
- term.setCursorPos(3,13)
- print(" ")
- term.setCursorPos(3,14)
- print(" ")
- term.setCursorPos(3,15)
- print(" ")
- term.setCursorPos(3,16)
- print("13= Return to main menu")
- term.setCursorPos(34,4)
- print("Function Menu")
- end
- function options2()
- event,side,x,y = os.pullEvent("mouse_click")
- if x > 3 and x < 30 and y == 4 then
- term.clear()
- menuSkin()
- menu2()
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.orange)
- term.setCursorPos(6,17)
- shell.run("monitor top todo")
- term.setTextColor(colors.green)
- term.setCursorPos(45,4)
- options2()
- elseif x > 3 and x < 30 and y == 5 then
- term.clear()
- menuSkin()
- menu2()
- term.setCursorPos(4,17)
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.orange)
- term.setCursorPos(6,17)
- print("OPENING THE DOOOOOOR!")
- rs.setOutput("back", true)
- sleep(5)
- term.setCursorPos(7,17)
- term.clearLine()
- rs.setOutput("back", false)
- menuSkin()
- menu2()
- options2()
- elseif x > 3 and x < 30 and y == 16 then
- menuSkin()
- menu1()
- options1()
- elseif x == 4 and y == 16 then
- shutdown()
- elseif x == 6 and y == 16 then
- reboot()
- else
- menuSkin()
- menu2()
- options2()
- end
- end
- function menu3()
- term.setBackgroundColor(colors.blue)
- term.setTextColor(colors.white)
- term.setCursorPos(3,4)
- print("Edit Todo")
- term.setCursorPos(3,5)
- print("Edit Startup (Mainframe)")
- term.setCursorPos(3,6)
- print(" ")
- term.setCursorPos(3,7)
- print(" ")
- term.setCursorPos(3,8)
- print(" ")
- term.setCursorPos(3,9)
- print(" ")
- term.setCursorPos(3,10)
- print(" ")
- term.setCursorPos(3,11)
- print(" ")
- term.setCursorPos(3,12)
- print(" ")
- term.setCursorPos(3,13)
- print(" ")
- term.setCursorPos(3,14)
- print(" ")
- term.setCursorPos(3,15)
- print(" ")
- term.setCursorPos(3,16)
- print("13= Return to main menu")
- term.setCursorPos(34,4)
- print("Editing Menu")
- end
- function options3()
- event,side,x,y = os.pullEvent("mouse_click")
- if x > 3 and x < 30 and y == 4 then
- edit()
- shell.run("edit todo")
- elseif x > 3 and x < 30 and y == 5 then
- edit()
- shell.run("edit startup")
- elseif x > 3 and x < 30 and y == 16 then
- menuSkin()
- menu1()
- options1()
- elseif x == 4 and y == 16 then
- shutdown()
- elseif x == 6 and y == 16 then
- reboot()
- else
- menuSkin()
- menu3()
- options3()
- end
- end
- function edit()
- term.clear()
- term.setCursorPos(1,1)
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- end
- --This Part makes sure that all of the necessary
- --files were installed properly, and that the
- --proper directories were created
- function downloads()
- if not fs.isDir(".users") then
- fs.makeDir(".users")
- end
- if not fs.exists(".borderTop") then
- term.setCursorPos(1,1)
- shell.run("pastebin get", "ufqw3Cay", ".borderTop")
- term.clear()
- end
- if not fs.exists(".borderBotton") then
- term.setCursorPos(1,1)
- shell.run("pastebin get", "Ze8fQAuq", ".borderBottom")
- term.clear()
- end
- if not fs.exists(".borderRight") then
- term.setCursorPos(1,1)
- shell.run("pastebin get", "eitEekZK", ".borderRight")
- end
- if not fs.exists(".borderRight2") then
- term.setCursorPos(1,1)
- shell.run("pastebin get", "NCf53j8k", ".borderRight2")
- end
- if not fs.exists(".check") then
- term.setCursorPos(1,1)
- shell.run("pastebin get", "bYbPeB3V", ".check")
- term.clear()
- end
- if not fs.exists(".user1") then
- term.setCursorPos(1,1)
- shell.run("pastebin get", "UmxbJuEx", ".user1")
- term.clear()
- end
- if not fs.exists(".user2") then
- term.setCursorPos(1,1)
- shell.run("cp ", ".user1 ", ".user2")
- term.clear()
- end
- if not fs.exists(".user3") then
- term.setCursorPos(1,1)
- shell.run("cp ", ".user2 ", ".user3")
- term.clear()
- end
- end
- --Actual program begins here
- downloads()
- boot()
- passwordScreen()
- password()
Add Comment
Please, Sign In to add comment