Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a = peripheral.wrap("right")
- rednet.open("back")
- term.clear()
- w, h = term.getSize()
- term.setCursorPos(1,2)
- print("ON")
- term.setCursorPos(1,3)
- print(">>OFF")
- a.setCursorPos(8, 3)
- a.write("Currently status of Generator:")
- a.setCursorPos(40,3)
- a.setTextColor(colors.red)
- a.write("Off!")
- rednet.broadcast("engine off")
- while true do
- term.setCursorPos(1,1)
- term.setTextColor(colors.white)
- print("Obsidian generator:")
- local event, buttom, w, h = os.pullEvent("mouse_click")
- if buttom == 1 and w == 1 and h == 2 then
- a.setTextColor(colors.white)
- a.clear()
- a.setCursorPos(8,3)
- a.write("Currently status of Generator: ")
- a.setCursorPos(40,3)
- a.setTextColor(colors.lime)
- a.write("On!")
- term.clear()
- term.setCursorPos(1,2)
- term.setTextColor(colors.lime)
- term.write(">>ON<<")
- term.setCursorPos(1,3)
- term.setTextColor(colors.white)
- term.write("OFF")
- rs.setOutput("right",true)
- rednet.broadcast("on")
- end
- if buttom == 1 and w == 1 and h == 3 then
- a.setTextColor(colors.white)
- a.clear()
- a.setCursorPos(8,3)
- a.write("Currently status of Generator: ")
- a.setCursorPos(40, 3)
- a.setTextColor(colors.red)
- a.write("Off!")
- rednet.broadcast("off")
- term.clear()
- term.setCursorPos(1,2)
- term.setTextColor(colors.white)
- term.write("ON")
- term.setCursorPos(1,3)
- term.setTextColor(colors.red)
- term.write(">>OFF<<")
- end
- end
Add Comment
Please, Sign In to add comment