lewile1

Turtle Refill Lava

Jan 22nd, 2015
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.67 KB | None | 0 0
  1. function aboutFace()
  2.    turtle.turnRight()
  3.    turtle.turnRight()
  4. end
  5.  
  6. function retrieveBucket()
  7.    turtle.up()
  8.    turtle.forward()
  9.    while turtle.getItemCount() == 0 do
  10.       turtle.suckDown()
  11.    end
  12.    aboutFace()
  13.    turtle.forward()
  14.    aboutFace()
  15.    turtle.down()
  16. end
  17.  
  18. function pulseRedstone(side)
  19.    redstone.setAnalogOutput(side, 8)
  20.    sleep(1)
  21.    redstone.setAnalogOutput(side, 0)
  22. end
  23.  
  24. function dropBucket()
  25.    turtle.drop()
  26.    pulseRedstone("front")
  27. end
  28.  
  29. while true do
  30.    retrieveBucket()
  31.    if turtle.getFuelLevel() < 500 then
  32.       print("Attemtping to refuel...")
  33.       turtle.refuel()
  34.    end
  35.    aboutFace()
  36.    dropBucket()
  37.    sleep(15)
  38. end
Advertisement
Add Comment
Please, Sign In to add comment