CHDK Forum

Using CHDK => Script Writing => Topic started by: PhyrePhoX on 17 / August / 2008, 16:01:28

Title: Scripts to be included in the autobuilds - need your help
Post by: PhyrePhoX on 17 / August / 2008, 16:01:28
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?
Title: Re: Scripts to be included in the autobuilds - need your help
Post by: fe50 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
Title: Re: Scripts to be included in the autobuilds - need your help
Post by: fbonomi 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...
Title: Re: Scripts to be included in the autobuilds - need your help
Post by: reyalp 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.
Title: Re: Scripts to be included in the autobuilds - need your help
Post by: PhyrePhoX 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 :)
Title: Re: Scripts to be included in the autobuilds - need your help
Post by: fbonomi 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".

Title: Re: Scripts to be included in the autobuilds - need your help
Post by: fudgey 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 (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.
Title: Re: Scripts to be included in the autobuilds - need your help
Post by: PhyrePhoX 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 :(
Title: Re: Scripts to be included in the autobuilds - need your help
Post by: fudgey 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.
Title: Re: Scripts to be included in the autobuilds - need your help
Post by: PhyrePhoX 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.
Title: Re: Scripts to be included in the autobuilds - need your help
Post by: c2thew on 06 / October / 2008, 01:42:41
The current scripts (i've been maintaining a few) should definitely be in the autobuilds as they cover the majority of the uses of chdk.

UBASIC/Scripts - CHDK Wiki (http://chdk.wikia.com/wiki/UBASIC/Scripts)

Current

Note to script authors and users. Try to make screenshots or post example pictures of your scripts in action.

Scripts recommended for use with Canon S5 IS and or Digic III processors

    * Ultra Intervalometer (best script)
    * HDR time lapse (Starts at 300 as default for pictures. Easier to understand in some respects than the Ultra Intervalometer. Someone needs to find a way to combine the 1st and 2nd scripts' user features as the 1st script doesn't show what's going on, rather just shoots. The second script tells you delay for 10 seconds so at least you know you're still taking a shot)
    * Multipurpose Motion (Sexy script. Could use for monitoring, or even photo shoots for banquets and such.)
    * Zoom Shoot! (Zoom takes a shot and so forth, not sure why you would want this script as slideshow programs allow you to zoom in on pictures....)
    * Long Exposure Intervalometer (Its purpose is for NIGHT shots. Takes long exposure shots continuously for applications such as night time time-lapse or to take image stacking shots for astrophotography.)
    * Lightning script -- fudgey (Lightning script which captures quick successions of light bursts.)
Title: Re: Scripts to be included in the autobuilds - need your help
Post by: PhyrePhoX on 19 / December / 2008, 04:23:05
so, please, i wanna add a best-of script pack to the autobuild before christmas, let's get this started :)
Title: Re: Scripts to be included in the autobuilds - need your help
Post by: c2thew on 13 / January / 2009, 22:51:13
thanks for updating the scripts in the auto build.  now everyone can experience the power of chdk
Title: Re: Scripts to be included in the autobuilds - need your help
Post by: barret on 09 / March / 2009, 10:52:03
Quote
thanks for updating the scripts in the auto build.  now everyone can experience the power of chdk
what do you mean? i can't see any scripts in the autobuild...
Title: Re: Scripts to be included in the autobuilds - need your help
Post by: whim on 09 / March / 2009, 11:07:47
@barret

then you probably haven't looked in the complete/full build ?

wim
Title: Re: Scripts to be included in the autobuilds - need your help
Post by: barret on 09 / March / 2009, 11:19:12
Quote
then you probably haven't looked in the complete/full build ?
i just downloaded autobuild for s3 and in scripts directory there are only examples and test directories which doesn't contain any of scripts mentioned above (like intervalometer or zoom shot).
so where are they?

and yes, i did download the complete build
Title: Re: Scripts to be included in the autobuilds - need your help
Post by: whim on 09 / March / 2009, 11:58:39
@barret

sorry about that, but hey, you did write

Quote
i can't see any scripts
  :D

wim

Title: Re: Scripts to be included in the autobuilds - need your help
Post by: barret on 10 / March / 2009, 04:23:17
true, true :D
what i meant was that i don't see any useful scripts :) apart from test scripts such as badpixel.lua.
Title: Re: Scripts to be included in the autobuilds - need your help
Post by: bugmenot on 10 / March / 2009, 05:13:21
they should include motion detection and all the cool bracketing and timelapse scripts
Title: Re: Scripts to be included in the autobuilds - need your help
Post by: aleij on 21 / March / 2009, 08:20:26
what happened to this initiative, im looking for a clean way to get stable and maintained scripts and cant find one easier than reading tons of pages from the forum.

i hope this idea was not dropped

/a
Title: Re: Scripts to be included in the autobuilds - need your help
Post by: Atnas on 04 / July / 2009, 18:28:21
Seems sad that this tread just dissapeared into thin air. What happened?
I would love to be able to download the latest version of allbest and know that it would include good MD and an intervalometer.

Please make this a reality.
Title: Re: Scripts to be included in the autobuilds - need your help
Post by: barret on 08 / July / 2009, 07:52:14
As I probably said before, intervalometer and rapid intervalometer is a must. MD would be nice too.

And temperature logging feature but I'm not sure where, in a script or in CHDK itself... maybe it would be possible to embed such feature in CHDK, for example: log temperature every time shutter is pressed (with every shot, for timelapse movies for example).
Title: Scripts to be included in the autobuilds - a simple 4 pack
Post by: waterwingz on 27 / September / 2011, 23:27:09
to the CHDK photographers out there :

This is an old thread and I know there have been many conversations since about what scripts to include in the autobuild.   To that end,  I propose adding the four simple scripts attached below. (Technically,  there are eight scripts as I've include a Lua and uBasic version of each of the four.)

I got the idea for this as I was trying to understand how to do simple things with scripting.  The wiki and forum are full of wonderful and complicated scripts, many of which don't work on all cameras and some of which only work on obsolete versions of CHDK.   So I spent some time trying to figure out what a minimum set of working scripts are and how simple should they  be.

The scripts attached are :

1) Delay shoot.
2) Simple Intervalometer.
3) Motion Detector
4) HDR  ( High Dynamic Range or bracketing)

So before I submit for consideration for inclusion in the build please take a look.   I know that they can all be improved by adding features to suit your needs.   That's the whole point.   Have I missed anything essential  and are they simple enough ?

TIA

Title: Re: Scripts to be included in the autobuilds - need your help
Post by: outslider on 01 / October / 2011, 16:51:02
If I may say something I suggest to include my Text Editor: http://chdk.setepontos.com/index.php?topic=6465.0 (http://chdk.setepontos.com/index.php?topic=6465.0)

I guess users found it usefull since it was downloaded 36 times. Unfortunetly almost not feedback was given.

 Also in a few older threads it was said, that it would be handy to edit scripts directly on camera.
Title: Re: Scripts to be included in the autobuilds - need your help
Post by: waterwingz on 01 / October / 2011, 17:06:16
If I may say something I suggest to include my Text Editor: http://chdk.setepontos.com/index.php?topic=6465.0 (http://chdk.setepontos.com/index.php?topic=6465.0)
I'd support that.

Quote
I guess users found it usefull since it was downloaded 36 times.
Well,  36 downloads might be more about curiousity than usefulness.

Quote
Unfortunetly almost not feedback was given.
That's the way it goes unless you did something seriously wrong.  A little feedback - you spelled height incorrectly on line 5 of the script.

Quote
Also in a few older threads it was said, that it would be handy to edit scripts directly on camera.
I'm going to keep it on my camera for those times I'm away from the computer.
Title: Re: Scripts to be included in the autobuilds - need your help
Post by: msl on 01 / October / 2011, 17:55:12
If I may say something I suggest to include my Text Editor

I think the complete package should be included only basic scripts.

The editor script is a very nice script, but also a complex script. It would be a better way when we make a advanced script package. In German forum we have a pocket calculator script. There is also a Script for writing & saving the CHDK configuration with language options (needs get/set_config_value()): http://forum.chdk-treff.de/download/file.php?id=1411 (http://forum.chdk-treff.de/download/file.php?id=1411)

msl
Title: Re: Scripts to be included in the autobuilds - need your help
Post by: waterwingz on 01 / October / 2011, 18:02:17
I think the complete package should be included only basic scripts.
I agree - I was not suggesting we add it to the four simple scripts.  But it could go into its own subdirectory called EDIT under the CHDK\SCRIPTS directory.

Quote
There is also a Script for writing & saving the CHDK configuration with language options (needs get/set_config_value()):
get/set_config_values() is now supported in the CHDK too.

update : typo fixed
Title: Re: Scripts to be included in the autobuilds - need your help
Post by: msl on 01 / October / 2011, 18:39:01
get/set_config_values() is not supported in the CHDK too.

And what is this: http://tools.assembla.com/chdk/changeset/1348/trunk (http://tools.assembla.com/chdk/changeset/1348/trunk)  ;)

msl
Title: Re: Scripts to be included in the autobuilds - need your help
Post by: waterwingz on 01 / October / 2011, 20:22:45
And what is this: http://tools.assembla.com/chdk/changeset/1348/trunk (http://tools.assembla.com/chdk/changeset/1348/trunk)  ;)
That would be the patch I submitted.  I fixed the typo in the earlier post.
Title: Re: Scripts to be included in the autobuilds - need your help
Post by: waterwingz on 01 / October / 2011, 23:41:29
If I may say something I suggest to include my Text Editor: http://chdk.setepontos.com/index.php?topic=6465.0 (http://chdk.setepontos.com/index.php?topic=6465.0)

@outslider :   I'll submit a patch file if you will change the code so that it does not have to be in /CHDK/SCRIPTS.  If it can go in /CHDK/SCRIPTS/EDITOR that would be okay.  It would be even better if it will run from any directory.


Title: Re: Scripts to be included in the autobuilds - need your help
Post by: outslider on 02 / October / 2011, 05:26:23
Sure;)

In fact editor can be placed everywhere, the file browser has to be in /CHDK/SCRIPTS or in lua libraries since it's included.

There are two possibilities:

- I can merge filebrws.lua and edi2.lua into single file, so that could run everywhere
- The edi2.lua file can be placed averywhere, and filebrws.lua goes to lua libraries.

I believe that the first is better. However, filebrowser could be usefull somehow for others. But at the moment I'll prepare merged script (with some improvements).

EDIT:
-ok, I changed the script. It's attached on thread: http://chdk.setepontos.com/index.php?topic=6465.msg68653#msg68653 (http://chdk.setepontos.com/index.php?topic=6465.msg68653#msg68653)