Code: Select all
Alias pattern: ^wc(.+)?$
Script:
if matches[2] == nil then
send( "clan 2 who" )
else
send( "clan 2 tell " .. matches[2] )
end
"wc" to check my clan who
"wc <text here>" to speak on the clan channel.
I use this check for nil arguments/parameters a lot - for most aliases in fact.
Example in zscript:
#alias {cc} {#IF(%null(%1)) {#2 claw @target} {#2 claw %1}}
In Mudlet I would assume:
Code: Select all
Alias Pattern: ^cc(?:\s)?(\w+)?$
or: ^cc\s?(\w+)?$
Script:
if matches[2] == nil then
send( "claw " .. target)
send( "claw " .. target)
else
send( "claw " .. matches[2])
send( "claw " .. matches[2])
end