Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local monitor = peripheral.wrap("right")
- function getCoarseDirtAmount()
- local blockName = "minecraft:coarse_dirt"
- local total = 0
- for slot=1, 16 do
- local item = turtle.getItemDetail(slot)
- if item and item.name == blockName then
- total = total + item.count
- end
- end
- return total
- end
- function doDig()
- local foundCoarseDirt = false
- local slot = 0
- for i=2, 15 do
- local b = turtle.getItemDetail(i)
- if b and b.name == "minecraft:coarse_dirt" then
- foundCoarseDirt = true
- slot = i
- break
- end
- end
- if foundCoarseDirt == false then
- return false
- end
- turtle.select(slot)
- turtle.place()
- turtle.dig()
- turtle.select(16)
- turtle.equipRight()
- turtle.dig()
- turtle.equipRight()
- turtle.select(1)
- turtle.dropUp()
- return true
- end
- local amount = getCoarseDirtAmount()
- local upToThen = 0
- while doDig() do
- upToThen = upToThen + 1
- monitor.clear()
- monitor.setCursorPos(1, 1)
- monitor.setTextColor(colors.lime)
- monitor.write("TILLER_d")
- monitor.setCursorPos(1, 2)
- monitor.setTextColor(colors.white)
- monitor.write("At")
- monitor.setCursorPos(1, 3)
- monitor.write(""..upToThen.."/"..amount)
- end
- monitor.clear()
- monitor.setTextColor(colors.lime)
- monitor.setCursorPos(1, 1)
- monitor.write("--------")
- monitor.setCursorPos(1, 2)
- monitor.write("Tilling")
- monitor.setCursorPos(1, 3)
- monitor.write("complete")
- monitor.setCursorPos(1, 4)
Advertisement
Add Comment
Please, Sign In to add comment