set_backlight(0) turns off the backlight. Unfortunately, the camera keeps turning it back on with every picture.
My solution is to replace all calls to sleep(time) with calls to sleeper(time). Then, pressing the "set" button will toggle the backlight off and on. Pressing the "menu" key sets a variable "doexit" true, which can be used to exit the main loop.
This script demonstrates the sleeper(time) function. It simply holds the "shoot_full" button down. If you put the camera in continuous drive mode, and set the full manual exposure and manual focus before starting the script, you have the fastest time lapse program possible. It should be useful for taking continuous long exposures at night with dark frame off for capturing meteors. Be sure to turn off "safety manual focus" in the Canon record menu, and set the review time to 0.
You can run the script in auto exposure and focus mode. It will set the exposure/focus on the first picture, and hold these values for the entire sequence. There's also a continuous drive option with focusing for each shot on my sx260.
@title Continuous Shooter
-- sleeper starts here
setd=false -- true=set button down
bldark=false -- true=backlight off
doexit=false -- true=pressed menu button
etime=get_tick_count()+stime -- end tick time
if(is_pressed("menu"))then doexit=true end-- menu press used to exit script
sleep(20) -- return with short delay for a quicker script exit
if(setd~=is_pressed("set"))then -- set button toggled
if(bldark)then set_backlight(1) end -- turn on light once
bldark=not bldark -- true if light on
if(bldark)then set_backlight(0) end -- turn off light repeatedly
if(stime>=50)then sleep(20) end
if(stime>0)then sleep(stime) end
I saved this file with the name "CShooter.lua" (see below)