Posted 16 December 2015 - 02:55 AM
I have tried to make a program that has the ability to only mine certain block types.
so far i have used this to do so :
so far i have used this to do so :
function oreDetect()
if checkPriority() then
print("Found a priority item")
turtle.dig()
turtle.forward()
print("Item retrieved!")
print("Checking for more on the right")
turtle.turnRight()
oreDetect()
print("No more there")
turtle.turnLeft()
print("Checking for more on the left")
turtle.turnLeft()
oreDetect()
print("No more there")
turtle.turnRight()
end
end
function checkPriority()
priority = false
if turtle.detect() then
turtle.select(12)
if turtle.compare() == false then
priority = true
end
end
return priority
I did this for 3 slots for stone dirt and gravel respectively, but for some reason it does not work. I tried getting stone from the creative menu, I tried silk touching it, and even smelting it to see if this was a matter of weird meta datas, but that didn't work. If someone could tell me of an alternate way to do this, or what I'm doing wrong I would be really grateful :)/>.
function clear()
oreDetect()
turtle.dig()
end
Edited on 16 December 2015 - 02:39 AM