Author Topic: Need help with lua  (Read 8517 times)

0 Members and 2 Guests are viewing this topic.

Offline Augs

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 306
  • Rating: +30/-29
    • View Profile
Need help with lua
« 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]
« Last Edit: September 03, 2012, 08:27:58 am by alberthrocks »

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Need help with lua
« Reply #1 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.

Offline alberthrocks

  • Moderator
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 876
  • Rating: +103/-10
    • View Profile
Re: Need help with lua
« Reply #2 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
« Last Edit: September 03, 2012, 08:29:25 am by alberthrocks »
Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/


Proud member of ClrHome!

Miss my old signature? Here it is!
Spoiler For Signature:
Alternate "New" IRC post notification bot (Newy) down? Go here to reset it! http://withg.org/albert/cpuhero/

Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/

Activity remains limited due to busyness from school et al. Sorry! :( Feel free to PM, email, or if you know me well enough, FB me if you have a question/concern. :)

Don't expect me to be online 24/7 until summer. Contact me via FB if you feel it's urgent.


Proud member of ClrHome!

Spoiler For "My Projects! :D":
Projects:

Computer/Web/IRC Projects:
C______c: 0% done (Doing planning and trying to not forget it :P)
A_____m: 40% done (Need to develop a sophisticated process queue, and a pretty web GUI)
AtomBot v3.0: 0% done (Planning stage, may do a litmus test of developer wants in the future)
IdeaFrenzy: 0% done (Planning and trying to not forget it :P)
wxWabbitemu: 40% done (NEED MOAR FEATURES :P)

Calculator Projects:
M__ C_____ (an A____ _____ clone): 0% done (Need to figure out physics and Axe)
C2I: 0% done (planning, checking the demand for it, and dreaming :P)

Offline Augs

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 306
  • Rating: +30/-29
    • View Profile
Re: Need help with lua
« Reply #3 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.

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Need help with lua
« Reply #4 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.
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline Augs

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 306
  • Rating: +30/-29
    • View Profile
Re: Need help with lua
« Reply #5 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

Offline Augs

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 306
  • Rating: +30/-29
    • View Profile
Re: Need help with lua
« Reply #6 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
« Last Edit: September 03, 2012, 04:38:25 pm by Augs »

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Need help with lua
« Reply #7 on: September 03, 2012, 04:52:26 pm »
I meant in a Lua program, not basic ;-)

Computer software -> Insert -> Lua Editor -> Insert Script
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline Augs

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 306
  • Rating: +30/-29
    • View Profile
Re: Need help with lua
« Reply #8 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

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Need help with lua
« Reply #9 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
« Last Edit: September 03, 2012, 05:05:12 pm by adriweb »
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline Jonius7

  • python! Lua!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1918
  • Rating: +82/-18
  • Still bringing new dimensions to the TI-nspire...
    • View Profile
    • TI Stadium
Re: Need help with lua
« Reply #10 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.
Programmed some CASIO Basic in the past
DJ Omnimaga Music Discographist ;)
DJ Omnimaga Discography
My Own Music!
My Released Projects (Updated 2015/05/08)
TI-nspire BASIC
TI-nspire Hold 'em
Health Bar
Scissors Paper Rock
TI-nspire Lua
Numstrat
TI-nspire Hold 'em Lua
Transport Chooser
Secret Project (at v0.08.2 - 2015/05/08)
Spoiler For Extra To-Be-Sorted Clutter:

Spoiler For Relegated Projects:
TI-nspire BASIC
Battle of 16s (stalled) | sTIck RPG (stalled) | Monopoly (stalled) | Cosmic Legions (stalled)
Axe Parser
Doodle God (stalled while I go and learn some Axe)

Offline ElementCoder

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 611
  • Rating: +42/-2
    • View Profile
Re: Need help with lua
« Reply #11 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.

Some people need a high five in the face... with a chair.
~EC

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Need help with lua
« Reply #12 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 :)

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Need help with lua
« Reply #13 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.)
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline Jonius7

  • python! Lua!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1918
  • Rating: +82/-18
  • Still bringing new dimensions to the TI-nspire...
    • View Profile
    • TI Stadium
Re: Need help with lua
« Reply #14 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(.
Programmed some CASIO Basic in the past
DJ Omnimaga Music Discographist ;)
DJ Omnimaga Discography
My Own Music!
My Released Projects (Updated 2015/05/08)
TI-nspire BASIC
TI-nspire Hold 'em
Health Bar
Scissors Paper Rock
TI-nspire Lua
Numstrat
TI-nspire Hold 'em Lua
Transport Chooser
Secret Project (at v0.08.2 - 2015/05/08)
Spoiler For Extra To-Be-Sorted Clutter:

Spoiler For Relegated Projects:
TI-nspire BASIC
Battle of 16s (stalled) | sTIck RPG (stalled) | Monopoly (stalled) | Cosmic Legions (stalled)
Axe Parser
Doodle God (stalled while I go and learn some Axe)