A fairly simple question, with perhaps a not-so-simple answer. Lets say I want to make a targeting function that looked like the following:
Code: Select all
function tar( tar1, tar2, tar3..., tarn, tf )
targets[1] = ( tar1 or targets[1] )
targets[2] = ( tar2 or targets[2] )
targets[3] = ( tar3 or targets[3] )
...
targets[n] = ( tarn or targets[n] )
if tf ~= false then
echo("Targeting " .. targets[1] .. " and " .. targets[2] .. " and " .. targets[3] .. "\n")
end
end
To clarify, I would only want to echo the first 3 targets, not all of them. And the 'tf' argument at the end to give the option of whether or not to echo the targets would be nice, but isn't necessary. Is there a way that I could do this?