Parameters are sent to lua based on a just of couple of criteria. If the first character is a quote (single or double), the parameter is sent as a string. If the parameter is true or false, the argument is as a boolean type. Everything else is assumed to be a number (without formulas).
We can look into adding a formula check before sending it to lua. In the meantime, you can use the ParseFormula function, and send the arguments as strings (in the skin file). This way, your script will work for any version of Rainmeter since r2851.
For example, in your skin use quotes around the arguments:
Then in your script, call the ParseFormula function.
Note: The function may seem redundant, but I added it in case the skin file forgets the quotes (although Lua/Rainmeter seems to be forgiving in some cases).
Code: Select all
function Sum(a, b) -- Note: ParseFormula wants a 'string' as its parameter local x = SKIN:ParseFormula(tostring(a)) local y = SKIN:ParseFormula(tostring(b)) local result = x + y return result end
We will discuss adding a formula check or just changing the docs.