Posted 27 January 2014 - 01:33 AM
I was wondering if I could get help solving a few issues I'm having with this script I was attempting to write.
I have my input chest to the left and my output chest to the right. My input chest is broken armor/tools of the same material. My output chest goes back into my AE system. The input chest will only get broken items (AE fuzzy exports with a 99% split damage), but it recieves them in any order, unsorted. I tried using a filing cabinet to mitigate the "unsorted" part, but it will pull out stacks of armor if I use the filing cabinet (I couldn't figure out how to make it only pull 1 of the item at a time).
One issue I'm still having is that I have to babysit it because it will get stuck with a single item (lets say its done repairing swords and there is only 1 left) and keep picking up the same sword, with the next item in line (pickaxe, for example). So until I pull out that single sword, it will keep trying to combine the pickaxe and sword in a loop. Once I pull the sword, it will move on to the pickaxes (or whatever the next item is in the chest).
The other is, as stated above, that I don't know how to tell it to only pick up 1 of the item and not the entire stack. Is there an extended or advanced API available for crafting turtles? It would be optimal if I could have it scan a chest for items that would equal a total damage value to make repairing optimal to get the maximum back on the items (for example finding a helm with less than 15/75 or less damage value to repair a helm with 60/75 or more damage value).
Actually, any extra documentation or commands that might be used in doing this for me would be great in helping me figure this out. I just threw this together from what I found on the wiki, but I'm not even sure I properly understood it. It works for now, with babysitting, but I would like to get it smoother so I could set it and forget it. Thanks in advance.
I have my input chest to the left and my output chest to the right. My input chest is broken armor/tools of the same material. My output chest goes back into my AE system. The input chest will only get broken items (AE fuzzy exports with a 99% split damage), but it recieves them in any order, unsorted. I tried using a filing cabinet to mitigate the "unsorted" part, but it will pull out stacks of armor if I use the filing cabinet (I couldn't figure out how to make it only pull 1 of the item at a time).
One issue I'm still having is that I have to babysit it because it will get stuck with a single item (lets say its done repairing swords and there is only 1 left) and keep picking up the same sword, with the next item in line (pickaxe, for example). So until I pull out that single sword, it will keep trying to combine the pickaxe and sword in a loop. Once I pull the sword, it will move on to the pickaxes (or whatever the next item is in the chest).
The other is, as stated above, that I don't know how to tell it to only pick up 1 of the item and not the entire stack. Is there an extended or advanced API available for crafting turtles? It would be optimal if I could have it scan a chest for items that would equal a total damage value to make repairing optimal to get the maximum back on the items (for example finding a helm with less than 15/75 or less damage value to repair a helm with 60/75 or more damage value).
Actually, any extra documentation or commands that might be used in doing this for me would be great in helping me figure this out. I just threw this together from what I found on the wiki, but I'm not even sure I properly understood it. It works for now, with babysitting, but I would like to get it smoother so I could set it and forget it. Thanks in advance.
while true do
turtle.turnLeft()
turtle.select(1)
turtle.suck(1)
turtle.select(2)
turtle.suck(1)
if turtle.getItemCount(1) == 1 and turtle.getItemCount(2) == 1 then
turtle.craft(1)
turtle.turnRight()
turtle.turnRight()
turtle.select(1)
turtle.drop()
turtle.select(2)
turtle.drop()
turtle.turnLeft()
else
turtle.turnRight()
turtle.turnRight()
turtle.select(1)
turtle.drop()
turtle.select(2)
turtle.drop()
turtle.turnLeft()
end
end