Okay. By getting parameters I mean taking something like this (this might be nonsensical in uBASIC but it's designed to be human readable)...
@param a Backlight
if a is 1 then turn off backlight
if a ISN'T 1 then keep backlight on
.
You've got it sort of correct. The user parameters are simply uBASIC variables you assign a value to with the @param keyword. You can then changed them from the Script menu. They are used just like any other variables in the script's code. But in your example, you can't use
Backlight - it needs to be a number.
@param a 0
if a is 1 then turn off backlight
if a ISN'T 1 then keep backlight on
.
If you want to know how to determine the current state of the backlight or other camera settings, there are several different techniques. Start with this one :
CHDK Property CaseFor my early prototypes I had pulled a detect any keypress snippet out of a script on the wiki (read: LED light for A590), and that worked, however adapting it was difficult. I'll work with what you provided.
I don't use uBASIC so I don't have a lot of handy examples. However, this CHDK wiki page [
yet another DOF stacker ] has a working example of using the three uBASIC scripting functions you will need (links):
is_key ,
is_pressed ,
wait_click