For example, our alias "dd" will either kick the target when you just do "dd", or kick a rat when you "dd rat".
So, now for the alias code itself.
Regex:
Code: Select all
^dd(?:\s(\w+))?$
Code: Select all
send("kick " .. (matches[2] or target))
Code: Select all
^dd(?:\s(\w+))?$
Code: Select all
send("kick " .. (matches[2] or target))
Code: Select all
function tar( t )
if t == nil then
return target
else
return t
end
end
Code: Select all
t = "hello"
send( matches[3] or t )
Code: Select all
b = c or 0