Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local channel = 1
- local modem = peripheral.wrap("top")
- local rsSide = "left"
- function send(message)
- print("Sending message '" .. message .. "'")
- modem.transmit(channel, channel, message)
- end
- print("Computer listening for redstone from the " .. rsSide)
- while true do
- os.pullEvent("redstone")
- while (rs.getOutput("right")) do
- sleep(4)
- end
- if rs.getAnalogInput(rsSide) == 15 then
- send("finish")
- return
- elseif rs.getAnalogInput(rsSide) > 0 then
- if rs.getInput("front") then
- send("remove")
- else
- send("replace")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement