Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function is_facing_name(str)
- local success, data = turtle.inspect()
- if not success then
- return false
- end
- if data.name == str then
- return true
- end
- return false
- end
- local function mine()
- while not is_facing_name("minecraft:cobblestone") do
- sleep(1)
- end
- turtle.dig()
- end
- local function clear_inventory()
- for s = 1, 16 do
- turtle.select(s)
- if turtle.getItemCount() < 64 then
- return
- end
- end
- turtle.turnRight()
- for s = 1, 16 do
- turtle.select(s)
- if not turtle.drop(64) then
- print("Dumping chest is full")
- while not turtle.drop(64) do
- sleep(5)
- end
- end
- end
- turtle.turnLeft()
- end
- local function start()
- while true do
- clear_inventory()
- mine()
- end
- end
- local function init()
- start()
- end
- init()
Add Comment
Please, Sign In to add comment