Have you watched this episode of Direwolf20's season5 lets play
In it he uses the inventory module from miscperipherals to control which linking book is used in a mystcraft portal. I think you could modify that to your needs. Instead of linking books in specific slots in the chest you could have soul shards. The inventory module (or iteractive sorter I forget what its called) can be crafted along side a turtle to allow it to put and pull from specific slots in an inventory. This will allow you to keep your different shards in specific slots of a chest and keep the turtle's inventory clean.
For the actual turtle if you write the code like this
Code:
turtle.digUp()
turtle.suckUp()
then the soul cage should end up in slot one and the shard in slot 2. In the past I have had things not land in the slots I want though even if I do it like this
Code:
turtle.select(1)
turtle.digUp()
turtle.select(2)
turtle.suckUp()
But if you want to ensure that everything is in the right slot you could do this. (I was having a similar problem with a different turtle build awhile ago so this is an expanded version of that solution).
Code:
turtle.digUp()
turtle.suckUp()
--Put an empty soul cage in slot 16
turtle.select(1)
print("soul cage routine")
local sCage = turtle.compareTo(16) -- this compares slot 1 to slot 16 to make sure the soul cage is in slot one
if sCage == true then
print("Soul Cage location affirmed")
else
local i = 2
repeat
turtle.select(i)
print("searching")
local sCageTwo = turtle.compareTo(16)
if sCageTwo == false then
i = i+1 -- checks each slot against slot 16 looking for the soul cage
print("still searching")
else
print("soul cage located")
end
until i = 15 or sCageTwo = true -- stops the repeat loop when the turtle has found the soul cage
turtle.select(i)
turtle.transferTo(1) -- after finding the soul cage it moves it back to slot 1
print("Soul Cage retrieved and relocated")
end
turtle.select(2)
print(souls shard routine")
local sShard = turtle.getItemCount(2)
if sShard ~= 0 then
print("Soul Shard Location affirmed")
else
local i = 3
--Then cycle through a with a repeat loop like above. I would write it myself but I have just thought of something much simpler.
end
--do your code
I have just cobbled this code together it is neither complete nor as good as it could be. I haven't tested it either but I have put print commands in certain places to help you debug it.
However, as I was writing it I had another idea. You could remove the need for most of my code above by just putting junk items in slots 3 to 16 that the turtle will never touch.
Hope this helps