daily pastebin goal
65%
SHARE
TWEET

cobblestonebot.lua

sanderronde Jan 10th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local function is_facing_name(str)
  2.     local success, data = turtle.inspect()
  3.     if not success then
  4.         return false
  5.     end
  6.     if data.name == str then
  7.         return true
  8.     end
  9.     return false
  10. end
  11.  
  12. local function mine()
  13.     while not is_facing_name("minecraft:cobblestone") do
  14.         sleep(1)
  15.     end
  16. end
  17.  
  18. local function clear_inventory()
  19.     for s = 1, 16 do
  20.         turtle.select(s)
  21.         if turtle.getItemCount() < 64 then
  22.             return
  23.         end
  24.     end
  25.  
  26.     turtle.turnRight()
  27.     for s = 1, 16 do
  28.         turtle.select(s)
  29.         if not turtle.drop(64) then
  30.             print("Dumping chest is full")
  31.             while not turtle.drop(64) do
  32.                 sleep(5)
  33.             end
  34.         end
  35.     end
  36.     turtle.turnLeft()
  37. end
  38.  
  39. local function start()
  40.     while true do
  41.         clear_inventory()
  42.         mine() 
  43.     end
  44. end
  45.  
  46. local function init()
  47.     start()
  48. end
  49.  
  50. init()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top