Advertisement
MigukNamja

Cobblestone Breaker

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