Code:
function () local name,_,icon,_,_,_,_,_,_,_,_,_,_,_,value=UnitBuff("player", "Anti-Magic Shell")
if(value>999999)then
value= ("%d,%d,%d"):format(math.floor(value/1000000),math.floor(value/1000)%1000,value%1000)
end
if(value>999)then
value= ("%d,%d"):format(math.floor(value/1000),value%1000)
end
return(value)
end
Replaced the abundance of concat operators with string.format calls. Concatenation operators are inefficient for numbers if you only have a single operation, and inefficient for everything else if you have more than one (as they are processed one after another).