5.5 CHDK commands 125
a = get_autostart uBasic
a = get_autostart() Lua
set_autostart a uBasic
set_autostart(a) Lua
Retrieves or sets the state of the autostart function (section 5.1).
0 = autostart off. The user always starts scripts. 1 = autostart on. The next time
the camera is switched on, the previously selected script will be executed.
2 = autostart once. The next time the camera is switched on, the previously
selected script will be executed. The autostart state is then set back to 0.
x = random l,u uBasic
x = random(l,u) Lua
Returns a random value within a range of l to u.
m = get_mode uBasic
Returns the camera mode: 0 = recording, 1 = playback, 2 = video.
rec,vid,mode = get_mode() Lua
Returns the camera mode:
rec: true = recording, false = playback
vid: true = video, false = photo
mode: binary value representing the CHDK shooting mode number (section 5.6).
r = set_capture_mode(i) Lua
Sets the shooting mode. Parameter i specifies the CHDK shooting mode number.
true is returned on success, false otherwise. See also section 5.5.12 for high-level
access.
is_capture_mode_valid(i) Lua
Returns true if the parameter i is a valid CHDK shooting mode number (section 5.6)
m = get_drive_mode uBasic
m = get_drive_mode() Lua
Returns the camera’s drive mode: 0 = single shot, 1 = series, > 1 = timer.
m = get_IS_mode uBasic
m = get_IS_mode() Lua
Returns the mode of the image stabilizer (IS): 0 = continuous, 1 = when shooting,
2 = panning, 3 = off.
m = get_movie_status uBasic
m = get_movie_status() Lua
Returns the current status of the video function: 0 = stop, 1 = pause, 4 = record,
5 = save.
set_movie_status m uBasic
set_movie_status(m) Lua
Sets the current status of the video function: 1 = pause, 2 = restart, 3 = stop.