Posted 29 January 2013 - 12:04 PM
Place "trash" item loot in first slot, e.g. Rotten Flesh for zombies, and this will be placed into the left chest. Everything else goes in the right chest.
http://pastebin.com/9fT8rnSi
PLace turtle and chests like this:
http://pastebin.com/9fT8rnSi
Spoiler
-- ****************************************************************************
-- ** **
-- ** FIGHT **
-- ** **
-- ** Attacks in front **
-- ** Collects loot **
-- ** Drops loot that matches Slot 1 into the chest on the left **
-- ** Drops loot that does not match Slot 1 into the chest on the right **
-- ** **
-- ****************************************************************************
while true do
if turtle.getItemCount(16) > 0 then
turtle.turnLeft()
for n=2,16 do
turtle.select(n)
if turtle.compareTo(1) then
turtle.drop()
end
end
turtle.select(1)
turtle.drop(turtle.getItemCount(1)-1)
turtle.turnLeft()
turtle.turnLeft()
for n=2,16 do
turtle.select(n)
if not turtle.compareTo(1) then
turtle.drop()
end
end
turtle.select(1)
turtle.turnLeft()
end
turtle.attack()
sleep(.1)
turtle.suck()
sleep(.1)
end