Utilities #1 (a collection of mini-scripts) - page 2 - Completed and Working Scripts - CHDK Forum

Utilities #1 (a collection of mini-scripts)

  • 20 Replies
  • 13249 Views
*

Offline SkyWalker9

  • ****
  • 301
  • SX20 IS (fw 1.02b)
Re: Utilities #2 update (a collection of mini-scripts)
« Reply #10 on: 08 / March / 2011, 19:16:53 »
Advertisements
Code: [Select]
:option2
  if c<=0 then c=1
  if b=0 then b=999999
  e=get_vbatt
  g=get_zoom_steps
  g=g-2
  n=1
  cls
  print "Resetting zoom"
  print " "
:repeat
  set_zoom 1
  gosub "save_shotnum"
  set_zoom g
  gosub "save_shotnum"
  goto "repeat"
:save_shotnum
  sleep 1000
  z=get_time 0
  y=get_time 1
  x=get_time 2
  m=get_time 3
  o=get_time 4
  p=get_time 5
  shoot
  sleep 600
  f=get_vbatt
  cls
  print_screen c
    print "Date: "m"/"o"/"p
    print "Time: "x":"y":"z
    print " "
    print "Shot number:", n
    print "Batt start: "e" mv"
    print "Batt   now: "f" mv"
  print_screen 0
  if c<1000 then c=c+1000 else c=c-1000
  n=n+1
  if n>b then goto "done"
  return

:option3
rem ** Caution ** Caution ** Caution ** Caution ** Caution ** Caution ** Caution **
rem This option has the ability to shoot non-stop; once started will run until the
rem camera runs out of space for photos or until the battery power is no longer
rem sufficient to continue.
rem ** Caution ** Caution ** Caution ** Caution ** Caution ** Caution ** Caution **
  if b<=0 then b=999999
  if c<0 then c=0
  if c>59 then c=59
  if d<0 then d=0
  if d>59 then d=59
  if e<0 then e=0
  if e>23 then e=23
  if f<0 then f=0
  if f>59 then f=59
  P=e*100+f
  D=(c*600+d*10)*100
  if D<1 then D=1
  sleep 1000
  n=1
  cls
  if b<>999999 then print "Number of shots: "b
  print "Start Time: "e":"f
  print "Intervals: "c"min "d"sec"
  print " "
  print "Waiting for Start Time..."
:check_time
  F=get_time 2
  Q=get_time 1
  F=F*100+Q
  if F>=P then goto "shot_loop"
  goto "check_time"
:shot_loop
    B=get_tick_count
    shoot
    sleep 600
    n=n+1
    if n>a then goto "done"
    cls
    if b<>999999 then print "Next shot: "n" of "b else print "Next shot: "n
    print "Intervals: "c"min "d"sec"
    print " "
    S=B+D
:wait_loop
    B=get_tick_count
    if B<S then goto "wait_loop"
    goto "shot_loop"
  
:done
end
<Part 3 of 3 - append to last section of code>
« Last Edit: 08 / March / 2011, 19:30:00 by SkyWalker9 »

*

Offline SkyWalker9

  • ****
  • 301
  • SX20 IS (fw 1.02b)
Re: Utilities #3 Updated (a collection of mini-scripts)
« Reply #11 on: 15 / March / 2011, 21:00:14 »
Utilities #3 Updated - added 2APEX

This is the third in the series of mini-scripts.
1CntDwn:2APEX:       :    (     1)
Seconds:Save :       :    (     0)
#Shots :     :       :    (     0)
IntMin :     :       :    (     0)
IntSec :     :       :    (     0)
Reverse:     :       :    (     0)
.      :     :       :    (     0)


Like the last time , each mini-script is identified by the first parameter line and the mini-script is chosen by the number in the name of the min-script. If there are parameters for that mini-script, they are shown in the column just below the mini-script name.

Utility mini-scripts

1CntDwn. This mini-script has a large pseudo-font countdown display timer for taking a series of pictures and was first included in Utility #2. Since then the script has been upgraded to overcome the reverse display problems when using an articulating display in the facing forward position. Because it was necessary to add more lines/characters to the original mini-script, I needed to put it in a different Utility, so this one was created - I'll add more mini-scripts as they are created.

There are now five parameters: Seconds, #Shots, IntMin, IntSec and Reverse. "Seconds" is the amount countdown seconds to display (1-10). The "#Shots" is the number of photos to shoot in the series.  The "IntMin" and "IntSec" is the amount between each countdown sequence (between shots) and allows the photographer time to setup the next shot.

I originally wrote this script so that I could use it on an SX20 which has an articulating display. Since CHDK doesn't display properly on the LCD when facing forward I had to design a way to display the countdown pseudo-font numbers in reverse and to the far right side of the normal CHDK script window. The "Reverse" parameter is set to 1 to use the articulating display facing forward - anything other than 1 will assume the display is not being used in the facing forward position.

In normal use (non-Reverse) the display is handy when taking group photos and experimenting with creating "cloning" photos. In addition to the pseudo-font countdown numbers, there is a special symbol to indicate when the script is waiting for the interval period to expire and the countdown sequence to begin. Here are  samples of the large display countdown pseudo-font and the special symbol:

    *   **
   **  *  *
    *  *  *
    *  *  *
   ***  **

   *       *
     * * *
     * * *
     * * *
   *       *

2APEX. This mini-script was written to measure the bv and sv values for an intervalometer script I'm testing. I've incorporated APEX statements into the intervalometer script to test if I'll be able to have the sunrise start the intervalometer script and have the sunset stop the intervalometer script each day. In order to determine the appropriate bv "triggers" I decided to write a mini-script to measure the light source over a week to determine an average trigger level for the start and stop triggers. This script simply reports the values when asked. There is only one parameter and that is to allow saving a LOG file in the CHDK/LOGS folder using hour & minutes as part of the name and to allow multiple LOG files. The data saved is:

Code: [Select]
Date: 15/3/2011
Time: 18:47:46
 
Mode:Av
Av:F2.8
Tv:1/30
ISO:AutoISO
av96=294 tv96=480
bv96=138 sv96=603

If you are not logging the data, then the script will wait for the "Set" button at the end before finishing so that the data is held on the OSD until you are ready to exit. Using an SX20, here are some of the readings I've recorded:
    a very dark room with no lights & dark overcast night bv was -908
    room using daylight bv was 207
    same room at night using Tunsten lighting bv was 250
    for standard landscape shot bv was 785
    pointed at a white stairway railing bv was 799
    bright, clear sky while pointed 90 degrees from the sun the bv was 1057; at noon, bv was 1114
Special notes:

1. Since the CHDK UBasic is an interpreted script reader, any mini-script that is time sensitive should be located near the top of the "Utility" script in order to insure the fastest run times.

2. If PropCas statements are used in a mini-script, they are specifically identified in the script positioned between "rem" statements so that they can be easily found and updated to the user's model of camera. Since the list of PropCas for the SX20 is not complete, I have been keeping track and updating the list of PropCas values that I find in the SX20 forum in this post: http://chdk.setepontos.com/index.php?topic=4348.msg60704#msg60704

Just save this script to your CHDK/SCRIPT folder as BAS.

<Part 1 of 3>
« Last Edit: 17 / March / 2011, 10:07:02 by SkyWalker9 »

*

Offline SkyWalker9

  • ****
  • 301
  • SX20 IS (fw 1.02b)
Re: Utilities #3 Update (a collection of mini-scripts)
« Reply #12 on: 15 / March / 2011, 21:02:43 »
Code: [Select]
rem Author SkyWalker9
@title Utilities #3
@param a 1CntDwn:2APEX:       :
@default a 1
@param b Seconds:Save :       :
@default b 0
@param c #Shots :     :       :
@default c 0
@param d IntMin :     :       :
@default d 0
@param e IntSec :     :       :
@default e 0
@param f Reverse:     :       :
@default f 0
@param g .      :     :       :
@default g 0

if a=1 then goto "option1"
if a=2 then goto "option2"
goto "done"

:option1
 cls
 gosub "num_hold"
 D=(d*600+e*10)*100
 if D<1 then D=1
 if c<1 then c=1
 if d<=0 and e<=0 then e=30
 for h=1 to c
  B=get_tick_count
  S=B+D
:opt1_wait_loop
  B=get_tick_count
  if B<S then goto "opt1_wait_loop"
  if b>10 then b=10
  if b<0 then b=0
  for i=0 to b-1
   cls
   x=b-i
   if x=0 then gosub "num_0"
   if x=1 then gosub "num_1"
   if x=2 then gosub "num_2"
   if x=3 then gosub "num_3"
   if x=4 then gosub "num_4"
   if x=5 then gosub "num_5"
   if x=6 then gosub "num_6"
   if x=7 then gosub "num_7"
   if x=8 then gosub "num_8"
   if x=9 then gosub "num_9"
   if x=10 then gosub "num_10"
   sleep 1000
  next i
  cls
  shoot
  sleep 600
  gosub "num_hold"
 next h
 cls
 goto "done"
:num_0
 if f=1 then goto "num_0_R"
 print "      **"
 print "     *  *"
 print "     *  *"
 print "     *  *"
 print "      **"
 return
:num_0_R
 print "                 **"
 print "                *  *"
 print "                *  *"
 print "                *  *"
 print "                 **"
 return
:num_1
 if f=1 then goto "num_1_R"
 print "       *"
 print "      **"
 print "       *"
 print "       *"
 print "      ***"
 return
:num_1_R
 print "                 *"
 print "                 **"
 print "                 *"
 print "                 *"
 print "                ***"
 return
:num_2
 if f=1 then goto "num_2_R"
 print "      **"
 print "     *  *"
 print "       *"
 print "      *"
 print "     ****"
 return
:num_2_R
 print "                 **"
 print "                *  *"
 print "                 *"
 print "                  *"
 print "                ****"
 return
:num_3
 if f=1 then goto "num_3_R"
 print "     ****"
 print "         *"
 print "      ***"
 print "         *"
 print "     ****"
 return
:num_3_R
 print "                ****"
 print "               *"
 print "                ***"
 print "               *"
 print "                ****"
 return
:num_4
 if f=1 then goto "num_4_R"
 print "     *"
 print "     *  *"
 print "     *****"
 print "        *"
 print "        *"
 return
:num_4_R
 print "                   *"
 print "                *  *"
 print "               *****"
 print "                *"
 print "                *"
 return
:num_5
 if f=1 then goto "num_5_R"
 print "     ****"
 print "     *"
 print "     ****"
 print "         *"
 print "     ****"
 return
:num_5_R
 print "                ****"
 print "                   *"
 print "                ****"
 print "               *"
 print "                ****"
 return
:num_6
 if f=1 then goto "num_6_R"
 print "      ***"
 print "     *"
 print "     ****"
 print "     *   *"
 print "      ***"
 return
:num_6_R
 print "                 ***"
 print "                    *"
 print "                 ****"
 print "                *   *"
 print "                 ***"
 return
:num_7
 if f=1 then goto "num_7_R"
 print "     ****"
 print "        *"
 print "       *"
 print "      *"
 print "      *"
 return
:num_7_R
 print "                ****"
 print "                *"
 print "                 *"
 print "                  *"
 print "                  *"
 return
:num_8
 if f=1 then goto "num_8_R"
 print "      ***"
 print "     *   *"
 print "      ***"
 print "     *   *"
 print "      ***"
 return
:num_8_R
 print "                 ***"
 print "                *   *"
 print "                 ***"
 print "                *   *"
 print "                 ***"
 return
:num_9
 if f=1 then goto "num_9_R"
 print "      ***"
 print "     *   *"
 print "      ****"
 print "         *"
 print "      ***"
 return
:num_9_R
 print "                 ***"
 print "                *   *"
 print "                ****"
 print "                *"
 print "                 ***"
 return
:num_10
 if f=1 then goto "num_10_R"
 print "    *   **"
 print "   **  *  *"
 print "    *  *  *"
 print "    *  *  *"
 print "   ***  **"
 return
:num_10_R
 print "               **   *"
 print "              *  *  **"
 print "              *  *  *"
 print "              *  *  *"
 print "               **  ***"
 return
:num_hold
 if f=1 then goto "num_hold_R"
 print "   *       *"
 print "     * * *"
 print "     * * *"
 print "     * * *"
 print "   *       *"
 return
:num_hold_R
 print "              *       *"
 print "                * * *"
 print "                * * *"
 print "                * * *"
 print "              *       *"
 return


<Part 2 of 3>

*

Offline SkyWalker9

  • ****
  • 301
  • SX20 IS (fw 1.02b)
Re: Utilities #3 Update (a collection of mini-scripts)
« Reply #13 on: 15 / March / 2011, 21:03:37 »
Code: [Select]
:option2
 if b<>1 then goto "skip_save"
 z=get_time 0
 y=get_time 1
 x=get_time 2
 m=get_time 3
 n=get_time 4
 p=get_time 5
 g=x*100+y
 if g<1 then g=1
 if g>9999 then g=9999
 print_screen g
 print "Date: "m"/"n"/"p
 print "Time: "x":"y":"z
 print " "
:skip_save
 rem *** SX20 ***
 get_prop 50 B
 if B=8228 then print "Mode:Custom"
 if B=-32767 then print "Mode:Manual"
 if B=-32766 then print "Mode:Av"
 if B=-32765 then print "Mode:Tv"
 if B=-32764 then print "Mode:Program"
 if B=-32768 then print "Mode:Auto"
 if B=-32755 then print "Mode:Portrait"
 if B=-32756 then print "Mode:Landscape"
 if B=-32757 then print "Mode:Night Snapshot"
 if B=-32249 then print "Mode:Sports"    
 if B=16402 then print "Mode:Sunset"  
 if B=-32246 then print "Mode:Stitch Assist"    
 if B=2600 then print "Mode:Movie"
 rem *** SX20 ***
 press "shoot_half"
 sleep 600
 x=get_user_av_id
 gosub "prnt_av"
 x=get_user_tv_id
 gosub "prnt_time"
 x=get_iso
 gosub "prnt_iso"
 get_user_av96 A
 get_user_tv96 T
 print "av96="A" tv96="T
 get_bv96 B
 get_sv96 S
 print "bv96="B" sv96="S
 if b=1 then goto "done"
 gosub "opt2_wait_loop"
 goto "done"

:prnt_time
 if x=-12 then print "Tv:15s"
 if x=-11 then print "Tv:13s"
 if x=-10 then print "Tv:10s"
 if x=-9 then print "Tv:8s"
 if x=-8 then print "Tv:6s"
 if x=-7 then print "Tv:5s"
 if x=-6 then print "Tv:4s"
 if x=-5 then print "Tv:3.2s"
 if x=-4 then print "Tv:2.5s"
 if x=-3 then print "Tv:2s"
 if x=-2 then print "Tv:1.6s"
 if x=-1 then print "Tv:1.3s"
 if x=0 then print "Tv:1s"
 if x=1 then print "Tv:0.8s "
 if x=2 then print "Tv:0.6s"
 if x=3 then print "Tv:0.5s"
 if x=4 then print "Tv:0.4s"
 if x=5 then print "Tv:0.3s"
 if x=6 then print "Tv:1/4"
 if x=7 then print "Tv:1/5"
 if x=8 then print "Tv:1/6"
 if x=9 then print "Tv:1/8"
 if x=10 then print "Tv:1/10"
 if x=11 then print "Tv:1/13"
 if x=12 then print "Tv:1/15"
 if x=13 then print "Tv:1/20"
 if x=14 then print "Tv:1/25"
 if x=15 then print "Tv:1/30"
 if x=16 then print "Tv:1/40"
 if x=17 then print "Tv:1/50"
 if x=18 then print "Tv:1/60"
 if x=19 then print "Tv:1/80"
 if x=20 then print "Tv:1/100"
 if x=21 then print "Tv:1/125"
 if x=22 then print "Tv:1/160"
 if x=23 then print "Tv:1/200"
 if x=24 then print "Tv:1/250"
 if x=25 then print "Tv:1/320"
 if x=26 then print "Tv:1/400"
 if x=27 then print "Tv:1/500"
 if x=28 then print "Tv:1/640"
 if x=29 then print "Tv:1/800"
 if x=30 then print "Tv:1/1000"
 if x=31 then print "Tv:1/1250"
 if x=32 then print "Tv:1/1600"
 if x=33 then print "Tv:1/2000"
 if x=34 then print "Tv:1/2500"
 if x=35 then print "Tv:1/3200"
 return
:prnt_iso
 if x=0 then print "ISO:AutoISO"
 if x=1 then print "ISO:50(80)"
 if x=2 then print "ISO:100"
 if x=3 then print "ISO:200"
 if x=4 then print "ISO:400"
 if x=5 then print "ISO:800"
 if x=6 then print "ISO:1600"
 if x=7 then print "ISO:3200"
 if x=-1 then print "ISO:HiISO"
 return
:prnt_av
 if x=9 then print "Av:F2.8"
 if x=10 then print "Av:F3.2"
 if x=11 then print "Av:F3.5"
 if x=12 then print "Av:F4.0"
 if x=13 then print "Av:F4.5"
 if x=14 then print "Av:F5.0"
 if x=15 then print "Av:F5.6"
 if x=16 then print "Av:F6.3"
 if x=17 then print "Av:F7.1"
 if x=18 then print "Av:F8.0"
 return
:opt2_wait_loop
 wait_click 10000
 is_key k "set"
 if k=1 then goto "exit_wait"
 goto "opt2_wait_loop"
:exit_wait
 return

:done
 release "shoot_half"
 print_screen 0
end

Update 4-19-11: When using the wait_click statements, some cameras require the timeout be specified; recommend starting with "wait_click 10000" (10secs). The script has been updated to reflect the change.

<Part 3 of 3 - final part>
« Last Edit: 19 / April / 2011, 18:22:50 by SkyWalker9 »


*

Offline SkyWalker9

  • ****
  • 301
  • SX20 IS (fw 1.02b)
Re: Utilities #3 - added 3SunInt (a collection of mini-scripts)
« Reply #14 on: 19 / March / 2011, 18:58:47 »
Utilities #3 Updated - added 3SunInt (reduced coding requirements of 2APEX mini-script and added 3SunInt mini-script)

This is the third in the series of mini-scripts.
1CntDwn:2APEX:3SunInt:    (     1)
#Shots :Save :#Shots :    (     0)
IntMin :     :IntMin :    (     0)
IntSec :     :IntSec :    (     0)
Seconds:     :Bv(x50):    (     0)
Reverse:     :       :    (     0)
.      :     :       :    (     0)
Like the last time, each mini-script is identified by the first parameter line and the mini-script is chosen by the number in the name of the min-script. If there are parameters for that mini-script, they are shown in the column just below the mini-script name.

Utility mini-scripts

1CntDwn. This mini-script has a large pseudo-font countdown display timer for taking a series of pictures and was first included in Utility #2. I originally wrote this script so that I could use it on an SX20 which has an articulating display. Since CHDK doesn't display properly on the LCD when facing forward I had to design a way to display the countdown pseudo-font numbers in reverse and to the far right side of the normal CHDK script window.
 I added a Reverse parameter to indicate when the reverse display is used with an articulating display in the facing forward position. It was necessary to add more lines/characters to the original mini-script, so it was moved to this script.

There are five parameters: #Shots, IntMin, IntSec, Seconds and Reverse. The "#Shots" is the number of photos to shoot in the series.  The "IntMin" and "IntSec" is the amount between each countdown sequence (between shots) and allows the photographer time to setup the next shot. "Seconds" is the amount countdown seconds to display (1-10). The "Reverse" parameter is set to 1 to use the articulating display facing forward - anything other than 1 will assume the display is not being used in the facing forward position.

In normal use (non-Reverse) the display is handy when taking group photos and experimenting with creating "cloning" photos. In addition to the pseudo-font countdown numbers, there is a special symbol to indicate when the script is waiting for the interval period to expire and the countdown sequence to begin. Here are  samples of the large display countdown pseudo-font and the special symbol:
    *   **
   **  *  *
    *  *  *
    *  *  *
   ***  **

   *       *
     * * *
     * * *
     * * *
   *       *

2APEX. This mini-script was written to report the APEX values of bv96, sv96, av96 and tv96. An example of one of the uses is in the intervalometer mini-script (3SunInt) that follows. This mini-script simply reports the values when asked. There is only one parameter and that is to allow saving a LOG file in the CHDK/LOGS folder using hour & minutes as part of the name and to allow multiple LOG files. After the data is saved a photo is also taken as part of the logging process so that there is a record of what the photo process would look like at that Bv. The data logged is:

Code: [Select]
Date: 15/3/2011
Time: 18:47:46
 
bv96=138 sv96=603
av96=294 tv96=480

If you are not logging the data, then the script will wait for the "Set" button at the end before finishing so that the data is held on the OSD until you are ready to exit. Using an SX20, here are some of the readings I've recorded:
    a very dark room with no lights & dark overcast night bv was -908
    room using daylight bv was 207
    same room at night using Tunsten lighting bv was 250
    for standard landscape shot bv was 785
    pointed at a white stairway railing bv was 799
    bright, clear sky while pointed 90 degrees from the sun the bv was 1057; at noon, bv was 1114
There is one special case where bv96 may indicate zero in very dark conditions (instead of a negative number). Because it happens in very few cases, it is very difficult to determine the exact conditions under which this might happen, so it is advisable to take this special case into consideration when writing scripts.

3SunInt. This sunrise-sunset intervalometer mini-script was written to allow starting and stopping using available daylight. When the appropriate amount of daylight is sensed, this mini-script will start the shot sequence. The light is measured via bv96 and is used to start the shot sequence (sunrise). The script can be set end in two ways: 1) allow the bv96 value to stop the mini-script when it reaches the Bv setting - the light level decreases to the bv96 setting (i.e. sunset) or 2) set a maximum number of shots. As with other scripts, this script can also be prematurely stopped by pressing the shutter button to terminate the script.

There are four parameters: #Shots, IntMin, IntSec and Bv(x50)

#Shots. This parameter allows a user to set the maximum number of shots. This would be useful if the user only wanted photos of a sunrise. If you want photos throughout the entire day from sunrise to sunset then set the #Shots to zero and the mini-script will take photos from beginning to end using the intervals specified.

IntMin & IntSec. These interval parameters allow you to accurately set an interval time (minutes & seconds) between shots. This mini-script uses tick_count statements rather than sleep statements to control the time between shots.

Bv(x50). This parameter sets the start and stop "triggers" for the mini-script. The "x50" indicates that any value used for this parameter will be multipled times 50. For example, on my SX20 I have found that a bv96 level of -200 works good for several of my series, so I set the Bv parameter to -4 (-4x50=-200). The bv96 values may vary between cameras and shooting scenarios, therefore it is best that you determine the bv96 values that are best for your needs. If you are unsure what trigger value to use, I recommend you use the 2APEX mini-script above to check the light levels. While waiting for the start of the sunrise "trigger", the mini-script checks the Bv value approximately every 10 minutes (the interval between the first and second may be shorter). The 10 minute delay was determined by monitoring bv96 changes during sunrises over multiple days.

I noticed on my SX20 that occassionally bv96 indicates zero instead of a negative number in dark conditions (maybe due to camera settle time?). This script checks for this condition and forces the script to recheck the value of bv96 again. Since a zero reading for bv96 happens infrequently, the effect of this re-check should be negligible.

Special notes:
1. Since the CHDK UBasic is an interpreted script reader, any mini-script that is time sensitive should be located near the top of the "Utility" script in order to insure the fastest run times.

2. If PropCas statements are used in a mini-script, they are specifically identified in the script positioned between "rem" statements so that they can be easily found and updated to the user's model of camera. Since the list of PropCas for the SX20 is not complete, I have been keeping track and updating the list of PropCas values that I find in the SX20 forum in this post: http://chdk.setepontos.com/index.php?topic=4348.msg60704#msg60704

Just save this script to your CHDK/SCRIPT folder as BAS.

<Part 1 of 3>
« Last Edit: 20 / March / 2011, 14:52:12 by SkyWalker9 »

*

Offline SkyWalker9

  • ****
  • 301
  • SX20 IS (fw 1.02b)
Re: Utilities #3 - added 3SunInt (a collection of mini-scripts)
« Reply #15 on: 19 / March / 2011, 19:00:28 »
Code: [Select]
rem Author SkyWalker9
@title Utilities #3
@param a 1CntDwn:2APEX:3SunInt:
@default a 1
@param b #Shots :Save :#Shots :
@default b 0
@param c IntMin :     :IntMin :
@default c 0
@param d IntSec :     :IntSec :
@default d 0
@param e Seconds:     :Bv(x50):
@default e 0
@param f Reverse:     :       :
@default f 0

if a=1 then goto "option1"
if a=2 then goto "option2"
if a=3 then goto "option3"
goto "done"

:option3
rem This sunrise-sunset intervalometer mini-script has the ability to shoot non-stop.
rem Once started it will run until the camera runs out of space for photos
rem or until the battery power is no longer sufficient to continue.
  if b<=0 then b=999999
  if c<0 then c=0
  if c>59 then c=59
  if d<0 then d=0
  if d>59 then d=59
  e=e*50
  D=(c*600+d*10)*100
  if D>0 then goto "opt3_interval_ok"
  print "No interval specified..."
  goto "done"
:opt3_interval_ok
  press "shoot_half"
  sleep 2000
  release "shoot_half"
  n=1
:opt3_check_time
  gosub "opt3_check_bv_level"
  if B>=e then goto "opt3_shot_loop"
  cls
  if b<>999999 then print "Number of shots: "b
  print "Interval: "c"m "d"s"
  print "Bv:"B" (Min:"e")"
  print "Checked at "x":"y
  gosub "Bv_check_delay"
  goto "opt3_check_time"
:opt3_shot_loop
  X=get_tick_count
  gosub "opt3_check_bv_level"
  if B<=e then goto "done"
  shoot
  sleep 600
  n=n+1
  if n>b then goto "done"
  cls
  if b<>999999 then print "Next shot: "n" of "b else print "Next shot: "n
  print "Intervals: "c"m "d"s"
  print "Bv:"B" (Min:"e")"
  print " "
  S=X+D
:opt3_wait_loop
  X=get_tick_count
  if X<S then goto "opt3_wait_loop"
  goto "opt3_shot_loop"
:opt3_check_bv_level
  press "shoot_half"
  sleep 600
  get_bv96 B
  get_sv96 S
  release "shoot_half"
  sleep 600
  if B=0 then goto "opt3_check_bv_level"
  x=get_time 2
  y=get_time 1
  return
:opt3_Bv_check_delay
  y=get_time 1
  if (y%10)<>0 then goto "opt3_Bv_check_delay"
  return

<Part 2 of 3>
« Last Edit: 20 / March / 2011, 14:53:29 by SkyWalker9 »

*

Offline SkyWalker9

  • ****
  • 301
  • SX20 IS (fw 1.02b)
Re: Utilities #3 - added 3SunInt (a collection of mini-scripts)
« Reply #16 on: 19 / March / 2011, 19:01:43 »
Code: [Select]
:option1
 cls
 gosub "num_hold"
 D=(c*600+d*10)*100
 if D<1 then D=1
 if b<1 then b=1
 if c<=0 and d<=0 then d=30
 for h=1 to b
  B=get_tick_count
  S=B+D
:opt1_wait_loop
  B=get_tick_count
  if B<S then goto "opt1_wait_loop"
  if e>10 then e=10
  if e<0 then e=0
  for i=0 to e-1
   cls
   x=e-i
   if x=0 then gosub "num_0"
   if x=1 then gosub "num_1"
   if x=2 then gosub "num_2"
   if x=3 then gosub "num_3"
   if x=4 then gosub "num_4"
   if x=5 then gosub "num_5"
   if x=6 then gosub "num_6"
   if x=7 then gosub "num_7"
   if x=8 then gosub "num_8"
   if x=9 then gosub "num_9"
   if x=10 then gosub "num_10"
   sleep 1000
  next i
  cls
  shoot
  sleep 600
  gosub "num_hold"
 next h
 cls
 goto "done"
:num_0
 if f=1 then goto "num_0_R"
 print "      **"
 print "     *  *"
 print "     *  *"
 print "     *  *"
 print "      **"
 return
:num_0_R
 print "                 **"
 print "                *  *"
 print "                *  *"
 print "                *  *"
 print "                 **"
 return
:num_1
 if f=1 then goto "num_1_R"
 print "       *"
 print "      **"
 print "       *"
 print "       *"
 print "      ***"
 return
:num_1_R
 print "                 *"
 print "                 **"
 print "                 *"
 print "                 *"
 print "                ***"
 return
:num_2
 if f=1 then goto "num_2_R"
 print "      **"
 print "     *  *"
 print "       *"
 print "      *"
 print "     ****"
 return
:num_2_R
 print "                 **"
 print "                *  *"
 print "                 *"
 print "                  *"
 print "                ****"
 return
:num_3
 if f=1 then goto "num_3_R"
 print "     ****"
 print "         *"
 print "      ***"
 print "         *"
 print "     ****"
 return
:num_3_R
 print "                ****"
 print "               *"
 print "                ***"
 print "               *"
 print "                ****"
 return
:num_4
 if f=1 then goto "num_4_R"
 print "     *"
 print "     *  *"
 print "     *****"
 print "        *"
 print "        *"
 return
:num_4_R
 print "                   *"
 print "                *  *"
 print "               *****"
 print "                *"
 print "                *"
 return
:num_5
 if f=1 then goto "num_5_R"
 print "     ****"
 print "     *"
 print "     ****"
 print "         *"
 print "     ****"
 return
:num_5_R
 print "                ****"
 print "                   *"
 print "                ****"
 print "               *"
 print "                ****"
 return
:num_6
 if f=1 then goto "num_6_R"
 print "      ***"
 print "     *"
 print "     ****"
 print "     *   *"
 print "      ***"
 return
:num_6_R
 print "                 ***"
 print "                    *"
 print "                 ****"
 print "                *   *"
 print "                 ***"
 return
:num_7
 if f=1 then goto "num_7_R"
 print "     ****"
 print "        *"
 print "       *"
 print "      *"
 print "      *"
 return
:num_7_R
 print "                ****"
 print "                *"
 print "                 *"
 print "                  *"
 print "                  *"
 return
:num_8
 if f=1 then goto "num_8_R"
 print "      ***"
 print "     *   *"
 print "      ***"
 print "     *   *"
 print "      ***"
 return
:num_8_R
 print "                 ***"
 print "                *   *"
 print "                 ***"
 print "                *   *"
 print "                 ***"
 return
:num_9
 if f=1 then goto "num_9_R"
 print "      ***"
 print "     *   *"
 print "      ****"
 print "         *"
 print "      ***"
 return
:num_9_R
 print "                 ***"
 print "                *   *"
 print "                ****"
 print "                *"
 print "                 ***"
 return
:num_10
 if f=1 then goto "num_10_R"
 print "    *   **"
 print "   **  *  *"
 print "    *  *  *"
 print "    *  *  *"
 print "   ***  **"
 return
:num_10_R
 print "               **   *"
 print "              *  *  **"
 print "              *  *  *"
 print "              *  *  *"
 print "               **  ***"
 return
:num_hold
 if f=1 then goto "num_hold_R"
 print "   *       *"
 print "     * * *"
 print "     * * *"
 print "     * * *"
 print "   *       *"
 return
:num_hold_R
 print "              *       *"
 print "                * * *"
 print "                * * *"
 print "                * * *"
 print "              *       *"
 return

:option2
 if b<>1 then goto "opt2_skip_save"
 z=get_time 0
 y=get_time 1
 x=get_time 2
 m=get_time 3
 n=get_time 4
 p=get_time 5
 g=x*100+y
 if g<1 then g=1
 if g>9999 then g=9999
 print_screen g
 print "Date: "n"/"m"/"p
 print "Time: "x":"y":"z
 print " "
:opt2_skip_save
 press "shoot_half"
 sleep 600
 get_bv96 B
 get_sv96 S
 print "bv96="B" sv96="S
 get_user_av96 A
 get_user_tv96 T
 print "av96="A" tv96="T
 if b=1 then goto "almost_done"
 gosub "opt2_wait_loop"
 goto "done"
:opt2_wait_loop
 wait_click 10000
 is_key k "set"
 if k=1 then goto "opt2_exit_wait"
 goto "opt2_wait_loop"
:opt2_exit_wait
 return

:almost_done
 shoot
 sleep 600
:done
 release "shoot_half"
 print_screen 0
end

Update 4-19-11: When using the wait_click statements, some cameras require the timeout be specified; recommend starting with "wait_click 10000" (10secs). The script has been updated to reflect the change.

<Part 3 of 3 - final part>
« Last Edit: 19 / April / 2011, 18:24:00 by SkyWalker9 »

*

Offline SkyWalker9

  • ****
  • 301
  • SX20 IS (fw 1.02b)
This is the fourth in the series of mini-scripts.

As in previous Utility mini-scripts, each mini-script is identified by the first parameter line and the mini-script is chosen by the number in the name of the mini-script. If there are parameters for that mini-script, they are shown in the column just below the mini-script name.

1ZmStep:2LensEqv:3TstDOF       (     1)
.      :Step#   :Step#         (    64)
.      :All (1=REG 2=CSV)      (     0)
.      :        :JPGs (1=YES)  (     1)
.      :        :JPG#          (  2375)
Utility mini-scripts

Special note: While the "2LensEqv" & "3TstDOF" mini-scripts use some camera specific code for the SX20 camera, the mini-scripts can be easily modified for other cameras. Some statements are normally camera specific such as PropCas; in this case there are also three variable statements that use coefficients for a quadratic equation specifically for the SX20. This data came from the "1ZmStep" mini-script and was recorded from a SX20; the coefficients processing was done using an off-camera curve fitting program.

1ZmStep. This mini-script is used to accurately determine the zoom steps for the 35mm equivalent markings on the camera lens. These values can then be used to interpolate the 35mm equivalent setting for each zoom step using a quadratic formula. Using a quadratic formula to interpolate these settings is much more accurate than linear plotting between the same points.

Since there are only two zoom steps that are considered truely accurate on a zoom lens, the 0 step and the last step (128 for a SX20), I used them as a reference when measuring the other 35mm equivalent markings on the lens. In order to accurately determine the other zoom steps for the 35mm equivalent markings on the lens, I need