The example script from the events section (Preset Lua extension | Electra One Documentation) isn’t working:
function events.onPotTouch(potId, controlId, touched)
print ("potId: " .. potId)
print ("controlId: " .. controlId)
print ("touched: " .. touched)
end
The problem is that the touched variable is of type bool and (pardon my c-lang-speak) casting that to a string doesn’t seem as straight-forward since I can see the following error in the log whenever that line is reached:
error running function ‘onPotTouch’: ctrlv2/slots/p001.lua:427: attempt to concatenate a boolean value (local ‘touched’)
Here’s what I’m doing instead and that works fine:
print ("touched: " .. (touched and 1 or 0))