Posted 25 February 2014 - 01:32 PM
i'm a slopy programer, if it works i do it i dont care if there is a better way.
i'm writeing a simple code to take nugets (from Tinkers Construcs ore berry bushes) and useing a advanced crafty turtle. even out the nugets in slots 6,7,8,10,11,12,14,15,16. then craft them into ingots.
Is there a way i could only pull out of the chest a amount divisible of 9? or some other way to do it.
(sorry about the spelling)
Here Is What I Have So Far
———————————-
local g = 6
function Sort()
turtle.select(6)
turtle.suckUp(9)
for i=6,8 do
turtle.transferTo(i,1)
end
for u=10,12 do
turtle.transferTo(u,1)
end
for y=14,16 do
turtle.transferTo(y,1)
end
end
function Drop()
for i=1,16 do
turtle.select(i)
turtle.drop()
end
end
(this is the part i need help with)
if turtle.getItemCount(g) == 9 then
Sort()
elseif turtle.getItemCount(g) == 18 then
Sort()
Sort()
elseif turtle.getItemCount(g) == 27 then
Sort()
Sort()
Sort()
end
(thats what i started and i could work but i'm sure that there is a better way(and i dont want to type the same thing over and over))
Drop()
turtle.select(1)
If you can help thanks!
i'm writeing a simple code to take nugets (from Tinkers Construcs ore berry bushes) and useing a advanced crafty turtle. even out the nugets in slots 6,7,8,10,11,12,14,15,16. then craft them into ingots.
Is there a way i could only pull out of the chest a amount divisible of 9? or some other way to do it.
(sorry about the spelling)
Here Is What I Have So Far
———————————-
local g = 6
function Sort()
turtle.select(6)
turtle.suckUp(9)
for i=6,8 do
turtle.transferTo(i,1)
end
for u=10,12 do
turtle.transferTo(u,1)
end
for y=14,16 do
turtle.transferTo(y,1)
end
end
function Drop()
for i=1,16 do
turtle.select(i)
turtle.drop()
end
end
(this is the part i need help with)
if turtle.getItemCount(g) == 9 then
Sort()
elseif turtle.getItemCount(g) == 18 then
Sort()
Sort()
elseif turtle.getItemCount(g) == 27 then
Sort()
Sort()
Sort()
end
(thats what i started and i could work but i'm sure that there is a better way(and i dont want to type the same thing over and over))
Drop()
turtle.select(1)
If you can help thanks!