Advertisement
PaymentOption

Cobble gen

Jul 30th, 2012
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.81 KB | None | 0 0
  1. nCobbleStoneCount = 0
  2.  
  3. local function dropAll()
  4.     turtle.turnRight(); turtle.turnRight()
  5.  
  6.     for i=1, 9 do
  7.         turtle.select( i ); turtle.drop( 64 )
  8.     end
  9.    
  10.     turtle.select( 1 )
  11.    
  12.     turtle.turnLeft(); turtle.turnLeft()
  13. end
  14.  
  15. local function getCobbleAmount()
  16.     turtle.select( 1 )
  17.    
  18.     for i=1, 9 do
  19.         if turtle.compare() then
  20.             nCobbleStoneCount = nCobbleStoneCount + turtle.getItemCount( i )
  21.         end
  22.     end
  23.    
  24.     for i=1, 9 do -- Reselect the slot that can still be added to.
  25.         if turtle.getItemCount( i ) ~= 64 then turtle.select( i ); return end
  26.     end
  27. end
  28.  
  29. while nCobbleStoneCount ~= 576 then -- 576 is the maximum amount of blocks that can be held by a turtle. 9 slots of 64 = 576.
  30.     getCobbleAmount() -- Reload the amount of cobblestone in the inventory.
  31.     if turtle.detect() then turtle.dig() end
  32. end
  33.  
  34. dropAll()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement