Sneaky4296

Turtle Chunk Marker

Mar 19th, 2013
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.16 KB | None | 0 0
  1. print("Type out how many plots you want")
  2. plots = tonumber(read())
  3. side = 1
  4. block = 0
  5.  
  6. function checkFuel()
  7.     if turtle.getFuelLevel() < 5 then
  8.         turtle.select(1)
  9.         turtle.refuel(1)
  10.     end
  11. end
  12.  
  13. function blockSelect()
  14.     slot1 = turtle.getItemCount(16)
  15.     slot2 = turtle.getItemCount(15)
  16.     slot3 = turtle.getItemCount(14)
  17.     slot4 = turtle.getItemCount(13)
  18.  
  19.     if slot1 > 2 then
  20.         turtle.select(16)
  21.     end
  22.    
  23.     if slot1 < 2 and slot2 > 2 then
  24.         turtle.select(15)
  25.     end
  26.  
  27.     if slot2 < 2 and slot3 > 2 then
  28.         turtle.select(14)
  29.     end
  30.    
  31.     if slot3 < 2 and slot4 > 2 then
  32.         turtle.select(13)
  33.     end
  34. end
  35.  
  36. function blockPlace()
  37.     checkFuel()
  38.     blockSelect()
  39.     sleep(1)
  40.     turtle.dig()
  41.     turtle.forward()
  42.     turtle.digDown()
  43.     turtle.placeDown()
  44. end
  45.  
  46. while true do
  47.     if block < 15 and side < 5 then
  48.         blockPlace()
  49.         block = block + 1
  50.     end
  51.     if block == 15 and side < 5 then
  52.         blockPlace()
  53.         turtle.turnRight()
  54.         side = side + 1
  55.         block = 1
  56.     end
  57.     if side == 5 and block < 17 and plots > 1 then
  58.         turtle.turnLeft()
  59.         turtle.forward()
  60.         block = block + 1
  61.         plots = plots - 1
  62.     end
  63.     if side == 5 and block == 17 then
  64.         turtle.turnRight()
  65.         side = 1
  66.         block = 1
  67.     end
  68. end
Advertisement
Add Comment
Please, Sign In to add comment