180 shots at 1m 15s S M T W T F S 1 2 3 4 5 6 7: 145 Hours (11:30-11:40) Waiting...
180 shots at 1m 15s S M T W T F S 1 2 3 4 5 6 7: 145 Hours (11:30-11:40) Last: 8 Sun at 11:40:0
rem Author SkyWalker9@title Selective Intervalometer@param a Number of Shots@default a 180@param e Interval (mins)@default e 5@param f Interval (secs)@default f 0@param p Starting Hour (24 Hr time)@default p 7@param q Starting Minute @default q 0@param r Ending Hour (24 Hr time)@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=59rem 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 Print message if Start Day of Week is after End Day of Week print msg & exit if v>=u then goto "ok2" print "START DOW after END" end:ok2rem this section selects each day of week (DOW) & packs the DOWs into the single variable L 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 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 10000 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 goto "sel_choose":sel_exit cls return:sel_finirem 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"%)"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 -- Do not add comments after this point --- print a" Shots at "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: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 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 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 print a" Shots at "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
Left=No Right=Yes Left(-) Right(+) Set when done Set when done Sun: No Number of days: 14 Entering DOWs Entering Number of days
180 shots at 1m 15s 2/14/11 +11 1m 15s S M T W T F S S M T W T F S 1 2 3 4 5 6 7: 145 1 2 3 4 5 6 7: 145 Hours (11:30-11:40) Hours (11:30-11:40) Waiting... Waiting... Using #Shots Using Number of days (#Shots set to 0)
180 shots at 1m 15s 2/14/11 +11 1m 15s S M T W T F S S M T W T F S 1 2 3 4 5 6 7: 145 1 2 3 4 5 6 7: 145 Hours (11:30-11:40) Hours (11:30-11:40) Last: 8 Sun at 11:40:0 Last: 8 Sun at 11:40:0 Using #Shots Using Number of days (#Shots set to 0)
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 L 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 10000 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 10000 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
I tried editing the script to remove the days of week check and just set L=1234567 but it locks up when I start the script.
I also added this to the end of the :info subroutine y=get_free_disk_space if y<5000 then shut_down
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