I've been trying to write a compatibility mod for PyCoalTBaA and the Circuit Processing addon for Bob's mods. I've been getting an error from PyCoalTBaA saying Failed to load mods: PyCoalTBaA/updates/SpaceX.lua:291: attempt to index field 'results' (a nil value). I believe that this is because you assume that the 'results' field exists, while some mods instead use the 'result' field instead. I believe this would be easily fixable with a check for which field exists and then using the value that isn't nil.
Also there seems to be a 'k' variable used to index the results field that's been defined in a previous portion of your ifelse statements. It seems to be unrelated to the results field, but it is probably just because I don't understand the full intricacies of your code.
If this is intended for your mod how would you suggest I go about migrating the layout of recipes in order to work with the SpaceX.lua file?