This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
NarwahlDragon's profile picture

OpenPeripheral and RotaryCraft

Started by NarwahlDragon, 31 July 2014 - 12:55 PM
NarwahlDragon #1
Posted 31 July 2014 - 02:55 PM
I'm currently playing on a ftb Monster server with my friends on a modified version of 1.1.2 pack. We're working with automation and have recently gotten into RotaryCraft and instead of messing with the configs to make the automation easier, we decided to try and use turtles to autocraft using the worktable. We're running version 0.4.0 of OpenPeripheral Core, 0.1.4 OpenPeripheral Addons, and v25g of RotaryCraft.

The issue we ran into when using the peripheral.pushItemIntoSlot() function was that it input into the first open slot of the worktable regardless of what slot number was passed in.

Example: crafting a microturbine requires 1 compressor, 2 HSLA steel ingots, 1 combustor, 1 turbine, 1 shaft unit, and 3 base panels in this pattern
The first slot should be the compressor, second slot 1 HSLA steel ingot, third slot 1 HSLA steel ingot, etc.

The issue arises when there are multiple of an item, ex. the HSLA ingots and base panels.

Notice: The setup I have for this is:
C = Chest T = Turtle W = Worktable
CT
_W


chest = peripheral.wrap("left")
worktable = peripheral.wrap("bottom")
chest.pullItemIntoSlot("west",1,1,1)
worktable.pushItemIntoSlot("up",1,2,1)

So what you would expect is for whatever item was pulled from the chest to be placed into the turtle's first inventory slot, then moved into the second inventory slot of the worktable. Instead it sticks the item in the first available slot in the worktable, leading to issues with bunching on crafting recipes with multiple instances of an item.

Is there an issue with OpenPeripheral and RotaryCraft, or am I doing something wrong?
Edited on 31 July 2014 - 01:49 PM
flaghacker #2
Posted 31 July 2014 - 10:17 PM
I think you misunderstand how the openperipheral inventory functions work.
The functions behave from the peripheral's point of view, so when you suck, it's into the peripheral, pushing is away from the peripheral. The computer's direction/facing doesn't matter.
Edited on 31 July 2014 - 08:18 PM
Cranium #3
Posted 31 July 2014 - 10:58 PM
Moved to Ask A Pro.

Flaghacker is correct. Openperipheral moves items to/from inventories of wrapped peripherals from the peripheral's location, not the computer's location. It takes a bit to get used to, but overall, it's a bit easier to work with.
hilburn #4
Posted 31 July 2014 - 11:16 PM
You'll also need to supply a redstone signal because of the way the worktable works. but that's trivial once you have everything else sorted
NarwahlDragon #5
Posted 31 July 2014 - 11:48 PM
Sorry, I was at work and got my code mixed up. I understand that everything is from the perspective of the peripherals. My issue is not movement, because the item ends up in the inventory I want it to be in, but getting the item in the correct slot.
Edited on 31 July 2014 - 11:18 PM
flaghacker #6
Posted 01 August 2014 - 08:27 AM
Could you try a factorization router on the "slot" setting, to see if it's a bug in rotarycraft?
hilburn #7
Posted 01 August 2014 - 11:57 AM
You can put items into slots with routers just not with computers, the way I got around this was to have 8 junk blocks that do not stack (I used various Geostrata cobble) and fill the worktable with that, then place the items in the grid one at a time from 9 back to 1
Edited on 01 August 2014 - 09:57 AM
NarwahlDragon #8
Posted 01 August 2014 - 01:30 PM
I can try that flaghacker. Hilburn, your method unfortunately wouldn't work because of the stacking issue… unless I wanted to send in 65 HSLA steel ingots to overflow a slot, but that's impractical. Your method works with recipes with non-repeating ingredients.
hilburn #9
Posted 01 August 2014 - 03:20 PM
You clearly didn't understand what I suggested in that case. You fill slots 1-8 with non stacking junk blocks, add item to slot 9, remove junk block from slot 8, add item to slot 8 (even if it is the same item as in slot 9, it will go into slot 8) etc

Doing this it's completely possible to push a stack of any amount to any slot
NarwahlDragon #10
Posted 02 August 2014 - 04:01 AM
Wow, I'm thick. I apologize. In my mind that absolutely was not how it worked, but you're completely right. Sorry.
hilburn #11
Posted 02 August 2014 - 05:33 AM
No problem, it's the easiest way I've found of populating the grid as unfortunately OpenP doesn't let you interface with routers and change eg. which slot they insert into. Which is fair enough because that would be ridiculously powerful

Interestingly it's only a problem I've had since I upgraded my modpack from CC 1.5.8, OpenP 0.1.3, Rotary 19b to CC1.63, OpenP 0.1.4 and Rotary 25g, so I'm not sure which of these has changed, but my money's on Reika :)/>