Advertisement
Fatherless

bridge

Dec 7th, 2024 (edited)
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.54 KB | None | 0 0
  1. -- This builds a bridge 64 blocks long
  2.  
  3. -- Helper functions
  4. local function fwd()
  5.     while not turtle.forward() do
  6.         turtle.dig()
  7.     end
  8. end
  9.  
  10. -- Check fuel
  11. if turtle.getFuelLevel() < 128 then
  12.     print("Please provide at least 128 fuel")
  13.     return
  14. end
  15.  
  16. -- Check for enough blocks
  17. if turtle.getItemCount(1) < 64 then
  18.     print("Please place 64 blocks in slot 1")
  19.     return
  20. end
  21.  
  22. -- Build bridge
  23. turtle.select(1)
  24. for i = 1, 64 do
  25.     fwd()
  26.     turtle.placeDown()
  27. end
  28.  
  29. -- Come back
  30. for i = 1, 64 do
  31.     turtle.back()
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement