jBlume

Full turtle placement and refuel in a row

Jul 1st, 2023
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.75 KB | None | 0 0
  1. --insert enderchest or drawer full of fuel in slot 1
  2. --supposed to place turtles from slots 3-16, add fuel to slot 2, and force them to refuel
  3.  
  4. --i = inventory slot
  5. i=3
  6.  
  7. --Select turtles in inventory slots and turn off after i=17
  8. for p=1,150 do
  9.  turtle.select(i)
  10.  if turtle.getItemCount(i)==0 then
  11.    i=i+1
  12.    turtle.select(i)
  13.   end
  14.  if i==17 then
  15.   turtle.reboot()
  16.  end
  17.  
  18.  
  19. --place turtle
  20.  turtle.turnLeft()
  21.  turtle.place()
  22.  
  23. --select fuel chest slot and add fuel to turtle, pick up chest, and force refuel
  24.  turtle.select(1)
  25.  turtle.placeUp()
  26.  turtle.select(2)
  27.  turtle.suckUp(15)
  28.  turtle.drop()
  29.  turtle.select(1)
  30.  turtle.digUp()
  31.  peripheral.wrap("front").refuel()
  32.  
  33. --move on to the next spot
  34.  turtle.turnRight()
  35.  turtle.forward()
  36. end
Add Comment
Please, Sign In to add comment