1 posts
Posted 04 December 2015 - 05:31 PM
Im looking for a program that mines only stone dirt and gravel within a rectangular area which you give length width and height for, while leaving all ores where they are. If you know a program like this already I could use that would be great, otherwise Id appreciate some tips for making the program.
173 posts
Location
The hall of 1000 monkeys and only 1 typewriter
Posted 20 December 2015 - 05:27 PM
tips, use an api that shortens and compacts turtle code (
mine is in these brackets) and also use turtle.inspect for detecting the type of block. Other than that, i'd think it's pretty simple, just time consuming
2427 posts
Location
UK
Posted 20 December 2015 - 06:31 PM
tips, use an api that shortens and compacts turtle code (
mine is in these brackets) and also use turtle.inspect for detecting the type of block. Other than that, i'd think it's pretty simple, just time consuming
You could make that script smaller if you use string.lower(str)
3057 posts
Location
United States of America
Posted 20 December 2015 - 06:48 PM
Place stone, dirt, and gravel in the first three slots of the turtle, then use turtle.compare to determine whether or not to mine something.
local function isGarbage()
for i = 1, 3 do --#do this for slots 1, 2, and 3
turtle.select( i ) --#select the slot
if turtle.compare() then --#if the stuff in the slot is what's in front of the turtle
return true --#return true
end
end
return false --#none of the three slots matched what's in front
end
--#usage
if isGarbage() then
turtle.dig()
else
--#we need to go somewhere else
end