Advertisement
MigukNamja

Cobblestone Breaker

Oct 26th, 2013
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.99 KB | None | 0 0
  1. --
  2. -- Copyright 2013 MigukNamja
  3. -- miguknamja@gmail.com
  4. --
  5. -- Last Updated : 2013-10-14
  6. --
  7. -- MigukNamja's Infinite Cobblestone Breaker Program
  8. -- Requires a digging (diamond pickaxe-equipped) turtle
  9. --
  10.  
  11. --
  12. -- Drop-off everything in specified slot
  13. -- Preconditions : turtle is beneath the drop-off chest
  14. --
  15. -- Returns false if it could not drop off
  16. --
  17. function dropOff(slot)
  18.  
  19.   if turtle.getItemCount(slot) > 0 then    
  20.     turtle.select(slot)
  21.  
  22.     if not turtle.dropUp() then
  23.       print( "Could not place into container above" )
  24.       return false
  25.     end
  26.   end
  27.  
  28.   return true
  29. end
  30.  
  31.  
  32. -- Use 1st slot only
  33. turtle.select(1)
  34. gGuessBlocks = 0
  35.  
  36. --
  37. -- Break blocks down for forever
  38. -- Place blocks in chest above when have full stack of 64
  39. --
  40. while 1 do
  41.   if  turtle.digDown() then
  42.     gGuessBlocks = gGuessBlocks + 1
  43.     if gGuessBlocks == 64 then
  44.       dropOff(1)
  45.       gGuessBlocks = 0
  46.     end
  47.   end
  48.   sleep(1.5) -- sleep long enough for the cobblestone to form
  49. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement