I am in the process of writing an API that is cross-platform between ComputerCraft and OpenComputers.
I am easily able to identify whether the platform the API is running on is either CC or OC via a simple pcall against a CC only or OC only API function.
However, I was curious to find out if there was an OpenComputer specific API function that would return me the version of OC that is currently loaded into Minecraft. The purpose for getting this information would allow my own API to adjust to the environment the user currently has loaded. This allows the developer to use my own API the same way regardless of which version of OC is currently loaded.
I was hoping there was a more elegant way of identifying the OC version than wrapping a pcall function around computer.romAddress(); where a pcall failure would indicate that the loaded OC version is 1.3 or higher and a success would be an OC version that is 1.2 or lower.
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Hello,
I am in the process of writing an API that is cross-platform between ComputerCraft and OpenComputers.
I am easily able to identify whether the platform the API is running on is either CC or OC via a simple pcall against a CC only or OC only API function.
However, I was curious to find out if there was an OpenComputer specific API function that would return me the version of OC that is currently loaded into Minecraft. The purpose for getting this information would allow my own API to adjust to the environment the user currently has loaded. This allows the developer to use my own API the same way regardless of which version of OC is currently loaded.
I was hoping there was a more elegant way of identifying the OC version than wrapping a pcall function around computer.romAddress(); where a pcall failure would indicate that the loaded OC version is 1.3 or higher and a success would be an OC version that is 1.2 or lower.
Link to post
Share on other sites