Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("System/API/context")
- local CommandBlock = peripheral.wrap("bottom")
- local function cb(command)
- CommandBlock.setCommand (command)
- CommandBlock.runCommand ()
- end
- local function time()
- cb("/time set")
- end
- term.clear()
- while true do
- local event,button,x,y = os.pullEvent()
- if event == "mouse_click" then
- if button == 2 and y > 1 then
- local action = context.menu(x,y,{"Morning",false},{"Day",false},{"Evening",false},{"Night",false},"-",{"Clear screen"},"-",{"Exit"})
- if action == "Morning" then
- cb("/time set 0")
- elseif action == "Day" then
- cb("/time set 6000")
- elseif action == "Evening" then
- cb("/time set 12250")
- elseif action == "Night" then
- cb("/time set 15000")
- elseif action == "Clear screen" then
- term.setBackgroundColor(colors.black)
- term.clear()
- elseif action == "Exit" then
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.black)
- term.setCursorPos(1,1)
- term.clear()
- break
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment