This thing locks modes when you want them to remain the way they are.
usage: type /mlock to activate/deactivate
you need ( @ & or ~ ) to change modes.
alias mlock { if (!%lock) { set %lock 1 | .enable #lock | /echo -a Mlock activated, modes locked. }
elseif ( %lock == 0 ) { .enable #lock | set %lock 1 | /echo -a Mlock activated, modes locked. }
elseif ( %lock == 1 ) { set %lock 0 | .disable #lock | /echo -a Mlock deactivated, modes unlocked. }
}
#lock on
on *:RAWMODE:#: {
if (- isin $1) && ( $nick != $me ) { /mode $chan $+(+,$remove($1,-)) }
elseif (+ isin $1) && ( $nick != $me ) { /mode $chan $+(-,$remove($1,+)) }
}
#lock end
looks that.
two /mode is not necesary
;- /testt +i
alias testt {
if ( $nick != $me ) {
if (-* iswm $1) || (+* iswm $1 ) {
echo -a * /mode $chan $+($iif($v1 = -,+,-),$remove($1,-,+)) $2-
}
}
}
and
alias mlock {
%lock = $iif(%lock = 0,1,0)
$iif(%lock = 0,.disable,.enable) #lock | /echo -a Mlock $iif(%lock = 0,off. modes unlocked,on. modes lock)
}
Good idea to prevent other operators changing modes, depending on the version of services on the IRC server won't "/cs set #channelname mlock +modes" do the same thing ?
A few Pointers:
if ( %lock == $null ) can be written as > if (!%lock) note: no spaces.
also no need for a "/" before the commands you can just write > /mode $chan $+(+,$remove($1,-)) as > mode $chan $+(+,$remove($1,-))