Mode Lock

By Acclamator on Nov 17, 2008

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

Comments

Sign in to comment.
dashh   -  Feb 22, 2009

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)
}
 Respond  
guest598594   -  Nov 17, 2008

Instead of using the %lock variable I'd just grab the status of the group.

 Respond  
newklear   -  Nov 17, 2008

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,-))

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.