$ischanmode
Platform: mIRC
Published Dec 25, 2007
Updated Dec 25, 2007
Returns $true or $false depending on if a channel mode is set. See documentation below. Ability to use wildcards and to match multiple modes at a time. Very simplified code.
/*
$ischanmode by sunburst
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Simple snippet I made of use for in my script; thought other people might find this to be helpful.
This snippet will check if a mode is set in a channel.
Syntax: $ischanmode(#channel,<mode string>)
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Example: $ischanmode(#mIRC,n) returns $true if the mode n is set
Note: Uses $wildtok so you CAN use wildcards:
Ex: $ischanmode(#mIRC,*n*t*) would return $true if the mode set matched *n*t*
Otherwise, it will just format the inputed string as *<mode string>*
*/
alias ischanmode {
if ( !$2 ) || ( $me !ison $1 ) || ( $regex($2,/(\d+)/) ) {
echo -ac info * $!ischanmode: insufficient parameters
halt
}
var %w = $iif($regex($2,/[\*]/gx),$2,$+(*,$2,*))
if ( $wildtok($chan($1).mode,%w,1,32) ) {
return $true
}
else { return $false }
}