Posted 28 March 2013 - 01:18 AM
Basically trying to make my turtle re-stack all all of the items it carries to make the dumping into an ender chest faster, I have the rest of the code working but no matter what I have tried with the actual stacker function it either does nothing or gets into a never ending loop.
((sel(x) is just a turtle.select(slot) function))
I figure I'm doing something stupid, but can't for the life of me work out what. I get no errors on running so I figure the code is doing what it should just not what I want… :/
Code should work like this:
Check slot 4 to see if it contains less than 64 items then select slot 4 if this slot is the same slot as you already have ignore it and select slot 5. If slot 5 contains the same item move as much of this item as possible into slot 4.
Just realised I need to repeat the check of slot 4 to check it now has 64 items… but I can probably work that out, (probably just call stacker twice…) :D/>
function stacker()
for i = 4,16 do
if turtle.getItemCount(i) < 64 then
for b = 4,16 do
sel(B)/>/>/>
if not (b == i) then
if turtle.compareTo(i) then
turtle.transferTo(i)
end
end
end
end
end
end
http://pastebin.com/P6yEgTY8((sel(x) is just a turtle.select(slot) function))
I figure I'm doing something stupid, but can't for the life of me work out what. I get no errors on running so I figure the code is doing what it should just not what I want… :/
Code should work like this:
Check slot 4 to see if it contains less than 64 items then select slot 4 if this slot is the same slot as you already have ignore it and select slot 5. If slot 5 contains the same item move as much of this item as possible into slot 4.
Just realised I need to repeat the check of slot 4 to check it now has 64 items… but I can probably work that out, (probably just call stacker twice…) :D/>