Scripts to be included in the autobuilds - need your help - Script Writing - CHDK Forum

Scripts to be included in the autobuilds - need your help

  • 30 Replies
  • 27075 Views
*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Scripts to be included in the autobuilds - need your help
« on: 17 / August / 2008, 16:01:28 »
Advertisements
Hi,

long story short:

I'd like to add scripts to the autobuilt "juciphox" full zip archive (subsequently also into the trunk, as soon as we merge), so people don't have to search the wiki or the forum for a "first start" anymore. My mission always was to have "universal" scripts, meaning: scripts that should run on ALL cameras without having to modify them first (so comments like "change this propcase on digic III" or "on ixus, replace with xyz" become obsolete) - thats why i added all these new ubasic commands (which jucifer translated to lua as well).

Do we already have scripts that can be called "universal"? What has to be done to have universal scripts, as universal as universal can be? Do we need more ubasic/lua commands? More propcases (i know of a few digic II propcases that havent been found on digic III yet!).

Please propose scripts to be added to the autobuild, with descriptive names.
If we cannot achieve "true" universal scripts in each category (i.e. intervalometer, bracketing, etc) i can maybe edit the makefile to zip certain scripts into specific camera's zips - for example S-series (which have additional video button) maybe need other scripts than non-s-series.

Alright folks, let's wrap this request up: I need you, your suggestions, hints & scripts.
If we can deliver an autobuild with completed and working scripts, this would be a huge increase of usability of CHDK, right?

i am not the ubasic/lua guy, so i cant really help coding scripts, i can only add ubasic commands if you tell me what you need.

thanks in advance, PhoX

P.S: Since we have the 8 character name limitation, i plan to include additional folders into the zip:

chdk/scripts/examples (code examples, readme with ubasic manual and stuff)
../../intervalometer
../../bracketing
../../games (well, we should be able to code games in script, shouldnt we?)
and so on.

maybe also an extra lua dir?

*

Offline fe50

  • ******
  • 3152
  • IXUS50 & 860, SX10 Star WARs-Star RAWs
    • fe50
Re: Scripts to be included in the autobuilds - need your help
« Reply #1 on: 17 / August / 2008, 18:11:05 »
Hi Phox,

Quote
maybe also an extra lua dir?
YES, unbedingt  :)

We will also get LUA libraries for universal usage in the future - i started collecting all my LUA snippets like date / time functions, someday we can publish such libs with the build, scripting with LUA is so nice, yeah !

...you can also write the same 100+ lines in all of your uBASIC scripts, again and again, but 2 lines in LUA like

  require "mylib"
  runMyFunc()

are a bit smarter for lazy people like me  :haha

*

Offline fbonomi

  • ****
  • 469
  • A570IS SD1100/Ixus80
    • Francesco Bonomi
Re: Scripts to be included in the autobuilds - need your help
« Reply #2 on: 17 / August / 2008, 18:50:13 »
PhyrePhox,

this is a very good idea, but some scripts are constantly changing, the maintenance could be very hard.

but I must say you are very good at this :-)

Anyway, a centralized library of scripts would be very useful for end users.

On the other hand, a a shared library of functions/snippets would be very useful for scripters, but in this acse the Wiki format  is probably better, as it's more easy to divide and catalog snippets.

The size of this uber-library could also be a problem: if all the functions are in a single file, that would be huge.  (I am already forced to use require because of limitations in script size !!)

So, for LUA script I suggest:
1) for end users, a library of packaged scripts, each one with its libraries. ZIPPED in the distro
2) for developers, a shared pool of functions in the Wiki

I am curious to know the opinion of other developers...

*

Offline reyalp

  • ******
  • 14128
Re: Scripts to be included in the autobuilds - need your help
« Reply #3 on: 17 / August / 2008, 20:02:57 »
The size of this uber-library could also be a problem: if all the functions are in a single file, that would be huge.  (I am already forced to use require because of limitations in script size !!)

So, for LUA script I suggest:
1) for end users, a library of packaged scripts, each one with its libraries. ZIPPED in the distro
2) for developers, a shared pool of functions in the Wiki

I would suggest more smaller modules for the 'library', rather than one big one. Disk space is essentially a non-issue (I doubt the total of all scripts ever written for chdk amounts to one camera jpeg) but runtime memory is quite restricted. Having to "require" multiple packages is not a big deal.

As for what should be included, a decent intervalometer and MD would be my top picks. Bracketing can mostly be done without resorting to script, but maybe there's some techniques that are better done with script ?

You don't need to include everything under the sun. I think users would be better served by a couple good example of each general task rather than everything that's ever been written. This is especially true when the scripts need to be maintained to follow updates in CHDK. You can always include more in an "extras" directory or provide links, but IMO the ones that come pre-installed should be a relatively select few that are maintained and known to be working.

I'd say that the "official" scripts and script libraries should be in an SVN repo, and the authors should have commit access.
Don't forget what the H stands for.

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: Scripts to be included in the autobuilds - need your help
« Reply #4 on: 18 / August / 2008, 05:28:05 »
Hi Phox,

Quote
maybe also an extra lua dir?
YES, unbedingt  :)

We will also get LUA libraries for universal usage in the future - i started collecting all my LUA snippets like date / time functions, someday we can publish such libs with the build, scripting with LUA is so nice, yeah !

...you can also write the same 100+ lines in all of your uBASIC scripts, again and again, but 2 lines in LUA like

  require "mylib"
  runMyFunc()

are a bit smarter for lazy people like me  :haha


Okay, so extra LUA directory it is then.
Snippets would be extremely useful by the time we have a virtual keyboard - you would have examples and documented code/snippets in the "extra/examples" folder - even when on the road you could write useful scripts then (without internet access, and even when you have internet access - sometimes browsing the wiki is hard, so having ready-to-use examples on the sdcard would rock). I don't know about these Lua libs so i really don't know how much effort can and should be put into these. i only know that ubasic isnt that hard to maintain :)


PhyrePhox,

this is a very good idea, but some scripts are constantly changing, the maintenance could be very hard.

but I must say you are very good at this :-)

Anyway, a centralized library of scripts would be very useful for end users.

On the other hand, a a shared library of functions/snippets would be very useful for scripters, but in this acse the Wiki format  is probably better, as it's more easy to divide and catalog snippets.

The size of this uber-library could also be a problem: if all the functions are in a single file, that would be huge.  (I am already forced to use require because of limitations in script size !!)

So, for LUA script I suggest:
1) for end users, a library of packaged scripts, each one with its libraries. ZIPPED in the distro
2) for developers, a shared pool of functions in the Wiki

I am curious to know the opinion of other developers...


hm, some scripts maybe constantly change, but other scripts dont. And even if they change - updating svn is just a matter of seconds.
what do you mean by ZIPPED in the distro for endusers? you mean an extra zip IN the zip? would be hard extracting the archive on the road ;) but maybe i just didnt understand you correctly here.
i concurr about the wiki, it has to be expanded.
What else do we need, more functions? for example: do we have a lua/ubasic command that returns the state of playback/record switch of the cam? if not, i can do that. Would be great having scripts that start with "Hey you fool, this script has to be run in record mode" or something like that.

The size of this uber-library could also be a problem: if all the functions are in a single file, that would be huge.  (I am already forced to use require because of limitations in script size !!)

So, for LUA script I suggest:
1) for end users, a library of packaged scripts, each one with its libraries. ZIPPED in the distro
2) for developers, a shared pool of functions in the Wiki

I would suggest more smaller modules for the 'library', rather than one big one. Disk space is essentially a non-issue (I doubt the total of all scripts ever written for chdk amounts to one camera jpeg) but runtime memory is quite restricted. Having to "require" multiple packages is not a big deal.

As for what should be included, a decent intervalometer and MD would be my top picks. Bracketing can mostly be done without resorting to script, but maybe there's some techniques that are better done with script ?

You don't need to include everything under the sun. I think users would be better served by a couple good example of each general task rather than everything that's ever been written. This is especially true when the scripts need to be maintained to follow updates in CHDK. You can always include more in an "extras" directory or provide links, but IMO the ones that come pre-installed should be a relatively select few that are maintained and known to be working.

I'd say that the "official" scripts and script libraries should be in an SVN repo, and the authors should have commit access.

yeah the total number of "decent" scripts isnt that big. Maybe we even can build a script that can handle ALL cases (we may have to change chdk). Also, our efforts integrating an intervalometer and/or MD directly into chdk shouldnt stop as well.
The scripts should of course get into the svn, and the authors should be granted access - i'm sure grand will shell out the rights if you apply for them (and you arent a "noname" in the forum and known to be a sane person :D).
my goal is more or less to have the "universal" aspect in it (run the same script on every cam, everywhere). it would HOPEFULLY also decrease the amount of "new user questions" in the forum (which we can handle for sure, but i'd rather have satisfied "customers" in the first place :D).
Should the scripts be multilingual (i.e. one script that kind of asks the LANG var - which would have to be written in CHDK first) or just translated by the people (and put into the right directory). Size isnt an issue here.
Thanks for the responses so far, folks :)

*

Offline fbonomi

  • ****
  • 469
  • A570IS SD1100/Ixus80
    • Francesco Bonomi
Re: Scripts to be included in the autobuilds - need your help
« Reply #5 on: 19 / August / 2008, 10:14:57 »
what do you mean by ZIPPED in the distro for endusers? you mean an extra zip IN the zip?

Sorry for being unclear :-)
I just meant "included in the distribution".


*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: Scripts to be included in the autobuilds - need your help
« Reply #6 on: 15 / September / 2008, 13:10:15 »
I universalized the MDFB script a bit, down to 2 versions using these wonderful new commands:
http://chdk.setepontos.com/index.php/topic,471.msg21328.html#msg21328.

Also it of course needs to be tested on different cameras before it's ready to be bundled with builds.

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: Scripts to be included in the autobuilds - need your help
« Reply #7 on: 15 / September / 2008, 14:50:31 »
you know there is a command to find out if the cam has a video button? i guess this way you could make only 1 script :)
and isnt it better to use like get_ready instead of using get_propset? i added get_propset for these cases that people find propset that i didnt include with special get_ commands yet. on the other hand, i havent really looked @ your script yet, no time yet :(

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: Scripts to be included in the autobuilds - need your help
« Reply #8 on: 15 / September / 2008, 15:13:57 »
you know there is a command to find out if the cam has a video button? i guess this way you could make only 1 script :)
and isnt it better to use like get_ready instead of using get_propset? i added get_propset for these cases that people find propset that i didnt include with special get_ commands yet. on the other hand, i havent really looked @ your script yet, no time yet :(

Yes I'm using get_shooting and get_video_button, but the latter doesn't help all the way as I wrote in the fine print just for you in the MDFB thread. In short, a script can't hide it's parameters at will.

I assume you mean get_shooting with "get_ready". Yes, using get_shooting is way better than with get_propset as it's just one command and thus just as fast as get_prop. And it's a drop-in replacement for replacing get_prop 205/206 in existing scripts, causing no change in operation.

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: Scripts to be included in the autobuilds - need your help
« Reply #9 on: 15 / September / 2008, 15:34:58 »
damnit, didnt read the fineprint. should have listened to my parents more often - ALWAYS read the fineprint!
i could - via the makefile - have the zips include scripts for specific camera models. so we could have different scripts. hm.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal