what is your Lua script writing environment like? - page 3 - LUA Scripting - CHDK Forum

what is your Lua script writing environment like?

  • 62 Replies
  • 20078 Views
Re: what is your Lua script writing environment like?
« Reply #20 on: 19 / January / 2009, 16:57:57 »
Advertisements
big improvement in my dev environment - making my card reader ignore the lock tab

http://chdk.setepontos.com/index.php/topic,2983.0.html

Re: what is your Lua script writing environment like?
« Reply #21 on: 20 / April / 2013, 09:31:21 »
You might want to consider using hostlua: changelog of trunk including comments / devtalk

As I noted there, I'm working on a more sophisticated emulation environment based on this, which will eventually be added to svn.  Attached is my very very preliminary "emulator".
...
As noted above, this is a very early work in progress, more of a sketch of what I plan to do than anything else.
Did this ever go anywhere?  Currently the stuff in tools/hostlua  will not make - I think its having trouble with the math functions that rudi added recently.

Also, the greatest boost to Lua (and uBASIC) script development has probably been the use of chdkptp to load scripts over a USB cable rather that swapping cards in & out. That makes a huge difference in development time - maybe that's why people seem to have lost interest in a PC emulation environment?
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline msl

  • *****
  • 1263
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: what is your Lua script writing environment like?
« Reply #22 on: 20 / April / 2013, 11:31:37 »
rudi has provided a great Lua test environment in German CHDK forum: http://forum.chdk-treff.de/viewtopic.php?f=7&t=2973

You can test CHDK lua scripts on the PC or on the camera. The base is the great editor notepad++ (portable or installed) with the plugin NppExec.

You need a compiled hostlua package, a special batch file, emu.lua and chdkptp.exe. The attachment from the link above contains all the necessary things. A batch file create_config.cmd creates a config file for Notepad++. For more informations translate the text file liesmich.txt from zip file
  • You can create a CHDK Lua script in Notepad++ and
    • run this local in the console of Notepad++
    • run this on the camera
    • run this on the camera with output on the Notepad++ console
  • You can copy files.
  • You can execute chdkptp scripts

For me is this the best way to write and test Lua scripts.

msl
CHDK-DE:  CHDK-DE links

Re: what is your Lua script writing environment like?
« Reply #23 on: 20 / April / 2013, 11:41:25 »
You need a compiled hostlua package, a special batch file, emu.lua and chdkptp.exe.
...
For me is this the best way to write and test Lua scripts.
Thanks msl.   Unfortunately its a Windows solution - although Notepad++ will run under Wine so I guess I could play with that.   Also,  the current hostlua make process will need to be fixed.
« Last Edit: 20 / April / 2013, 11:43:23 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline reyalp

  • ******
  • 12156
Re: what is your Lua script writing environment like?
« Reply #24 on: 20 / April / 2013, 17:07:39 »
Did this ever go anywhere?  Currently the stuff in tools/hostlua  will not make - I think its having trouble with the math functions that rudi added recently.
Well apparently the attachment went somewhere, but other than that, no  :(

These days I tend to do interactive testing in chdkptp

I haven't looked at rudi's stuff, but it would be good to get hostlua working again in the default builds, and keep an up to date version of emu.lua in the source tree.
Don't forget what the H stands for.

*

Offline philmoz

  • *****
  • 3129
    • Photos
Re: what is your Lua script writing environment like?
« Reply #25 on: 20 / April / 2013, 18:27:00 »
Currently the stuff in tools/hostlua  will not make

It's working in trunk, revision 2713 should fix the release-1.1 version.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)

Re: what is your Lua script writing environment like?
« Reply #26 on: 20 / April / 2013, 18:27:19 »
Just started playing with Geany under Linux a bit.   Its got a Lua plugin and enough scripting capability that it should be possible to replicate what rudy did with Notepad++ under Windows.   And Geany is cross platform so it should work on Windows too.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: what is your Lua script writing environment like?
« Reply #27 on: 20 / April / 2013, 18:30:36 »
It's working in trunk, revision 2713 should fix the release-1.1 version.
Hmmmm ... I get
Code: [Select]
liblua.a(limathlib.o): In function `imath_sqrt':
/home/build/chdk/tools/hostlua/../../lib/lua/limathlib.c:181: undefined reference to `sqrt'
liblua.a(limathlib.o): In function `imath_pow':
/home/build/chdk/tools/hostlua/../../lib/lua/limathlib.c:175: undefined reference to `pow'
liblua.a(limathlib.o): In function `imath_log10':
/home/build/chdk/tools/hostlua/../../lib/lua/limathlib.c:170: undefined reference to `log10'
liblua.a(limathlib.o): In function `imath_log2':
/home/build/chdk/tools/hostlua/../../lib/lua/limathlib.c:165: undefined reference to `log2'
liblua.a(limathlib.o): In function `imath_log':
/home/build/chdk/tools/hostlua/../../lib/lua/limathlib.c:160: undefined reference to `log'
liblua.a(cordic_math.o): In function `cathetus':
/home/build/chdk/tools/hostlua/../../modules/cordic_math.c:126: undefined reference to `sqrt'
collect2: error: ld returned 1 exit status
make: *** [lua] Error 1
when I type "make"  in the tools/hostlua directory using svn rev 2713 of the trunk.
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline philmoz

  • *****
  • 3129
    • Photos
Re: what is your Lua script writing environment like?
« Reply #28 on: 20 / April / 2013, 18:53:28 »
It's working in trunk, revision 2713 should fix the release-1.1 version.
Hmmmm ... I get
Code: [Select]
liblua.a(limathlib.o): In function `imath_sqrt':
/home/build/chdk/tools/hostlua/../../lib/lua/limathlib.c:181: undefined reference to `sqrt'
liblua.a(limathlib.o): In function `imath_pow':
/home/build/chdk/tools/hostlua/../../lib/lua/limathlib.c:175: undefined reference to `pow'
liblua.a(limathlib.o): In function `imath_log10':
/home/build/chdk/tools/hostlua/../../lib/lua/limathlib.c:170: undefined reference to `log10'
liblua.a(limathlib.o): In function `imath_log2':
/home/build/chdk/tools/hostlua/../../lib/lua/limathlib.c:165: undefined reference to `log2'
liblua.a(limathlib.o): In function `imath_log':
/home/build/chdk/tools/hostlua/../../lib/lua/limathlib.c:160: undefined reference to `log'
liblua.a(cordic_math.o): In function `cathetus':
/home/build/chdk/tools/hostlua/../../modules/cordic_math.c:126: undefined reference to `sqrt'
collect2: error: ld returned 1 exit status
make: *** [lua] Error 1
when I type "make"  in the tools/hostlua directory using svn rev 2713 of the trunk.


It works on Windows and OSX.

I'm getting the same error on Linux using Hacki's toolchain so perhaps there's a problem with that.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)

Re: what is your Lua script writing environment like?
« Reply #29 on: 20 / April / 2013, 19:03:34 »
I'm getting the same error on Linux using Hacki's toolchain so perhaps there's a problem with that.
All the missing function are in lib/math/wrapper.c
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics