Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local monitor = peripheral.wrap("right")
- local redout = false
- term.write("Click to Stop")
- while(redstone.getInput("bottom") == false) do
- monitor.setTextScale(1)
- monitor.setCursorPos(1,1)
- monitor.write("() Solar Farm")
- monitor.setCursorPos(1,3)
- monitor.write("|--ON --|")
- monitor.setCursorPos(1,4)
- monitor.write("|--OFF--|")
- monitor.setCursorPos(1,5)
- monitor.write("| |")
- monitor.setCursorPos(1,6)
- monitor.write("| |")
- monitor.setCursorPos(1,7)
- if (redout == false) then
- monitor.write("|__OFF__|")
- redstone.setOutput("back", false)
- else
- monitor.write("|___ON__|")
- redstone.setOutput("back", true)
- end
- local event, side, xPos, yPos = os.pullEvent()
- if(event == "monitor_touch") then
- if(yPos == 3 ) then
- redout = true
- end
- if(yPos == 4) then
- redout = false
- end
- monitor.clear()
- elseif(event == "mouse_click") then
- term.clear()
- term.setCursorPos(1,1)
- term.write("XPOS:" .. xPos .. " YPOS:" .. yPos .. " SIDE:" .. side)
- sleep(1)
- return
- end
- sleep(0.01)
- end
Advertisement
Add Comment
Please, Sign In to add comment