Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Notes--
- --Right Mouse Click is
- --1
- --13
- --7
- --The enter key is
- --28
- --The arrow keys are
- --up;200
- --down;208
- --left;203
- --right;205
- --Variables--
- local sid = 1
- slc = 0
- w,h = term.getSize()
- --Functions--
- function menu(id, text)
- if sid == id then
- write("[".."]")
- else
- write(" ")
- end
- print(text)
- end
- function adminFiles()
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("+-----+------------------------+")
- print(":Files: :")
- print("+-----+ :")
- print(": :")
- print(": :")
- print(": :")
- print("+------------------------------+")
- term.setCursorPos(9,2)
- menu(1, "..")
- term.setCursorPos(9,3)
- menu(2, "Worm")
- term.setCursorPos(9,4)
- menu(3, "CraftOS_Prompt")
- term.setCursorPos(9,5)
- menu(4, "Shutdown")
- term.setCursorPos(9,6)
- menu(5, "Reboot")
- term.setCursorPos(24,2)
- menu(6, "Info")
- term.setCursorPos(24,3)
- menu(7, "Adventure")
- event, key = os.pullEvent("key")
- if key == 200 then
- if sid > 1 then
- sid = sid - 1
- end
- elseif key == 208 then
- if sid < 6 then
- sid = sid + 1
- end
- elseif key == 28 then
- if sid == 1 then
- adminDesktop()
- elseif sid == 2 then
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- shell.run("worm")
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- elseif sid == 3 then
- term.clear()
- term.setCursorPos(1,1)
- shell.run("shell")
- elseif sid == 4 then
- os.shutdown()
- elseif sid == 5 then
- os.reboot()
- elseif sid == 6 then
- adminInfoMenu()
- elseif sid == 7 then
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- shell.run("adventure")
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- end
- end
- end
- end
- function cls()
- shell.run('clear')
- end
- function bootUp()
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.clear()
- term.setCursorPos(1,1)
- print("+---------------+---------------------+")
- print(":PixeltonOS v0.2: :")
- print("+---------------+ :")
- print(": :")
- print(": PixeltonOS :")
- print(": ________________ :")
- print(": / \\ :")
- print(": \\________________/ :")
- print(": :")
- print(": Loading... :")
- print(": :")
- print("+-------------------------------------+")
- sleep(1)
- term.setCursorPos(13,7)
- print("::")
- sleep(1)
- term.setCursorPos(15,7)
- print(":::")
- sleep(1)
- term.setCursorPos(18,7)
- print("::::")
- sleep(1)
- term.setCursorPos(22,7)
- print(":::::")
- sleep(1)
- term.setCursorPos(27,7)
- print("::")
- cls()
- term.setCursorPos(1,1)
- print("+---------------+---------------------+")
- print(":PixeltonOS v0.2: :")
- print("+---------------+ :")
- print(": :")
- print(": :")
- print(": Done. :")
- print(": ___ :")
- print(": /\\__\\ :")
- print(": \\/__/ :")
- print(": :")
- print("+-------------------------------------+")
- sleep(2)
- userSelect()
- end
- function userSelect()
- while true do
- cls()
- term.setCursorPos(1,1)
- print("+---------------+-------------+")
- print(":PixeltonOS v0.2: :")
- print("+---------------+ :")
- print(": :")
- print(": Please Select :")
- print(": Your User. :")
- print(": :")
- print(": :")
- print(": :")
- print(": :")
- print(": :")
- print("+-----------------------------+")
- term.setCursorPos(11,9)
- menu(1, "Admin")
- term.setCursorPos(11,10)
- menu(2, "Guest")
- event, key = os.pullEvent("key")
- if key == 200 then
- if sid > 1 then
- sid = sid - 1
- end
- elseif key == 208 then
- if sid < 2 then
- sid = sid + 1
- end
- elseif key == 28 then
- if sid == 1 then
- adminDesktop()
- elseif sid == 2 then
- guestDesktop()
- end
- end
- end
- end
- function guestDesktop()
- while true do
- cls()
- term.setCursorPos(1,1)
- print("++---------------+--------------------------------+")
- print("::Guest's Desktop:================================:")
- print("++---------------+-------------------------------++")
- print(":: _______ ::")
- print(":: : \\ ::")
- print(":: : : ::")
- print(":: : /-\\ : ::")
- print(":: : \\-/ : ::")
- print(":: :______: ::")
- print(":: ::")
- print(":: ____________ ::")
- print(":: : \\ ::")
- print(":: : : ::")
- print(":: :___________: ::")
- print(":: ::")
- print("++--------+--------------------------------------++")
- print(":: :=======================================:")
- print("++--------+---------------------------------------+")
- term.setCursorPos(3,17)
- menu(1, "System")
- term.setCursorPos(5,6)
- menu(2, "Worm")
- term.setCursorPos(5,13)
- menu(3, "Adventure")
- event, key = os.pullEvent("key")
- if key == 200 then
- if sid > 1 then
- sid = sid - 1
- end
- elseif key == 208 then
- if sid < 3 then
- sid = sid + 1
- end
- elseif key == 28 then
- if sid == 1 then
- systemMenu()
- elseif sid == 2 then
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- shell.run("worm")
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- elseif sid == 3 then
- term.clear()
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- shell.run("adventure")
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- end
- end
- end
- end
- function systemMenu()
- while true do
- term.setCursorPos(1,13)
- print("+---------+")
- print(": :")
- print(": :")
- print(": :")
- print(": :")
- print("+---------+")
- term.setCursorPos(2,14)
- menu(1, "Info")
- term.setCursorPos(2,15)
- menu(2, "Shutdown")
- term.setCursorPos(2,16)
- menu(3, "Reboot")
- term.setCursorPos(2,17)
- menu(4, "Exit")
- event, key = os.pullEvent("key")
- if key == 200 then
- if sid > 1 then
- sid = sid - 1
- end
- elseif key == 208 then
- if sid < 4 then
- sid = sid + 1
- end
- elseif key == 28 then
- if sid == 1 then
- infoMenu()
- elseif sid == 2 then
- os.shutdown()
- elseif sid == 3 then
- os.reboot()
- elseif sid == 4 then
- guestDesktop()
- end
- end
- end
- end
- function adminSystemMenu()
- while true do
- term.setCursorPos(2,12)
- print("+---------+")
- print(": :")
- print(": :")
- print(": :")
- print(": :")
- print(": :")
- print("+---------+")
- term.setCursorPos(2,13)
- menu(1, "Info")
- term.setCursorPos(2,14)
- menu(2, "MOS")
- term.setCursorPos(2,15)
- menu(3, "Shutdown")
- term.setCursorPos(2,16)
- menu(4, "Reboot")
- term.setCursorPos(2,17)
- menu(5, "Exit")
- event, key = os.pullEvent("key")
- if key == 200 then
- if sid > 1 then
- sid = sid - 1
- end
- elseif key == 208 then
- if sid < 5 then
- sid = sid + 1
- end
- elseif key == 28 then
- if sid == 1 then
- adminInfoMenu()
- elseif sid == 2 then
- cls()
- MOS()
- elseif sid == 3 then
- os.shutdown()
- elseif sid == 4 then
- os.reboot()
- elseif sid == 5 then
- adminDesktop()
- end
- end
- end
- end
- function adminInfoMenu()
- while true do
- term.setCursorPos(1,1)
- print("+----+------------+")
- print(":Info: :")
- print("+----+ :")
- print(": : :")
- print(": : :")
- print(": : :")
- print(": : :")
- print(": : :")
- print("+----+------------+")
- term.setCursorPos(8,2)
- menu(1, "Version")
- term.setCursorPos(8,4)
- menu(2, "Alpha")
- term.setCursorPos(8,6)
- menu(3, "OS Info")
- term.setCursorPos(8,8)
- menu(4, "Exit")
- event, key = os.pullEvent("key")
- if key == 200 then
- if sid > 1 then
- sid = sid - 1
- end
- elseif key == 208 then
- if sid < 4 then
- sid = sid + 1
- end
- elseif key == 28 then
- if sid == 1 then
- adminVersionPage()
- elseif sid == 2 then
- adminAlphaPage()
- elseif sid == 3 then
- adminInfoPage()
- elseif sid == 4 then
- adminDesktop()
- end
- end
- end
- end
- function adminInfoPage()
- term.setCursorPos(1,1)
- print("+-------+--------+")
- print(":OS Info:This OS :")
- print("+-------+is made :")
- print(":specifically for:")
- print(":Pixel Studios' :")
- print(":needs, and has :")
- print(":few, if any, :")
- print(":features for :")
- print(":casual use. :")
- print(": :")
- print("+----------------+")
- term.setCursorPos(3,10)
- menu(1, "Exit")
- event, key = os.pullEvent("key")
- if key == 28 then
- if sid == 1 then
- adminInfoMenu()
- end
- end
- function adminVersionPage()
- while true do
- term.setCursorPos(1,1)
- print("+----------+")
- print(":This OS :")
- print(":is version:")
- print(":v0.2 Alpha:")
- print(": :")
- print("+----------+")
- term.setCursorPos(3,5)
- menu(1, "Exit")
- event, key = os.pullEvent("key")
- if key == 200 then
- if sid > 1 then
- sid = sid - 1
- end
- elseif key == 208 then
- if sid < 1 then
- sid = sid + 1
- end
- elseif key == 28 then
- if sid == 1 then
- adminInfoMenu()
- end
- end
- end
- end
- function adminAlphaPage()
- print("+-----+-------+")
- print(":Alpha:Thank :")
- print("+-----+you for:")
- print(":using the :")
- print(":alpha version:")
- print(":of PixeltonOS:")
- print(": :")
- print("+-------------+")
- term.setCursorPos(3,7)
- menu(1, "Exit")
- event, key = os.pullEvent("key")
- if key == 200 then
- if sid > 1 then
- sid = sid - 1
- end
- elseif key == 208 then
- if sid < 1 then
- sid = sid + 1
- end
- elseif key == 28 then
- if sid == 1 then
- adminInfoMenu()
- end
- end
- end
- end
- function infoMenu()
- while true do
- term.setCursorPos(1,1)
- print("+----+------------+")
- print(":Info: :")
- print("+----+ :")
- print(": : :")
- print(": : :")
- print(": : :")
- print(": : :")
- print(": : :")
- print("+----+------------+")
- term.setCursorPos(8,2)
- menu(1, "Version")
- term.setCursorPos(8,4)
- menu(2, "Alpha")
- term.setCursorPos(8,6)
- menu(3, "OS Info")
- term.setCursorPos(8,8)
- menu(4, "Exit")
- event, key = os.pullEvent("key")
- if key == 200 then
- if sid > 1 then
- sid = sid - 1
- end
- elseif key == 208 then
- if sid < 4 then
- sid = sid + 1
- end
- elseif key == 28 then
- if sid == 1 then
- versionPage()
- elseif sid == 2 then
- alphaPage()
- elseif sid == 3 then
- infoPage()
- elseif sid == 4 then
- guestDesktop()
- end
- end
- end
- end
- function infoPage()
- while true do
- term.setCursorPos(1,1)
- print("+-------+--------+")
- print(":OS Info:This OS :")
- print("+-------+is made :")
- print(":specifically for:")
- print(":Pixel Studios' :")
- print(":needs.There is :")
- print(":very little, if :")
- print(":any, features :")
- print(":for casual use. :")
- print(": :")
- print("+----------------+")
- term.setCursorPos(3,10)
- menu(1, "Exit")
- event, key = os.pullEvent("key")
- if key == 200 then
- if sid > 1 then
- sid = sid - 1
- end
- elseif key == 208 then
- if sid < 1 then
- sid = sid + 1
- end
- elseif key == 28 then
- if sid == 1 then
- infoMenu()
- end
- end
- end
- end
- function alphaPage()
- term.setCursorPos(1,1)
- print("+-----+-------+")
- print(":Alpha:Thank :")
- print("+-----+you for:")
- print(":using the :")
- print(":alpha version:")
- print(":of PixeltonOS:")
- print(": :")
- print("+-------------+")
- term.setCursorPos(3,7)
- menu(1, "Exit")
- event, key = os.pullEvent("key")
- if key == 200 then
- if sid > 1 then
- sid =sid - 1
- end
- elseif key == 208 then
- if sid < 1 then
- sid = sid + 1
- end
- elseif key == 28 then
- if sid == 1 then
- infoMenu()
- end
- end
- end
- function versionPage()
- while true do
- term.setCursorPos(1,1)
- print("+----------+")
- print(":The OS :")
- print(":version is:")
- print(":v0.2 Alpha:")
- print(": :")
- print("+----------+")
- term.setCursorPos(3,5)
- menu(1, "Exit")
- event, key = os.pullEvent("key")
- if key == 200 then
- if sid > 1 then
- sid = sid - 1
- end
- elseif key == 208 then
- if sid < 1 then
- sid = sid + 1
- end
- elseif key == 28 then
- if sid == 1 then
- infoMenu()
- end
- end
- end
- end
- function MOS()
- local r = read()
- cls()
- term.setCursorPos(1,1)
- print("Minecraft-Operating-System, or MOS, is")
- print("a product of PixelStudios. Use of MOS ")
- print("as your own is prohibited. MOS is a")
- print("part of PixeltonOS and is in alpha.")
- print("Thank you for using MOS as your OS.")
- read()
- if r == "Exit" then
- adminDesktop()
- elseif r == "Users" then
- userList()
- read()
- elseif r == "cls" then
- cls()
- read()
- elseif r == "games" then
- gamesList()
- read()
- end
- end
- function gamesList()
- print("Games: None")
- end
- function userList()
- print("Users:")
- print("Admin")
- print("Guest")
- end
- function adminDesktop()
- while true do
- cls()
- term.setCursorPos(1,1)
- print("+---------------+---------------------------------+")
- print(":Admin's Desktop:=================================:")
- print("++--------------+--------------------------------++")
- print("::_______ ::")
- print("::: \\ ::")
- print("::: : ::")
- print("::: : ::")
- print("::: : ::")
- print(":::______: ::")
- print(":: ::")
- print(":: ::")
- print(":: ::")
- print(":: ::")
- print(":: ::")
- print(":: ::")
- print("++-------+---------------------------------------++")
- print(": :========================================:")
- print("+--------+----------------------------------------+")
- term.setCursorPos(2,17)
- menu(1, "System")
- term.setCursorPos(4,6)
- menu(2, "FileM")
- event, key = os.pullEvent("key")
- if key == 200 then
- if sid > 1 then
- sid = sid - 1
- end
- elseif key == 208 then
- if sid < 2 then
- sid = sid + 1
- end
- elseif key == 28 then
- if sid == 1 then
- adminSystemMenu()
- elseif sid == 2 then
- adminFiles()
- end
- end
- end
- end
- --CodeForOS--
- bootUp()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement