There is a method I have been calling:
t1, t2 = LSL:GetDiffItem(item)
where the method is declared as:
GetDiffID(item, ignoreEnchant, ignoreGem, red, yellow, blue, meta, ignorePris)
Now I want to pass additional parameters, skipping some:
item, ignoreEnchant, ignoreGem, red, yellow, blue, meta, ignorePris
I tried just skipping the parameters:
t1, t2 = LSL:GetDiffItem(item, ignore, ignore, , , , , ignore)
But of course that doesn’t work:
unexpected symbol near ‘,’
So, how do I skip optional parameters in Lua?
Pass
nil. This will be identical to not ever having passed the parameter. However, be aware that the documentation states that you can do this, because most functions will not check each individual optional parameter, and only check each parameter if the previous one was provided.