Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
25 May, 2013, 14:05:37 *
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 [2]   Go Down
  Print  
Author Topic: Loading Lua code dynamically for fun and profit (on-calc Lua editor) -  (Read 2591 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
Chockosta
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 22 May, 2013, 20:19:59
Date Registered: 03 June, 2011, 20:14:17
Location: France
Posts: 440


Total Post Ratings: +159

View Profile
« Reply #15 on: 05 July, 2011, 20:01:35 »
0

I love you.
This was the only which lacked to the TI-Nspire
Logged

Chockosta (Loic Pujet) - Sorry for my poor English...
Look at my projects :
in C code : Periodic table, Space invaders, Fall, Snake, Minesweeper, nCraft (WIP)
in Lua : Snake, Space invaders, Bobby Carrot, Minesweeper, Mazes 3D, nSpaint, FreeCell, Tiny3D-Viewer, CubeField, Gravity Guy
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: Today at 13:26:24
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50235


Total Post Ratings: +2615

View Profile WWW
« Reply #16 on: 06 July, 2011, 19:03:59 »
0

Darn this is epic ExtendeD. A lot of people liked to program on-calc when they did 83+ stuff. I bet this will be appreciated by many Nspire owners too. shocked
Logged

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

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
BrownyTCat
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 08 May, 2013, 19:20:38
Date Registered: 15 May, 2009, 22:39:36
Location: {(Y+Z)*W+(X+6)+GDB1}
Posts: 420


Total Post Ratings: +19

View Profile
« Reply #17 on: 06 July, 2011, 23:54:57 »
0

I hope if ndless 3 comes out we can have a robust editor with a compiler.
Logged

Levak
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: Today at 12:23:56
Date Registered: 04 April, 2010, 23:42:49
Location: France
Posts: 844


Total Post Ratings: +148

View Profile WWW
« Reply #18 on: 07 July, 2011, 02:03:37 »
0

with a compiler.

A what ? for Lua ?
« Last Edit: 07 July, 2011, 02:04:26 by Levak » Logged

Human always wants to survive and that's why he will fall one day.
My website - TI-Planet - iNspired-Lua
Chockosta
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 22 May, 2013, 20:19:59
Date Registered: 03 June, 2011, 20:14:17
Location: France
Posts: 440


Total Post Ratings: +159

View Profile
« Reply #19 on: 07 July, 2011, 16:08:11 »
0

Even if it's not a compiler, it looks like one...
How should we call that ? an "encryptor" ?
Logged

Chockosta (Loic Pujet) - Sorry for my poor English...
Look at my projects :
in C code : Periodic table, Space invaders, Fall, Snake, Minesweeper, nCraft (WIP)
in Lua : Snake, Space invaders, Bobby Carrot, Minesweeper, Mazes 3D, nSpaint, FreeCell, Tiny3D-Viewer, CubeField, Gravity Guy
Levak
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: Today at 12:23:56
Date Registered: 04 April, 2010, 23:42:49
Location: France
Posts: 844


Total Post Ratings: +148

View Profile WWW
« Reply #20 on: 07 July, 2011, 17:17:41 »
0

Even if it's not a compiler, it looks like one...
How should we call that ? an "encryptor" ?
Well .. a shell ?
Logged

Human always wants to survive and that's why he will fall one day.
My website - TI-Planet - iNspired-Lua
Munchor
LV13 Extreme Addict (Next: 9001)
*************
Offline Offline

Gender: Male
Last Login: 21 May, 2013, 17:58:01
Date Registered: 16 October, 2010, 15:39:13
Location: Position
Posts: 6209


Total Post Ratings: +174

View Profile
« Reply #21 on: 07 July, 2011, 17:20:38 »
0

I think he means that if Ndless 3 comes it'd be good to have an on-calc text editor with a LUA>TNS Converter. Keep it simple Smiley
Logged
Chockosta
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 22 May, 2013, 20:19:59
Date Registered: 03 June, 2011, 20:14:17
Location: France
Posts: 440


Total Post Ratings: +159

View Profile
« Reply #22 on: 07 July, 2011, 17:25:37 »
0

I was talking of the tool which produces TNS files from LUA code.
I don't really know what a shell is, but I think it's something different. (The interpretor is a shell, isn't it ?)
« Last Edit: 07 July, 2011, 17:27:13 by Chockosta » Logged

Chockosta (Loic Pujet) - Sorry for my poor English...
Look at my projects :
in C code : Periodic table, Space invaders, Fall, Snake, Minesweeper, nCraft (WIP)
in Lua : Snake, Space invaders, Bobby Carrot, Minesweeper, Mazes 3D, nSpaint, FreeCell, Tiny3D-Viewer, CubeField, Gravity Guy
Levak
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: Today at 12:23:56
Date Registered: 04 April, 2010, 23:42:49
Location: France
Posts: 844


Total Post Ratings: +148

View Profile WWW
« Reply #23 on: 07 July, 2011, 17:48:59 »
0

I think he means that if Ndless 3 comes it'd be good to have an on-calc text editor with a LUA>TNS Converter. Keep it simple Smiley
^this
Logged

Human always wants to survive and that's why he will fall one day.
My website - TI-Planet - iNspired-Lua
Matrefeytontias
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: Today at 10:37:10
Date Registered: 14 October, 2011, 18:48:49
Location: Alone in the Park
Posts: 856


Total Post Ratings: +174

View Profile
« Reply #24 on: 29 September, 2012, 16:24:37 »
0

Huge up, sorry Undecided

I'm having trouble with OCLua : why can't I use a for loop which runs more than 128 times ?

This code brings the calc into an infinite loop :

1
2
for i = 0, 128 do
end
And this works fine :

1
2
for i = 0, 127 do
end
Logged

/\   ><   [-   |_|   _\~   [-   /?



Spoiler for Shameful self-advertising:
/image/37571.png[/img]
If at a certain moment you think that I'm awesome, give an internet (>^_^)>
Jim Bauwens
Lua! Nspire! Linux!
Editor
LV10 31337 u53r (Next: 2000)
*
Online Online

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


Total Post Ratings: +180

View Profile WWW
« Reply #25 on: 29 September, 2012, 16:35:13 »
0

I haven't tried your code, but I assume you put that in on.paint .
Probably what is happening is that on.paint get's called again (sometimes it does this when execution time is a bit too long), causing it too loop constantly.
But that's just a theory.
Logged

adriweb
Editor
LV9 Veteran (Next: 1337)
*
Offline Offline

Gender: Male
Last Login: 23 May, 2013, 12:02:44
Date Registered: 13 April, 2011, 18:42:59
Location: South of France
Posts: 1197


Total Post Ratings: +185

View Profile WWW
« Reply #26 on: 29 September, 2012, 16:51:49 »
0

Huge up, sorry Undecided

I'm having trouble with OCLua : why can't I use a for loop which runs more than 128 times ?

This code brings the calc into an infinite loop :

1
2
for i = 0, 128 do
end
And this works fine :

1
2
for i = 0, 127 do
end


Could you post more of the code ?

Also, I'm not sure about Jim's theory - well I haven't found myself in such case before. but maybe with timers and stuff it may happen... weird though...
« Last Edit: 29 September, 2012, 16:53:28 by adriweb » Logged


TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation
Matrefeytontias
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: Today at 10:37:10
Date Registered: 14 October, 2011, 18:48:49
Location: Alone in the Park
Posts: 856


Total Post Ratings: +174

View Profile
« Reply #27 on: 29 September, 2012, 17:30:53 »
0

Here is the code which doesn't work for me.

In fact, once I try the code I just posted, it works Huh? but just try the one I joined (it's the page 3).

Also, do you know a way to get text from a *.tns ?

* oclua.tns (3.63 KB - downloaded 9 times.)
« Last Edit: 29 September, 2012, 17:31:31 by Matrefeytontias » Logged

/\   ><   [-   |_|   _\~   [-   /?



Spoiler for Shameful self-advertising:
/image/37571.png[/img]
If at a certain moment you think that I'm awesome, give an internet (>^_^)>
Lionel Debroux
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: Today at 09:11:59
Date Registered: 17 December, 2009, 09:37:25
Location: France
Posts: 1854

Total Post Ratings: +208

View Profile WWW
« Reply #28 on: 29 September, 2012, 17:56:50 »
0

Copying and pasting some text might work, as would accessing TI-BASIC variables... but without external help, TI's proprietary Lua, which does not have io.* and os.* functions (i.e., among other limitations and incompatibilities with standard Lua, no external file access) cannot get text from a .tns.
Logged

Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.
adriweb
Editor
LV9 Veteran (Next: 1337)
*
Offline Offline

Gender: Male
Last Login: 23 May, 2013, 12:02:44
Date Registered: 13 April, 2011, 18:42:59
Location: South of France
Posts: 1197


Total Post Ratings: +185

View Profile WWW
« Reply #29 on: 29 September, 2012, 18:13:47 »
0

Copying and pasting some text might work, as would accessing TI-BASIC variables... but without external help, TI's proprietary Lua, which does not have io.* and os.* functions (i.e., among other limitations and incompatibilities with standard Lua, no external file access) cannot get text from a .tns.
I believe he's talking about the OcLua's text in page 2 which is a Notes page. So not-related with TI's Nspire-Lua. But still, it's a closed format.

The "only" easy way is to open it with the computer software. Then copy/paste it wherever you want it.


Anyway, about your script : no problems for me for any of your codes...
(Also, remember to put the least possible code (only the final graphics/screen drawing -related things) in the paint method since it's going to get called quite often and you don't want it to slow the rest Smiley
Logged


TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation
Pages: 1 [2]   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.424 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.