Omnimaga

Calculator Community => TI Calculators => Lua => Topic started by: Augs on September 03, 2012, 07:00:51 am

Title: Need help with lua
Post by: Augs on September 03, 2012, 07:00:51 am
I have some experience with programming and would like to write my own programs for the calc. I understand the basics of C# and understand basic. I have looked into it and it looks like lua is the best option. I am currently running on os 3.1(because of ndless). How can I get lua programs on my calc?

EDIT: Please post only once in the correct category. Thanks! :) -alberthrocks [Topics Merged]
Title: Re: Need help with lua
Post by: Jim Bauwens on September 03, 2012, 08:04:58 am
Augs, there is no need to create a new topic if someone doesn't reply qucikly .. just be patient.

Anyway, you can create Lua documents multiple ways.
The most easy is to use the SDK provided with the student software 3.2.
If you don't have that, there are two other options:
Use OClua, to program oncalc.
Use the editor of your choice, and compile the program using Luna. Then send the resulting document to your calculator.

Tutorials: http://www.inspired-lua.org/2012/01/starting-in-lua/
Luna: http://www.ticalc.org/archives/files/fileinfo/441/44113.html
OClua: http://www.ticalc.org/archives/files/fileinfo/440/44075.html

Hope this helps.
Title: Re: Need help with lua
Post by: alberthrocks on September 03, 2012, 08:29:09 am
Merged topics. (from http://ourl.ca/16942/315691)
This is the correct category to post Lua stuff! :D
Title: Re: Need help with lua
Post by: Augs on September 03, 2012, 08:38:18 am
Augs, there is no need to create a new topic if someone doesn't reply qucikly .. just be patient.

Anyway, you can create Lua documents multiple ways.
The most easy is to use the SDK provided with the student software 3.2.
If you don't have that, there are two other options:
Use OClua, to program oncalc.
Use the editor of your choice, and compile the program using Luna. Then send the resulting document to your calculator.

Tutorials: http://www.inspired-lua.org/2012/01/starting-in-lua/
Luna: http://www.ticalc.org/archives/files/fileinfo/441/44113.html
OClua: http://www.ticalc.org/archives/files/fileinfo/440/44075.html

Hope this helps.


Thanks I will go with luna. The tutorial you sent me was with oclua.
Title: Re: Need help with lua
Post by: Adriweb on September 03, 2012, 08:43:27 am
BTW, you can still use the OS 3.1 on your device and have the Computer Software 3.2, in which you have the Lua SDK.
(and for lua scripts only, it should work well enough with OS 3.1 when you put " platform.apilevel = '1.0' " at the beginning.
Title: Re: Need help with lua
Post by: Augs on September 03, 2012, 04:21:22 pm
BTW, you can still use the OS 3.1 on your device and have the Computer Software 3.2, in which you have the Lua SDK.
(and for lua scripts only, it should work well enough with OS 3.1 when you put " platform.apilevel = '1.0' " at the beginning.

thanks
Title: Re: Need help with lua
Post by: Augs on September 03, 2012, 04:37:18 pm
BTW, you can still use the OS 3.1 on your device and have the Computer Software 3.2, in which you have the Lua SDK.
(and for lua scripts only, it should work well enough with OS 3.1 when you put " platform.apilevel = '1.0' " at the beginning.
Having some trouble, it says the syntax is wrong. http://i.imgur.com/KLVZQ.png
Title: Re: Need help with lua
Post by: Adriweb on September 03, 2012, 04:52:26 pm
I meant in a Lua program, not basic ;-)

Computer software -> Insert -> Lua Editor -> Insert Script
Title: Re: Need help with lua
Post by: Augs on September 03, 2012, 05:01:46 pm
I meant in a Lua program, not basic ;-)

Computer software -> Insert -> Lua Editor -> Insert Script

Sorry, I am new to nspire programming.Is it this? http://i.imgur.com/O0iTv.png
Title: Re: Need help with lua
Post by: Adriweb on September 03, 2012, 05:04:19 pm
Yes, this one :)

Now you can follow the tutorials and have fun :)


(but only you will be able to transfer 3.1 compatible scripts by having only made a lua script and nothing else before (not what you did)) and sertting the apilevel to 1
Title: Re: Need help with lua
Post by: Jonius7 on September 10, 2012, 01:41:20 am
Are OS 3.1 scripts completely compatible with 3.2?
I know 3.0.x ones aren't.
I think also instead of Luna you can use the TI-nspire Scripting Tools, but I haven't actually tried it myself.
Title: Re: Need help with lua
Post by: ElementCoder on October 01, 2012, 02:50:51 am
Are OS 3.1 scripts completely compatible with 3.2?
I know 3.0.x ones aren't.
I think also instead of Luna you can use the TI-nspire Scripting Tools, but I haven't actually tried it myself.
I believe they are if you state "platform.apilevel = "1.0" on the top of your script, but correct me if i'm wrong.
Title: Re: Need help with lua
Post by: Jim Bauwens on October 01, 2012, 03:26:11 am
Sending a TNS of a lua application that was created with tools pre [3.2] will make the calculator run it in apiLevel 1.0 automatically.
However, if you copy the source and want to recompile it with the latest luna or the SDK you will need to add  "platform.apilevel = '1.0' " (as ElementCoder mentioned) to the top of your script.
But, it is also perfectly possible that the script will run fine without adding that line.

So:
- all 3.0x, 3.1 TNS files containing Lua scripts created with Luna < v0.3 should run fine on 3.2 . It will automatically use the old API structure
- if you want to recompile, add "platform.apilevel = '1.0' " to the top of your script.

Or you could just script it so that it doesn't matter where you run it :)
Title: Re: Need help with lua
Post by: Adriweb on October 01, 2012, 05:28:21 am
They are supposed to be compatible, especially if you didn't use any non-documented/private APIs (for example gc:setAlpha, etc.)
Title: Re: Need help with lua
Post by: Jonius7 on October 03, 2012, 11:20:40 pm
Sending a TNS of a lua application that was created with tools pre [3.2] will make the calculator run it in apiLevel 1.0 automatically.
However, if you copy the source and want to recompile it with the latest luna or the SDK you will need to add  "platform.apilevel = '1.0' " (as ElementCoder mentioned) to the top of your script.
But, it is also perfectly possible that the script will run fine without adding that line.

So:
- all 3.0x, 3.1 TNS files containing Lua scripts created with Luna < v0.3 should run fine on 3.2 . It will automatically use the old API structure
- if you want to recompile, add "platform.apilevel = '1.0' " to the top of your script.

Or you could just script it so that it doesn't matter where you run it :)

I remember when Lua first came out (and probably before Luna) it was compiled sort of manually with a Problem1.xml file separate inside the .tns. The original 15Puzzle for Lua is an example. You had to make some slight changes to the code and convert it to .lua using luna to make it compatible. Other than that, it seems that Lua files from 3.0.x are compatible from what I see, unless you use functions that have been removed such as print(.