Okay, another script, this time a bit more practical one: it shoots a photo and then another one using the same exposure settings with shutter closed to get a dark frame.
It seems to work for me on a570 (native calls enabled, of course) and it should work on many others but I really don't know which unless someone tests it or runs batch fw analysis. I made a simple guess (likely incorrect) that all vxworks cameras use one method and all dryos another one. No harm should be done to the camera by the script if that assumption ends up being incorrect. If it doesn't work for you, use e.g. my previous script to debug.
Notes from the script text:
Shoots a RAW photo and a RAW dark frame.
The dark frame will be shot using the same exposure parameters as the actual
photo, but it is not shot using Canon's automatic dark frame feature (instead,
a second photo is taken -- therefore you also get a useless(?) JPEG of the
dark frame).
The photo will use whatever exposure parameters the camera would normally
use without the script, i.e. Canon's manual exposure or autoexposure and CHDK
exposure overrides should work as expected if they are active. Focus shouldn't
make a difference if the mehcanical shutter is between lens and sensor. Similarly
ND filter state shouldn't affect results.
The script requires native calls to be enabled in your CHDK build. They are not
enabled in CHDK autobuilds by default. Set OPT_LUA_CALL_NATIVE=1 in builconf.inc
and rebuild to enable them.
The script assumes all vxworks cameras to have InitializeAdjustmentFunction
eventproc, and it to register CloseMShutter eventproc. For dryos, it assumes
Mecha.Create eventproc to register CloseMechaShutter eventproc. If neither is not
true for your camera, the script will fail to work. It will most likely either
exit due to an error before shooting, or warn about the shutter close command
and shoot two normal RAW+JPG photos instead of a photo + dark frame pair.