Posted 22 August 2013 - 04:35 PM
I'm working on an Equivalent Exchange 3 program that has a minium stone in slot one and then pulls items to transmute from the above chest and deposit the crafted item into the forward chest.
So there is probably a really easy way to use a table to make this doable. But I'm very inexperienced with tables (plus major lack of sleep, but I digress.) So I want it to accept a tArgs[1] to know what is in the above chest to craft and an optional tArgs[2] for a backwards option.
The part I'm getting stuck at is the balancing part. I was able to balance it when there was only 2 items needed for next level of transmution. but then it got to 4, and it will be needlessly complex with my inefficient method. It needs to have the following characteristics.
1: Balance items in all needed slots.
2: deposit the remainder of items into the above chest.
3: the ability to put in a number or a word into tArgs[1]
i.e. it takes 2 wood logs in the recipe to make 1 obsidian. Where it takes 4 obsidian to make 1 iron ingot.
I don't mind putting in these items individually.
So there is probably a really easy way to use a table to make this doable. But I'm very inexperienced with tables (plus major lack of sleep, but I digress.) So I want it to accept a tArgs[1] to know what is in the above chest to craft and an optional tArgs[2] for a backwards option.
The part I'm getting stuck at is the balancing part. I was able to balance it when there was only 2 items needed for next level of transmution. but then it got to 4, and it will be needlessly complex with my inefficient method. It needs to have the following characteristics.
1: Balance items in all needed slots.
slot1 = turtle.getItemCount(2) -- lets say it has 3 items
slot2 = turtle.getItemCount(3) -- lets say it has 11 items
balance = (slot1 + slot2)/2
--<here should be the method to transfer 4 items from slot2 to slot1>
2: deposit the remainder of items into the above chest.
-- keeping the above code variables in mind
-- slot1 has 3
-- slot2 has 10
-- slot1 would end up with six and slot2 would have 7. I want to dump out that extra from slot2.
3: the ability to put in a number or a word into tArgs[1]
i.e. it takes 2 wood logs in the recipe to make 1 obsidian. Where it takes 4 obsidian to make 1 iron ingot.
I don't mind putting in these items individually.