Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
19 May, 2013, 02:47:06 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1]   Go Down
  Print  
Author Topic: My first lua program -  (Read 584 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
annoyingcalc
the annoying calculator
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: Today at 01:51:54
Date Registered: 14 April, 2011, 23:02:24
Location: In the glorious land of minecraft
Posts: 1778


Topic starter
Total Post Ratings: +57

View Profile WWW
« on: 18 August, 2012, 23:26:51 »
+1

After a while of switching between which language to learn next I have decided to try lua, this is my first program in lua it isnt anything spectacular but it is a start  Cheesy I hope luna compiled it correctly (I used oclua)

EDIT: no it isnt Hello world

* first.tns (1 KB - downloaded 21 times.)
« Last Edit: 18 August, 2012, 23:42:04 by annoyingcalc » Logged

Click here to see where you got your post ratings

My minecraft server is usually up, even if mcserverlist says it is down

Spoiler for siq:
Spoiler for signature:
adriweb
Editor
LV9 Veteran (Next: 1337)
*
Offline Offline

Gender: Male
Last Login: Today at 01:08:16
Date Registered: 13 April, 2011, 18:42:59
Location: South of France
Posts: 1194


Total Post Ratings: +185

View Profile WWW
« Reply #1 on: 19 August, 2012, 00:22:51 »
0

Nice Smiley

Next step for you I guess is that you may want to use classes for creating more objects of the same type (instances of the class). Here's it's two objects so it's good enough not to use classes anyway.

Also I guess I don't see any indentation because it's not done on the computer ? (oclua / Luna, I'm not sure what you used ?)

Anyway, you can have the Nspire Software 3.2 while having your calc in 3.1 if you want to keep it so, and then you'll be able to profit from the Lua SDK inside the software which is much better than on-calc for longer scripts.

Don't forget to visit Inspired-Lua.org Cheesy
Logged


TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation
annoyingcalc
the annoying calculator
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: Today at 01:51:54
Date Registered: 14 April, 2011, 23:02:24
Location: In the glorious land of minecraft
Posts: 1778


Topic starter
Total Post Ratings: +57

View Profile WWW
« Reply #2 on: 19 August, 2012, 00:25:44 »
0

Also I guess I don't see any indentation because it's not done on the computer ? (oclua / Luna, I'm not sure what you used ?
right I am using my computer in the future though
Quote
Don't forget to visit Inspired-Lua.org Cheesy
That is where ive been going Cheesy
Logged

Click here to see where you got your post ratings

My minecraft server is usually up, even if mcserverlist says it is down

Spoiler for siq:
Spoiler for signature:
jwalker
LV7 Elite (Next: 700)
*******
Offline Offline

Gender: Male
Last Login: Today at 01:33:33
Date Registered: 20 December, 2011, 00:20:52
Location: its cold outside
Posts: 600


Total Post Ratings: +10

View Profile
« Reply #3 on: 19 August, 2012, 03:54:48 »
0

Nice, what kind of things do you plan on makeing?
Logged


My computer geek score is greater than 41% of all people in the world! How do you compare? Click here to find out!


Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads
annoyingcalc
the annoying calculator
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: Today at 01:51:54
Date Registered: 14 April, 2011, 23:02:24
Location: In the glorious land of minecraft
Posts: 1778


Topic starter
Total Post Ratings: +57

View Profile WWW
« Reply #4 on: 19 August, 2012, 04:03:50 »
0

Games, not sure what games yet.
Logged

Click here to see where you got your post ratings

My minecraft server is usually up, even if mcserverlist says it is down

Spoiler for siq:
Spoiler for signature:
cyanophycean314
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 03 May, 2013, 19:28:34
Date Registered: 07 December, 2011, 02:44:32
Location: Somewhere?
Posts: 363


Total Post Ratings: +42

View Profile
« Reply #5 on: 19 August, 2012, 16:45:05 »
0

Interesting program. You could probably turn this into some puzzle game where you have to navigate through mazes on both sides of the field and there're switches one person activates to help another.

Good to see another Lua coder!  Smiley
Logged

annoyingcalc
the annoying calculator
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: Today at 01:51:54
Date Registered: 14 April, 2011, 23:02:24
Location: In the glorious land of minecraft
Posts: 1778


Topic starter
Total Post Ratings: +57

View Profile WWW
« Reply #6 on: 20 August, 2012, 05:39:04 »
0

Yes, that is my plan for this!
Logged

Click here to see where you got your post ratings

My minecraft server is usually up, even if mcserverlist says it is down

Spoiler for siq:
Spoiler for signature:
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 18:13:08
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50196


Total Post Ratings: +2611

View Profile WWW
« Reply #7 on: 20 August, 2012, 06:11:32 »
0

EDIT: no it isnt Hello world

But there are no Hello World for the TI-Nspire yet. We need one! shocked

Just kidding I'll have to try your program when I have time. Smiley  Is OS 3.2 absolutely required or will I be fine with 3.1? I have Ndless...
« Last Edit: 20 August, 2012, 06:11:39 by DJ_O » Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
annoyingcalc
the annoying calculator
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: Today at 01:51:54
Date Registered: 14 April, 2011, 23:02:24
Location: In the glorious land of minecraft
Posts: 1778


Topic starter
Total Post Ratings: +57

View Profile WWW
« Reply #8 on: 20 August, 2012, 06:19:51 »
0

I use 3.1
Logged

Click here to see where you got your post ratings

My minecraft server is usually up, even if mcserverlist says it is down

Spoiler for siq:
Spoiler for signature:
jwalker
LV7 Elite (Next: 700)
*******
Offline Offline

Gender: Male
Last Login: Today at 01:33:33
Date Registered: 20 December, 2011, 00:20:52
Location: its cold outside
Posts: 600


Total Post Ratings: +10

View Profile
« Reply #9 on: 20 August, 2012, 06:26:17 »
0

You can make 3.2 programs completely compatible with 3.1 ones
Logged


My computer geek score is greater than 41% of all people in the world! How do you compare? Click here to find out!


Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads
adriweb
Editor
LV9 Veteran (Next: 1337)
*
Offline Offline

Gender: Male
Last Login: Today at 01:08:16
Date Registered: 13 April, 2011, 18:42:59
Location: South of France
Posts: 1194


Total Post Ratings: +185

View Profile WWW
« Reply #10 on: 20 August, 2012, 07:14:07 »
0

You can make 3.2 programs completely compatible with 3.1 ones
Indeed.
Either if you have only one script frame in your .tns (and you never had anything more than that - even if deleted) then you have to put " platform.apilevel = '1.0' " at the beginning of your script.
You can also use Luna
Logged


TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 18:13:08
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50196


Total Post Ratings: +2611

View Profile WWW
« Reply #11 on: 21 August, 2012, 04:42:21 »
0

You can make 3.2 programs completely compatible with 3.1 ones
Oh I meant for example if he decided to use the 3.2-only physic engine or commands. On the TI-84+ I remember people tried to make their games 83+ compatible, but some others forgot that the 83+ had no clock, so people complained that their games won't send to a 83+ because it uses the clock.
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
annoyingcalc
the annoying calculator
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: Today at 01:51:54
Date Registered: 14 April, 2011, 23:02:24
Location: In the glorious land of minecraft
Posts: 1778


Topic starter
Total Post Ratings: +57

View Profile WWW
« Reply #12 on: 21 August, 2012, 05:30:52 »
0

Oh, I only use 3.1 I want gpsp Cheesy
Logged

Click here to see where you got your post ratings

My minecraft server is usually up, even if mcserverlist says it is down

Spoiler for siq:
Spoiler for signature:
jwalker
LV7 Elite (Next: 700)
*******
Offline Offline

Gender: Male
Last Login: Today at 01:33:33
Date Registered: 20 December, 2011, 00:20:52
Location: its cold outside
Posts: 600


Total Post Ratings: +10

View Profile
« Reply #13 on: 21 August, 2012, 16:21:52 »
0

You can make 3.2 programs completely compatible with 3.1 ones
Oh I meant for example if he decided to use the 3.2-only physic engine or commands. On the TI-84+ I remember people tried to make their games 83+ compatible, but some others forgot that the 83+ had no clock, so people complained that their games won't send to a 83+ because it uses the clock.
That would make it incompatible, so would using withGC. But since he is using 3.1, He shouldnt have to realy worry about anything other than using setAlpha, platform.gc, the clipRect command "intersect", and there may be a few others and I just dont remember them. Those commands that I just listed will not work on OS 3.2
Logged


My computer geek score is greater than 41% of all people in the world! How do you compare? Click here to find out!


Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads
Jim Bauwens
Lua! Nspire! Linux!
Editor
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 00:21:22
Date Registered: 28 February, 2011, 22:32:12
Location: Belgium
Posts: 1733


Total Post Ratings: +180

View Profile WWW
« Reply #14 on: 21 August, 2012, 19:36:22 »
0

As far as I know, they will work if you have "platform.apiLevel = '1.0'".
Don't know about setAlpha though. But that command wasn't even supported and did not work properly on calc.
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.286 seconds with 31 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.