Advertisement
Phemto

WaterDrop

Jun 2nd, 2023 (edited)
969
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Wait for a redstone signal and then activate the drop protocol for WaterDrop
  2. --does not actually need a dropper
  3. --start with water in slot 1 and 2
  4.  
  5. local channel = 0  --destination number
  6.  
  7. --initialize the modem
  8. modem = peripheral.wrap("left")
  9. modem.open(channel)
  10.  
  11. args = { ... }
  12.  
  13. turtle.select(3)
  14. turtle.back()
  15. for i=1,50,1 do
  16.     turtle.digDown()
  17.     turtle.down()
  18. end
  19. turtle.up()
  20. turtle.select(1)
  21. turtle.placeDown()
  22. for i=1,49,1 do
  23.     turtle.up()
  24. end
  25. turtle.dig()
  26. turtle.forward()
  27. turtle.turnRight()
  28. turtle.turnRight()
  29. turtle.select(3)
  30. turtle.place()
  31. while true do
  32.     os.pullEvent("redstone") -- wait for a "redstone" event
  33.     if rs.getInput("top") then -- check the input
  34.         --This is a call to start dropping.
  35.         modem.transmit(channel, 2,  "ON")
  36.         print("Sending Drop Signal")
  37.         modem.closeAll()
  38.         turtle.dig()
  39.         sleep(10)
  40.         turtle.digDown()
  41.         turtle.select(2)
  42.         turtle.placeDown()
  43.         sleep(20)
  44.         turtle.select(3)
  45.         turtle.place()
  46.     end
  47. end
  48.  
  49.  
  50.        
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement