Is there a way to alter script to turn all days on by default rather than off for DOW. This is typically not an issue with how I use the script. Thank you so much for your work on this script!
rem Author SkyWalker9@title Selective Intervalometer@param a Number of Shots@default a 10@param e Interval (mins)@default e 5@param f Interval (secs)@default f 0@param p Starting Hour (24 Hr)@default p 7@param q Starting Minute @default q 0@param r Ending Hour (24 Hr)@default r 18@param s Ending Minute@default s 0rem Check input variables for proper values if a<0 then a=2 if e<0 then e=0 if f<0 then f=0 if p<0 then p=0 if p>23 then p=23 if q<0 then q=0 if q>59 then q=59 if r<0 then r=0 if r>23 then r=23 if s<0 then s=0 if s>59 then s=59 J=0rem Calculate user specified cycle/interval time in ms d=(e*600+f*10)*100 if d<1 then d=1rem Next two statements combine "hour" and "minutes" (hour:11 minute:30 = 1130)rem This reduces the number of "if" statements required in "check_time" subroutine P=p*100+q R=r*100+srem Print Error message if Start Time is after End Time print msg & exit if r>=p then goto "ok1" print "START Time after END" end:ok1rem this section selects each day of week (DOW) & packs the DOWs into the single variable Lrem This sets DOW to ALL (every day of the week) L=1234*1000+567 cls print "Every Day of Week?" print "Left=No Right=Yes":sel_again wait_click is_key k "left" if k=1 then goto "sel_DOW" is_key k "right" if k=1 then goto "sel_fini" goto "sel_again" :sel_DOW L=0 for i = 1 to 7 cls print "Left=No Right=Yes" print "Set when done" select i case 1; print "Sun: No" case 2; print "Mon: No" case 3; print "Tue: No" case 4; print "Wed: No" case 5; print "Thu: No" case 6; print "Fri: No" case 7; print "Sat: No" end_select print " " K=0 gosub "sel_choose" if K=0 then goto "sel_off" L=L*10+i:sel_off next i goto "sel_fini"rem This subroutine lets user decide which Days of the week to use in scriptrem option K 0=No 1=Yes:sel_choose wait_click is_key k "left" if k=1 then let K=0 is_key k "right" if k=1 then let K=1 is_key k "set" if k=1 then goto "sel_exit" cls print "Left=No Right=Yes" print "Set when done" if K<>0 then goto "sel_opt_on" select i case 1; print "Sun: No" case 2; print "Mon: No" case 3; print "Tue: No" case 4; print "Wed: No" case 5; print "Thu: No" case 6; print "Fri: No" case 7; print "Sat: No" end_select goto "sel_redo":sel_opt_on select i case 1; print "Sun: Yes" case 2; print "Mon: Yes" case 3; print "Tue: Yes" case 4; print "Wed: Yes" case 5; print "Thu: Yes" case 6; print "Fri: Yes" case 7; print "Sat: Yes" end_select:sel_redo print " " goto "sel_choose":sel_exit return:sel_finiif a<>0 then goto "bypass1":v2_exit cls print "Left(-) Right(+)" print "Set when done" print "Number of days: "J print " " wait_click is_key k "left" if k=1 then let J=J-1 is_key k "right" if k=1 then let J=J+1 is_key k "set" if k=1 then goto "bypass1" if J<0 then let J=0 goto "v2_exit":bypass1 clsrem Print a Caution message if Image Stabilization (IS) is enabled x=get_IS_mode if x<>3 then print "Caution: IS enabled"rem Displays the disk space/free disk space in MB & percent x=get_disk_size x=x/1000 y=get_free_disk_space y=y/1000 z=(y*100)/x print "Free Space "y"MB ("z"%)" print " " rem Built in delay of 1000 ms to allow camera vibrations to stop plus 1000 msrem to temporaily display the Caution msg if needed. sleep 2000rem Calculate length of total time period (1 min=60K "ticks"). This is done torem allow use of "tick_count" instead of "sleep" statements. This results in morerem consistent/dependable/accurate interval cycles. N=((r*60+s)-(p*60+q))*60000rem This calculation corrects the length of time period above if the user startsrem the script during the DOWs & Start/End range they have selected O=N x=L gosub "dayofweek":test_DOW1 K=(x%10)-1 if w=K then goto "change" x=x/10 if x<1 then goto "ok3" goto "test_DOW1":change F=get_time 2 Q=get_time 1 x=F*100+Q if x>=P and x<R then O=((r*60+s)-(F*60+Q))*60000:ok3rem Initializes shot counter; script shutdown camera when n=a in the "take_shots" section n=1rem if Number of Days J<>0 then use Number of Days method; V counts up to J if J=0 then goto "bypass" gosub "dayofweek" Y=get_time 5 I=Y-2000 H=D G=M v=w V=1:bypassrem -- Do not add comments after this point --- cls if J=0 then print a" Shots at "e"m "f"s" else print G"/"H"/"I" +"J-1" days "e"m "f"s" print "S M T W T F S" print "1 2 3 4 5 6 7: "L print "Hours "p":"q"-"r":"s print "Waiting..." :check_day gosub "dayofweek" x=L if J=0 then goto "test_DOW2" if w=v then goto "test_DOW2" V=V+1 if V>J then shut_down v=w :test_DOW2 K=(x%10)-1 if w=K then goto "check_time" x=x/10 if x<1 then goto "check_day" goto "test_DOW2":check_time F=get_time 2 Q=get_time 1 F=F*100+Q if F>=P and F<R then goto "take_shots" goto "check_day":take_shots i=get_tick_count i=i+O:more b=get_tick_count x=get_time 2 y=get_time 1 z=get_time 0 shoot sleep 600 W=w gosub "info" if n=a and J=0 then shut_down n=n+1 S=b+d:wait_loop b=get_tick_count if b<S then goto "wait_loop" if b<i then goto "more" O=N if V=J then v=W+1 goto "check_day":dayofweek D=get_time 3 M=get_time 4 Y=get_time 5 A = (14-M)/12 Y = Y-A M = M+12*A-2 w = (D+Y+(Y/4)-(Y/100)+(Y/400)+(31*M/12))%7 return:info cls if J=0 then print a" Shots at "e"m "f"s" else print G"/"H"/"I" +"J-1" days "e"m "f"s" print "S M T W T F S" print "1 2 3 4 5 6 7: "L print "Hours "p":"q"-"r":"s select W case 0; print "Last:"n" Sun "x":"y":"z case 1; print "Last:"n" Mon "x":"y":"z case 2; print "Last:"n" Tue "x":"y":"z case 3; print "Last:"n" Wed "x":"y":"z case 4; print "Last:"n" Thu "x":"y":"z case 5; print "Last:"n" Fri "x":"y":"z case 6; print "Last:"n" Sat "x":"y":"z end_select return end
rem Author SkyWalker9@title Selective Intervalometer@param a Number of Shots@default a 10@param e Interval (mins)@default e 5@param f Interval (secs)@default f 0@param p Starting Hour (24 Hr)@default p 7@param q Starting Minute @default q 0@param r Ending Hour (24 Hr)@default r 18@param s Ending Minute@default s 0rem Check input variables for proper values if a<0 then a=2 if e<0 then e=0 if f<0 then f=0 if p<0 then p=0 if p>23 then p=23 if q<0 then q=0 if q>59 then q=59 if r<0 then r=0 if r>23 then r=23 if s<0 then s=0 if s>59 then s=59 J=0rem Calculate user specified cycle/interval time in ms d=(e*600+f*10)*100 if d<1 then d=1rem Next two statements combine "hour" and "minutes" (hour:11 minute:30 = 1130)rem This reduces the number of "if" statements required in "check_time" subroutine P=p*100+q R=r*100+srem Print Error message if Start Time is after End Time print msg & exit if r>=p then goto "ok1" print "START Time after END" end:ok1rem this section selects each day of week (DOW) & packs the DOWs into the single variable Lrem This sets DOW to ALL (every day of the week) L=1234*1000+567 cls print "Every Day of Week?" print "Left=No Right=Yes":sel_again wait_click is_key k "left" if k=1 then goto "sel_DOW" is_key k "right" if k=1 then goto "sel_fini" goto "sel_again":sel_DOW L=0 for i = 1 to 7 cls print "Left=No Right=Yes" select i case 1; print "Sunday?" case 2; print "Monday?" case 3; print "Tueday?" case 4; print "Wednesday?" case 5; print "Thusday?" case 6; print "Friday?" case 7; print "Saturday?" end_select print " " K=9:sel_choose wait_click is_key k "left" if k=1 then let K=0 is_key k "right" if k=1 then let K=1 if K=9 then goto "sel_choose" if K=0 then goto "sel_off" L=L*10+i:sel_off next i:sel_finiif a<>0 then goto "bypass1":v2_exit cls print "Left(-) Right(+)" print "Set when done" print "Number of days: "J print " " wait_click is_key k "left" if k=1 then let J=J-1 is_key k "right" if k=1 then let J=J+1 is_key k "set" if k=1 then goto "bypass1" if J<0 then let J=0 goto "v2_exit":bypass1 clsrem Print a Caution message if Image Stabilization (IS) is enabled x=get_IS_mode if x<>3 then print "Caution: IS enabled"rem Displays the disk space/free disk space in MB & percent x=get_disk_size x=x/1000 y=get_free_disk_space y=y/1000 z=(y*100)/x print "Free Space "y"MB ("z"%)" print " " rem Built in delay of 1000 ms to allow camera vibrations to stop plus 1000 msrem to temporaily display the Caution msg if needed. sleep 2000rem Calculate length of total time period (1 min=60K "ticks"). This is done torem allow use of "tick_count" instead of "sleep" statements. This results in morerem consistent/dependable/accurate interval cycles. N=((r*60+s)-(p*60+q))*60000rem This calculation corrects the length of time period above if the user startsrem the script during the DOWs & Start/End range they have selected O=N x=L gosub "dayofweek":test_DOW1 K=(x%10)-1 if w=K then goto "change" x=x/10 if x<1 then goto "ok3" goto "test_DOW1":change F=get_time 2 Q=get_time 1 x=F*100+Q if x>=P and x<R then O=((r*60+s)-(F*60+Q))*60000:ok3rem Initializes shot counter; script shutdown camera when n=a in the "take_shots" section n=1rem if Number of Days J<>0 then use Number of Days method; V counts up to J if J=0 then goto "bypass" gosub "dayofweek" Y=get_time 5 I=Y-2000 H=D G=M v=w V=1:bypassrem -- Do not add comments after this point --- cls if J=0 then print a" Shots at "e"m "f"s" else print G"/"H"/"I" +"J-1" days "e"m "f"s" print "S M T W T F S" print "1 2 3 4 5 6 7: "L print "Hours "p":"q"-"r":"s print "Waiting..." :check_day gosub "dayofweek" x=L if J=0 then goto "test_DOW2" if w=v then goto "test_DOW2" V=V+1 if V>J then shut_down v=w :test_DOW2 K=(x%10)-1 if w=K then goto "check_time" x=x/10 if x<1 then goto "check_day" goto "test_DOW2":check_time F=get_time 2 Q=get_time 1 F=F*100+Q if F>=P and F<R then goto "take_shots" goto "check_day":take_shots i=get_tick_count i=i+O:more b=get_tick_count x=get_time 2 y=get_time 1 z=get_time 0 shoot sleep 600 W=w gosub "info" if n=a and J=0 then shut_down n=n+1 S=b+d:wait_loop b=get_tick_count if b<S then goto "wait_loop" if b<i then goto "more" O=N if V=J then v=W+1 goto "check_day":dayofweek D=get_time 3 M=get_time 4 Y=get_time 5 A = (14-M)/12 Y = Y-A M = M+12*A-2 w = (D+Y+(Y/4)-(Y/100)+(Y/400)+(31*M/12))%7 return:info cls if J=0 then print a" Shots at "e"m "f"s" else print G"/"H"/"I" +"J-1" days "e"m "f"s" print "S M T W T F S" print "1 2 3 4 5 6 7: "L print "Hours "p":"q"-"r":"s select W case 0; print "Last:"n" Sun "x":"y":"z case 1; print "Last:"n" Mon "x":"y":"z case 2; print "Last:"n" Tue "x":"y":"z case 3; print "Last:"n" Wed "x":"y":"z case 4; print "Last:"n" Thu "x":"y":"z case 5; print "Last:"n" Fri "x":"y":"z case 6; print "Last:"n" Sat "x":"y":"z end_select return end
Quote from: peterparker on 12 / September / 2011, 14:59:14...is it possible to set different timeperiods depending on the day? e.g.: take a photo every 15s Tuesdays from 8PM to 11PM and Saturdays from 11AM to 23:59PM...I am new to CHDK, haven't used it yet. So please be indulgent towards me, if it's a bad question...First off, this is certainly NOT a bad question. Unfortunately, this script (as written) cannot do what you ask. It would require modifying the initial parameter section and involve some careful program changes to make it work as you want -- but I have an idea what needs to be changed.I don't have a lot of free time right now, but this is DEFINITELY something I'll try when I get a chance - I think it could be very useful.
...is it possible to set different timeperiods depending on the day? e.g.: take a photo every 15s Tuesdays from 8PM to 11PM and Saturdays from 11AM to 23:59PM...I am new to CHDK, haven't used it yet. So please be indulgent towards me, if it's a bad question...
Quote from: SkyWalker9 on 12 / September / 2011, 21:47:59Quote from: peterparker on 12 / September / 2011, 14:59:14...is it possible to set different timeperiods depending on the day? e.g.: take a photo every 15s Tuesdays from 8PM to 11PM and Saturdays from 11AM to 23:59PM...I am new to CHDK, haven't used it yet. So please be indulgent towards me, if it's a bad question...First off, this is certainly NOT a bad question. Unfortunately, this script (as written) cannot do what you ask. It would require modifying the initial parameter section and involve some careful program changes to make it work as you want -- but I have an idea what needs to be changed.I don't have a lot of free time right now, but this is DEFINITELY something I'll try when I get a chance - I think it could be very useful....any news? did you try it already?
Is it easier if I don't need a selection-option?
"...when the intervalometer is running, the camera turns of after some minutes. The camera have a power supply. I try to change the LCD off to secript, never, etc... but always turn off. The camera is a Sx 130 IS
Started by vteds « 1 2 3 4 » Feature Requests
Started by Mlapse « 1 2 » Feature Requests
Started by pigeonhill « 1 2 » General Help and Assistance on using CHDK stable releases
Started by vincasr « 1 2 ... 6 7 » Script Writing
Started by Mlapse « 1 2 3 4 » General Help and Assistance on using CHDK stable releases