実践KSP

Callback

on init
set_script_title ("sample") make_perfview
set_ui_height (2)
declare ui_knob $a (0,12,1)
declare ui_switch $b
end on
on controller
set_control_par (get_ui_id($a),$CONTROL_PAR_VALUE,%CC[$CC_NUM]/10)
end on
on ui_control($a)
if ($a mod 2 = 0)
$b := 0 {set_control_par (get_ui_id($b),$CONTROL_PAR_VALUE,0)}
else
$b := 1
end if
end on
on ui_control($b)
{if ($b = 1)}
$b := 0
{end if}
end on
on note
$b := 1 wait(2000000) $b := 0
end on
on release
$b := 0
end on