On my celestia space I wrote a page on scripting with objects. Objects are a specific kind of script that is highly reusable. You just put the code in some library file and you can (re)use it's functionality whereever you want. As an example, the page creates a celx color class that adds a color type to celx allowing to specify colors in the more common notations:
- digital 8-bit rgb : red = rgb(255, 255, 0) and
- hexadecimal rgb : red = "#FFFF00" or red = "red";
to store colors for later (re)use and to convert between notations. Arithmetic rgb - Celestia's default notation - is also supported.
You don't need to read and understand the page; you can just download the script and demo files and use them. They are available for download at the bottom of the page
There is also an object version available of the menu script.
There are at least two more objects comming up: a datetime object and a list object.
I'll announce them in this post when they are done.
Jan