120 C H A P T E R 5 Scriptingget_dof x uBasicx = get_dof uBasicx = get_dof() LuaReturns the Depth of Field ( DOF) in millimeters.get_far_limit d uBasicd = get_far_limit uBasicd = get_far_limit() Luaget_near_limit d uBasicd = get_near_limit uBasicd = get_near_limit() LuaSets the far and near limit (in millimeters) of the distance range with acceptablesharpness. The value of –1 resp. 65535 indicates an infinite distance, but also adistance outside the current camera setting ( macro, normal).get_hyp_dist d uBasicd = get_hyp_dist uBasicd = get_hyp_dist() LuaReturns the hyperfocal distance in millimeters. The hyperfocal distance is the closestdistance to which the lens can be focused while keeping objects at infinity sharp. Allobjects within the range of half of the hyperfocal distance and infinity will be sharp.set_aflock a uBasicset_aflock(a) LuaSets autofocus lock: 0 = off, 1 = on. Especially useful for time series where refocusingis not desired. When the AF lock is set, the AF LED is switched off, too.5.5.4 Zoom-related commandss = get_zoom_steps uBasics = get_zoom_steps() LuaReturns the maximum number of zoom steps. This may differ among camera models.get_zoom z uBasicz = get_zoom uBasicz = get_zoom() Luaset_zoom z uBasicset_zoom(z) LuaRetrieves and sets the current zoom step.Note: It is recommended to set the zoom speed explicitly with command set_zoom_speed (see below) before using the set_zoom command. Improper use of the set_zoomcommand can later result in the message “assert failed—game over!” and an imme-diate camera shutdown.A safer method to change zoom levels is to apply simulated clicks to the zoom_in andzoom_out buttons (section 5.5.1).