Yet another Luna update + oclua for 3.2

Luna v0.3a fixes a compatibility problem with some unicode characters such as chinese ones. Sorry about it and thanks wtof1996 for reporting it.

It also skips the UTF-8 BOM added by some text editor to the .lua file to convert. Hopefully the popup  “An error was found in the format of this document” won’t annoy you anymore.

oclua (v0.1a) has also been rebuilt with this Luna to you let you use the new OS 3.2 Lua API.

The release of a possible official on-calc Lua editor is being too much delayed by TI. oclua was more of a proof-of-concept than an application ready to use. Fortunately yatto has worked on a nice editor called LuaCS which you can find on the French It features syntax highlighting, code snippets and indentation. Translation of menus is under way. It doesn’t yet offer native integration of a code runner and must be used together with oclua. Levak has started to work on this in his own (currently unstable) fork .

TI’s integration of Lua in the TI-Nspire was a first step for an officially supported true development experience, but is far from being complete. Let us put these projects to good use and explore how we can benefit from the new OS 3.2 Chipmunk-based physics engine!

Luna updated: compatibility with OS v3.2 and special characters

v0.3 of Luna is now available!

  • This version can generate Lua programs compatible with OS v3.2’s new Lua API. Thanks to jimbauwens for the hint.
  • It also fixes conversion issues with Lua scripts and documents which contain special characters. The whole UTF-8 encoding space is now supported, just make sure to save your input file in UTF-8.

Luna is a lightweight, portable, command-line Lua to TNS converter for TI-Nspire developers. It has been used for now nearly a year by Windows, Mac and Linux users as an alternative to TI’s official SDK to streamline their Lua development cycle. It is also used to generate custom TI-Nspire documents with full control on their format.

Luna powers Deep Thought online Lua converter and’s nCreator, a Web-based Notes editor.

Luna bug fixes

Luna v0.2a is now available, which fixes nasty bugs making it sometimes unusable. Sorry for the inconvenience, and thanks to Goplat and Levak. Make3D can now be fully converted with Luna, either the debug version or the library version.

You should also have a look at Levak’s useful script for nspire_emu to dump XML documents of arbitrary size, that can be combined with his other script to extract a Lua source code written on-calc with oclua.

Luna updated for third-party TNS document generation

I’m pleased to announce the availability of Luna v0.2!

This version adds support for arbitrary TI-Nspire “problems” conversion from XML format to TI-Nspire TNS documents compatible with OS 3.0.2 and above. This could not easily be done on the latest OS versions before, because TI took the sad decision to protect its OS from interoperability with third-party user tools.

Suppose you now want to build a computer tool that generates TI-Nspire documents with Notepad widgets.

1) Build the problem template: on nspire_emu, create a new document with a Notepad widget (“Add notes”). Put a debugger breakpoint to export the document in XML form, before it is compressed and encrypted: on a non-CAS OS 3.0.1, you would use something like:
k 10032AA0 +x
[save the document here]
w problem.xml r1 400
[repeat if the problem is bigger than 1024 bytes to get each problem chunk]

Some alternative methods such as copying from TI-Nspire Software and exporting the content with Levak’s clipboard dumper may also be used instead, or as adriweb suggests for Mac users the “Clipboard Viewer” available with XCode in /developer/Applications/Utilities/.

You will get an XML document that looks like (the Notepad only contains a “Hello world” here, the TI-Nspire XML format is indeed quite verbose):

<?xml version="1.0" encoding="UTF-8" ?>
<prob xmlns="urn:TI.Problem" ver="1.0" pbname="">
<sym></sym><card clay="0" h1="10000" h2="10000" w1="10000" w2="10000"><isDummyCard>0</isDummyCard><flag>0</flag>
<wdgt xmlns:np="urn:TI.Notepad" type="TI.Notepad" ver="2.0"><np:mFlags>1024</np:mFlags><np:value>3</np:value>
<np:fmtxt>&lt;r2dtotree&gt;&lt;node name=&quot;1doc&quot;&gt;&lt;node name=&quot;1para&quot;&gt;&lt;node name=&quot;1rtline&quot;&gt;&lt;leaf name=&quot;1word&quot;&gt;hello &lt;/leaf&gt;&lt;leaf name=&quot;1word&quot;&gt;world&lt;cursor index=&quot;0&quot;/&gt;&lt;/leaf&gt;&lt;/node&gt;&lt;/node&gt;&lt;/node&gt;&lt;/r2dtotree&gt;</np:fmtxt></wdgt></card></prob>

2) Write your problem generator based on this template

3) Integrate Luna with your generator:
luna problem.xml outdoc.tns

Quite easy, isn’t it? :)

[update 2011/09/21] Levak tells me his Make3D program which features a Lua plugin system can now be built with Luna and its XML converter for compatibility with OS 3.0.2 and later! Minor encoding issues had to be worked around, we’re looking further into them.

Luna, here she is!

Luna is the first third-party Lua script converter for TI-Nspire compatible with OS 3.0.2. It defeats the useless compression and encryption layers described in earlier posts.

Long-time TI-Nspire users, you now won’t need to pay for a Computer Software licence to code in Lua.

Developers, you won’t click and click and click anymore to convert/test/run your programs as you have to with the official kit.

Linux users, here is a portable tool.

Hackers, this can be a good base to build (or rewrite) third-party TI-Nspire document generators.

Enthusiasts, support for C and ARM on OS 3.x might not be so far…

I like this sound of openness and happiness, don’t you too?