Channel Modes/Ops Lock

By chicknh8r on Apr 15, 2006

I wrote this with the intent of it being used in a bot.
Copy this script, then in your bot's mirc, click "alt R", goto "new",
and then paste, then goto "saveas" and name it whatever you want.Make sure to change "botowner" to your nick, that way it will only respond to your commands. Usage: !lock on;off;status

#modelock off

on *:RAWMODE:%lockchannel {
  if ($nick == $me) { return }
  if (+ isin $1-) { mode # - $+ $remove($1-,+) $opnick | halt }
  elseif (- isin $1-) { mode # + $+ $remove($1-,-) $opnick | halt }
}

on *:mode:%lockchannel {
  if ($nick == $me) { return }
  if (+ isin $1-) { mode # - $+ $remove($1-,+) | halt }
  elseif (- isin $1-) { mode # + $+ $remove($1-,-) | halt }
}

#modelock end

menu channel {
  ModeLocks
  .Status ( $+ $group(#modelock).status $+ )
  ..$iif( $group(#modelock).status == on, off, on): { 
    echo $colour(info) -a ModeLock $iif( $group(#modelock).status == on, disabled, enabled) 
    .$iif( $group(#modelock).status == on, .disable, .enable) #modelock 
  }
}

on *:TEXT:*:#: {
  if ($nick == botowner) {
    if ($1 == !lock) {
      if (!$2) || ($2 == help) { notice $nick Usage: !lock <on;off;status> }
      else {
        if ($2 == on) {
          set %lockchannel $chan
          enable #modelock
          msg $chan ModeLock Enabled For Channel: %lockchannel
          halt
        }
        elseif ($2 == off) {
          unset %lockchannel
          disable #modelock
          msg $chan ModeLock Disabled
          halt
        }
        elseif ($2 == status) {
          if ( $group(#modelock).status == ON ) {
            msg $chan ModeLock Status is $group(#modelock) $+ , and set to Channel: %lockchannel
            halt
          }
          else {
            msg $chan ModeLock Status is $group(#modelock)
          }
        }
      }
    }
  }
}

Comments

Sign in to comment.
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.