Advertisement
nick_kurrr

Untitled

Apr 4th, 2020
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. local channel = 1
  2. local modem = peripheral.wrap("top")
  3. local rsSide = "left"
  4.  
  5. function send(message)
  6. print("Sending message '" .. message .. "'")
  7. modem.transmit(channel, channel, message)
  8. end
  9.  
  10. print("Computer listening for redstone from the " .. rsSide)
  11.  
  12. while true do
  13. os.pullEvent("redstone")
  14. while (rs.getOutput("right")) do
  15. sleep(4)
  16. end
  17. if rs.getAnalogInput(rsSide) == 15 then
  18. send("finish")
  19. return
  20. elseif rs.getAnalogInput(rsSide) > 0 then
  21. if rs.getInput("front") then
  22. send("remove")
  23. else
  24. send("replace")
  25. end
  26. end
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement