Top

Mode Lock


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  3.0 (of 2 scores)
Date Added  Nov 17, 2008
Last Updated  Nov 17, 2008
Tags  lock  mode 

Introduction

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.


Grab the Code

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

  (3)  RSS
Kasbah
Comments: 17
 
mIRC Snippet:  Mode Lock
Posted on Nov 17, 2008 3:44 pm
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:
Quote:
if ( %lock == $null )
can be written as
Quote:
if (!%lock)
note: no spaces.

also no need for a "/" before the commands you can just write
Quote:
/mode $chan $+(+,$remove($1,-))
as
Quote:
mode $chan $+(+,$remove($1,-))
mountaindew
Comments: 1,826
 
mIRC Snippet:  Mode Lock
Posted on Nov 17, 2008 3:53 pm
Instead of using the %lock variable I'd just grab the status of the group.
dashh
Comments: 22
 
mIRC Snippet:  Mode Lock
Posted on Feb 22, 2009 4:54 pm
looks that.
two /mode is not necesary
Code:

;-  /testt +i
alias testt {
  if ( $nick != $me ) {
    if (-* iswm $1) || (+* iswm $1 ) {
      echo -a * /mode $chan $+($iif($v1 = -,+,-),$remove($1,-,+)) $2-
    }
  }
}

and
Code:

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

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom