Talk:CHDK/uBASIC/Scripts

Discuss Your CHDK Scripts

 * How to write them
 * Help in how to write them
 * Better ways to post or share them
 * Etc.

Ultra Intervalometer Script
While posing my Ultr Intervalometer script just now, I started to wonder how it would work to use it for a single shot after a long delay, repeated endlessly. Since I was working off of the original sample scripts, I left in the test to never let the number of shots for each intervalometer sequence to be less than 2 (because that makes the simple intervalometer meaningless in that instance). But the more I think about it, since this script has the endless repeat thingy in it, should I change that to allow for single shots? Then you could set a delay to first shot and sequence it endlessly. Otherwise you'd have to use no delay, and crank up the number of shots really high to get an "endless" type of action.

I think I'll change that now. In the line "if c<2 then let c=5" to "if c<1 then let c=5".

I think it would make the script a little more flexible this way.

Yes? No? Let me know if I should change that back or not.

Also, I was thinking it would be good to have a count-down timer during the pause phase. But I wasn't sure how to go about implementing that in the :pause subroutine.

Would something like this work?

n=(a*60)+b for m=1 to n print "Interval Begins:", n/60; "min", @(n/60); "sec" sleep 1000 next m return

Someone help out here! :-) How do I use the "remainder" @ command in this stuff?

I can't believe I can't think this out, maybe I've been up too late.

Well, this works, but danged if I know how to divvy it up into minutes and seconds, this at least counts down by seconds:

n=(a*60)+b for m=1 to n print "Interval Begins:", n-m; "sec" sleep 1000 next m return

BUT, there's going to be a problem. If the delay time is longer than your Power Saving setting to shut off the display (MAX of 3 minutes), then the camera stops executing the script before the delay time is reached. I'll add that into the notes about it, until further notice on a work-around for that.