Floating menu sliders, is there some example for the scripts?

I'm trying to figure out how to use floating menu sliders in BTT 4.9999.

I have downloaded the ScriptExamples preset that includes a slider.

  • The Init Script for this slider seems to work (sets slider value from system volume).
  • However, the slider position does not move when I click or drag on it.
    I think the Value Change Script for this preset may be out of date, as if I click on Run Script I get an error message "e2 could not execute" and some indication that the parameters don't match the function. (Error message too long to include here).

The current code looks like this (Apple Script):

on sliderChanged(uuid, value)

set volume output volume value * 100
return value*100
end sliderChanged

Can anyone tell me what this function should look like, and/or point me to a functional example?

Ideally I would like to see samples for both Apple Script and Javascript versions of the Init and Change script, but I'd be grateful for any working example.