102 posts
Location
Alone in the dark, looking at the pretty lights with dreams of things I can not have.
Posted 03 December 2017 - 05:19 PM
Details you might want:
Game Version: 1.7.10
Mod Version: 1.74 + OpenCCSensors 1.75
Question:
I am working on an automatic warehouse using turtles and inventory sensors. However I have come upon a problem I am incapable of circumventing. In particular, the sensor peripherals from that mod return item names in a format incompatible with that provided by the Turtle API and I am unable to find a pattern which would allow me to easily convert between the two.
For example:
Item: IC2 copper ore
turtle.getItemDetail([slotNum]) -> minecraft:blockICopperOre
mySensor.getTargetDetails([target])["Name"] -> Copper Ore
mySensor.getTargetDetails([target])["RawName"] -> ic2.copper ore
As demonstrated, this difference makes it impossible for me to easily take sensor inputs and turtle inputs and use them interchangably in the same system. And this is something I need to do.
Has anyone come across this issue before and written some sort of code that could easily convert between them without me having to manually gather item names and write a giant table?
1426 posts
Location
Does anyone put something serious here?
Posted 03 December 2017 - 09:43 PM
Sadly there isn't an easy way to do this: Turtles use the unique ID (or registry name) of but OpenCCSensors uses the language key. If you've got OpenPeripherals installed, I believe they offer a way to get the registry name. If not, I suspect you're stuck with a manual lookup table.
102 posts
Location
Alone in the dark, looking at the pretty lights with dreams of things I can not have.
Posted 03 December 2017 - 09:58 PM
I see. Is there any good way to batch up the process than? Not nessecerily using computercraft it self or even minecraft either. Just some way of extracting the whole list of registry name, language key and proper name for each item so that I don't have to manually collect them for each item in the game? I'd be open to say using an external plugin or something that just cracks open the game files and dumps them all out. I know NEI has something similar but I don't know how to use it.
102 posts
Location
Alone in the dark, looking at the pretty lights with dreams of things I can not have.
Posted 03 December 2017 - 10:07 PM
Double post because I can't edit because I can't get approved yet.
I've figured out the NEI dumps and am starting to brute force it by using them to assemble a giant lookup table. Will report back with the results. Also if it works I will likely publish my code as an API so that other people don't have to thrudge through this. Although you'll need to use your own NEI dumps for the actual data.
102 posts
Location
Alone in the dark, looking at the pretty lights with dreams of things I can not have.
Posted 04 December 2017 - 11:16 AM
Update: I have decided to just circumvent the problem alltogether by approaching it from the angle of coordinates rather than item names. After all I am runing a warehouse with one chest per item type so that should work.
case closed