Posted 12 March 2013 - 07:21 AM
I'm trying to create a crafting program using the Computer Controlled Crafter from MiscPeripheral(http://www.computercraft.info/forums2/index.php?/topic/4587-cc15mc147-miscperipherals-31/). I have a working program but when I started to create the GUI i realized that it would be a lot easier for the player if you could separate some recipes by what mod they are from.
The way i retrieve the recipe info and how many are created per recipe in one string, for example this is the code for a furnace
I guess I could also make it work by having strings in each category within a specific table for that category and then all those tables inside one big table. so something like this
I hope my problem came out clear, sorry if I'm rambling and if the English is dreadful.
The way i retrieve the recipe info and how many are created per recipe in one string, for example this is the code for a furnace
PatternList["Furnace"]="1:Cobblestone:Cobblestone:Cobblestone:Cobblestone:nil:Cobblestone:Cobblestone:Cobblestone:Cobblestone"
The string is stored in a table and all recipes are in the same table right now and the only way i can come up with is to add an extra piece of string with the catergory at the end and when the GUI is created it has to parse through all the recipes in order to add them to categories. I suspect that will be very inefficient so i was hoping that there is a way that i have missed.I guess I could also make it work by having strings in each category within a specific table for that category and then all those tables inside one big table. so something like this
PatternList["Vanilla"]["Furnace"]="1:Cobblestone:Cobblestone:Cobblestone:Cobblestone:nil:Cobblestone:Cobblestone:Cobblestone:Cobblestone"
But for one i don't even know if this works and two then i would have to rewrite some of the code to use for each loops every time i go through the PatternList.I hope my problem came out clear, sorry if I'm rambling and if the English is dreadful.