Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.find("monitor")
- for k,v in pairs(rs.getSides()) do
- if peripheral.getType(v) == "modem" then
- rednet.open(v)
- end
- end
- function touchReady()
- mon.setBackgroundColor(colors.black)
- mon.clear()
- mon.setCursorPos(2,2)
- mon.write("Build")
- mon.setCursorPos(1,4)
- mon.write("Wither")
- end
- function building()
- mon.setBackgroundColor(colors.red)
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("Building")
- mon.setCursorPos(1,3)
- mon.write("Press to")
- mon.setCursorPos(1,5)
- mon.write("ABORT")
- end
- function abort()
- mon.setBackgroundColor(colors.green)
- mon.clear()
- mon.setCursorPos(1,2)
- mon.write("Aborted")
- end
- function buildComplete()
- mon.setBackgroundColor(colors.green)
- mon.clear()
- mon.setCursorPos(2,2)
- mon.write("Wither")
- mon.setCursorPos(2,4)
- mon.write("Built")
- end
- while true do
- touchReady()
- event, param1, param2, param3 = os.pullEvent()
- if event == "monitor_touch" then
- rednet.broadcast("BuildWither", 33)
- building()
- while true do
- ev, p1, p2, p3 = os.pullEvent()
- if ev == "monitor_touch" then
- rednet.broadcast("abort", 33)
- abort()
- sleep(10)
- break
- elseif ev == "rednet_message" and p2 == "WitherBuilt" and tonumber(p3) == 33 then
- buildComplete()
- sleep(60)
- break
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement