Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local x, y = 1,4
- local x2, y2 = 1,6
- local x3, y3 = 1,8
- local x4, y4 = 1,10
- local x5, y5 = 1,12
- local x6, y6 = 1,14
- local x7, y7 = 1,16
- local choice1 = "[ ] Chat "
- local choice2 = "[ ] Calculator "
- local choice3 = "[ ] Notes "
- local choice4 = "[ ] Games "
- local choice5 = "[ ] Comp. Info "
- local choice6 = "[ ] Options "
- local choice7 = "[ ] Sleep "
- term.clear()
- term.setCursorPos(1, 1)
- term.setTextColor(colors.lightGray)
- print("--------------------------")
- print("---")
- term.setTextColor(colors.lightBlue)
- term.setCursorPos(4, 2)
- print("Bubble Bot Computers")
- term.setTextColor(colors.lightGray)
- term.setCursorPos(24, 2)
- print("---")
- print("--------------------------")
- local function drawMenu()
- term.setCursorPos(x, y)
- term.setTextColor(colors.white)
- write(choice1)
- term.setCursorPos(x2, y2)
- write(choice2)
- term.setCursorPos(x3, y3)
- write(choice3)
- term.setCursorPos(x4, y4)
- write(choice4)
- term.setCursorPos(x5, y5)
- write(choice5)
- term.setCursorPos(x6, y6)
- write(choice6)
- term.setCursorPos(x7, y7)
- write(choice7)
- end
- drawMenu()
- while true do
- local event, button, cx, cy = os.pullEvent()
- if event == "mouse_click" then
- if cx >= x and cx < choice1:len() and cy == y and button == 1 then
- term.clear()
- term.setCursorPos(1, 1)
- term.setTextColor(colors.white)
- shell.run("chat")
- elseif cx >= x2 and cx < choice2:len() and cy == y2 and button == 1 then
- term.clear()
- term.setCursorPos(1, 1)
- term.setTextColor(colors.white)
- shell.run("calculator")
- elseif cx >= x3 and cx < choice3:len() and cy == y3 and button == 1 then
- term.clear()
- term.setCursorPos(1, 1)
- term.setTextColor(colors.white)
- shell.run("notes")
- elseif cx >= x4 and cx < choice4:len() and cy == y4 and button == 1 then
- term.clear()
- term.setCursorPos(1, 1)
- term.setTextColor(colors.white)
- shell.run("games")
- elseif cx >= x5 and cx < choice5:len() and cy == y5 and button == 1 then
- term.clear()
- term.setCursorPos(1, 1)
- term.setTextColor(colors.white)
- shell.run("id")
- sleep(5)
- shell.run("menu")
- elseif cx >= x6 and cx < choice6:len() and cy == y6 and button == 1 then
- term.clear()
- term.setCursorPos(2, 2)
- shell.run("options")
- elseif cx >= x7 and cx < choice7:len() and cy == y7 and button == 1 then
- term.clear()
- term.setCursorPos(1, 1)
- term.setTextColor(colors.white)
- print("Goodbye...")
- sleep(1)
- os.shutdown()
- end
- -- break
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement