Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- monitor = peripheral.wrap("left")
- monitor.setTextScale(2)
- mx, my = monitor.getSize()
- posX = 7
- posY = 6
- boxX1 = 6
- boxX2 = 8
- boxY1 = 5
- boxY2 = 7
- monitor.setCursorPos(boxX1, boxY1)
- monitor.write("*")
- monitor.setCursorPos(boxX2, boxY1)
- monitor.write("*")
- monitor.setCursorPos(boxX1, boxY2)
- monitor.write("*")
- monitor.setCursorPos(boxX2, boxY2)
- monitor.write("*")
- monitor.setCursorPos(posX, posY)
- while true do
- os.pullEvent("redstone")
- if rs.getInput("front") then
- monitor.setCursorPos(posX,posY)
- monitor.write("Engine is on")
- event, side, touchX, touchY = os.pullEvent("monitor touch")
- if touchX < boxX2 and touchX > boxX1 and touchY > boxY1 and touchY < boxY2 then
- rs.setOutpout("front", false)
- monitor.setCursorPos(posX, posY)
- monitor.write("Engine is off")
- end
- elseif not rs.getInput("front") then
- monitor.setCursorPos(posX,posY)
- monitor.write("Engine is off")
- event, side, touchX, touchY = os.pullEvent("monitor touch")
- if touchX > boxX1 and touchX < boxX2 and touchY > boxY1 and touchY < boxY2 then
- rs.setOutput("front", true)
- monitor.setCursorPos(posX, posY)
- monitor.write("Engine is on")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment