Posted 12 September 2015 - 06:07 PM
This function, whenever run, will always drop the item in the first slot correctly, but will misidentify all the other items in the turtle's inventory as the same item, so if it's, say, an ore, it will be dropped as if it was cobblestone, sand, etc.
The variable items is this
And the variable data is
Here's the full program: http://pastebin.com/9BQagRKS
function junk()
for i = 1, 16 do
turtle.select(i)
if items[data.name] then
turtle.drop()
print(data.name)
else
print("No unwanted items")
end
end
turtle.select(1)
end
The variable items is this
local items = {
["minecraft:cobblestone"] = true,
["minecraft:dirt"] = true,
["minecraft:gravel"] = true,
["minecraft:sand"] = true,
["minecraft:sandstone"] = true,
["chisel:granite"] = true,
["chisel:diorite"] = true,
["chisel:andesite"] = true,
["chisel:marble"] = true,
}
And the variable data is
local data = turtle.getItemDetail()
Here's the full program: http://pastebin.com/9BQagRKS
Edited on 12 September 2015 - 11:20 PM