Advertisement
JustMark

meme

Jul 11th, 2019
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.41 KB | None | 0 0
  1. function checkCoal()
  2.     bendzoKiekis = turtle.getFuelLevel()
  3.    
  4.     if bendzoKiekis==0 then
  5.         turtle.select(1)
  6.         while not turtle.refuel(1) do
  7.             print('out of fuel')
  8.             sleep(1)
  9.         end
  10.     end
  11.  
  12.    
  13. end
  14. function moveForward(force)
  15.      checkCoal()
  16.  
  17.     if force == true then
  18.         while turtle.detect() do
  19.             turtle.dig()
  20.         end
  21.     end
  22.    
  23.      return turtle.forward()
  24. end
  25.  
  26. function moveUp(force)
  27.     checkCoal()
  28.    
  29.     if force == true then
  30.         while turtle.detectUp() do
  31.             turtle.digUp()
  32.         end
  33.     end
  34.  
  35.     return turtle.up()
  36. end
  37.  
  38. function moveDown(force)
  39.     checkCoal()
  40.  
  41.     if force == true then
  42.         while turtle.detectDown() do
  43.             turtle.digDown()
  44.         end
  45.     end
  46.  
  47.     return turtle.down()
  48. end
  49.  
  50. function moveBack()
  51.     checkCoal()
  52.  
  53.     turtle.back()
  54. end
  55.  
  56. curSlot = 2
  57.  
  58. function selectBlocks()
  59.     if turtle.getItemCount(curSlot) == 0 then
  60.         curSlot = curSlot + 1
  61.     end
  62.  
  63.     turtle.select(curSlot)
  64. end
  65.  
  66. while true do
  67.     moveUp()
  68.     selectBlocks()
  69.     turtle.placeDown()
  70.     moveUp()
  71.     selectBlocks()
  72.     turtle.placeDown()
  73.     moveUp()
  74.     selectBlocks()
  75.     turtle.placeDown()
  76.     moveBack()
  77.     selectBlocks()
  78.     turtle.place()
  79.     selectBlocks()
  80.     turtle.placeUp()
  81.     moveDown()
  82.     selectBlocks()
  83.     turtle.placeUp()
  84.     selectBlocks()
  85.     turtle.placeDown()
  86.     moveBack()
  87.     selectBlocks()
  88.     turtle.place()
  89. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement