Advertisement
lemarwin

test_turtle

Jun 6th, 2023 (edited)
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.82 KB | Gaming | 0 0
  1. m = peripheral.wrap("right")
  2. m.link(2)
  3.  
  4. local tArgs= { ... }
  5. local l=tonumber(tArgs[1])
  6. local w=tonumber(tArgs[2])
  7. local h=tonumber(tArgs[3])
  8. x = 0
  9. y = 0
  10. z = 0
  11. b = false
  12. turtle.select(2)
  13. while z < h do
  14.     while y<w do
  15.         while x<l do
  16.             if turtle.getFuelLevel()<50 then
  17.                 turtle.select(1)
  18.                 turtle.refuel(5)
  19.                 m.resupply(1)
  20.                 turtle.select(2)
  21.             end
  22.             m.resupply(2)
  23.             turtle.placeDown()
  24.             x = x + 1
  25.             if x < l then turtle.forward() end
  26.         end
  27.         y = y + 1
  28.         x = 0
  29.         if y < l then
  30.         if b then
  31.             turtle.turnRight()
  32.             turtle.forward()
  33.             turtle.turnRight()
  34.             b = false
  35.         else
  36.             turtle.turnLeft()
  37.             turtle.forward()
  38.             turtle.turnLeft()
  39.             b = true
  40.         end
  41.         end
  42.     end
  43.     z = z + 1
  44.     if z < h then
  45.         turtle.up()
  46.         turtle.turnRight()
  47.         turtle.turnRight()
  48.     end
  49.     x = 0
  50.     y = 0
  51. end
  52.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement