Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • 0
amorai

OpenComputers version in LUA

Question

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

2 answers to this question

Recommended Posts

Join the conversation

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.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.