Channel Protections

By chicknh8r on Nov 21, 2005

This Is My First Attempt at writing a Channel "Protection" Script. This is intended to "Babysit" your channel while your afk. That way, if people in your channel decide to be foolish and ban/deop/change channel modes, this script, when enabled, will auto-reverse their actions. I wrote it with the idea you would be installing this to your channel bot.
I also wrote it so "owner" is authorized to enable/disable Protections, via address. That way, some noob can't accidentally change to your nick and have access options. 4 Types of protections. BAN, OP, HOP, & MODE. These when enabled will REVERSE action performed.

Copy and Paste in Remote. (alt R)
Make Sure you change "#Crib" to YOUR CHANNEL

Where < your address here > is, input your appropriate address and mask, (!$Address($nick,5) )
From your bot, you can right click on channel or nicklist to access options.

Any FeedBack/Simpler Way to write this would be greatly appreciated!

#BanProt off

on *:BAN:#Crib: {
  if ($nick == $me) || /_owner  { goto bfinish }
  if ( $group(#BanProt).status == ON )  {  mode $chan -b $banmask  |  msg $chan ALL BANS Currently DISABLED }  
  :bfinish
  halt
}

#BanProt end

#OpProt off

on *:OP:#Crib: {
  if ($nick == $me) || /_owner  { goto ofinish }
  if ( $group(#OpProt).status == ON ) {  mode $chan $replacex($1-,+,-,-,+) $opnick  |  msg $chan  OP MODES Currently DISABLED }
  :ofinish
  halt
}

#OpProt end

#HopProt off

on *:HELP:#Crib: {
  if ($nick == $me) || /_owner  { goto hfinish }
  if ( $group(#HopProt).status == ON ) {  mode $chan $replacex($1-,+,-,-,+) $hnick  |  msg $chan  HOP MODES Currently DISABLED }
  :hfinish
  halt
}

#HopProt end

#ModeProt off

on *:MODE:#Crib: {
  if ($nick == $me) || /_owner  { goto mfinish }
  if ( $group(#ModeProt).status == ON ) {  
    mode $chan $replacex($1-,+,-,-,+)  |   msg $chan  Channel MODES Currently DISABLED
  }
  :mfinish
  halt
}

#ModeProt end

on *:LOAD: {
  /_cpstatus
  echo -a 12Channel Protections Successfully LOADED 
}

on *:Unload: {
  /_offgroups
  echo -a 12Channel Protections Successfully UNLOADED 
}

on *:EXIT: {
  /_offgroups
  echo -a 12Channel Protections Successfully UNLOADED 
}

menu channel,nicklist {
  Channel  Protections
  . All Protections 
  ..ON: .set %CribProt. [ $+ [ $chan ] ] [ $+ [ $chan ] ]  |  /_ongroups  | msg $chan 12All Protections ON  
  ..OFF: .unset %CribProt. [ $+ [ $chan ] ] [ $+ [ $chan ] ]  |  /_offgroups | msg $chan 12All Protections OFF
  . BanProt ( $+ $group(#BanProt).status $+ )
  ..ON: .set %CribProt. [ $+ [ $chan ] ] [ $+ [ $chan ] ]  | .enable #BanProt  | msg $chan 12Ban Protection ON  
  ..OFF: .unset %CribProt. [ $+ [ $chan ] ] [ $+ [ $chan ] ]  | .disable #BanProt | msg $chan 12Ban Protection OFF
  . OpProt ( $+ $group(#OpProt).status $+ )
  ..ON: .set %CribProt. [ $+ [ $chan ] ] [ $+ [ $chan ] ]  | .enable #OpProt  | msg $chan 12OP Protection ON  
  ..OFF: .unset %CribProt. [ $+ [ $chan ] ] [ $+ [ $chan ] ]  | .disable #OpProt | msg $chan 12OP Protection OFF
  . HopProt ( $+ $group(#HopProt).status $+ )
  ..ON: .set %CribProt. [ $+ [ $chan ] ] [ $+ [ $chan ] ]  | .enable #HopProt  | msg $chan 12Hop Protection ON  
  ..OFF: .unset %CribProt. [ $+ [ $chan ] ] [ $+ [ $chan ] ]  | .disable #HopProt | msg $chan 12Hop Protection OFF
  . ModeProt ( $+ $group(#ModeProt).status $+ )
  ..ON: .set %CribProt. [ $+ [ $chan ] ] [ $+ [ $chan ] ]  | .enable #ModeProt  | msg $chan 12Mode Protection ON  
  ..OFF: .unset %CribProt. [ $+ [ $chan ] ] [ $+ [ $chan ] ]  | .disable #ModeProt | msg $chan 12Mode Protection OFF
  .-
}

on *:TEXT:!help*:#Crib: {  /_commands  }

on *:TEXT:!cp*:#Crib: { 
  if ($2 == $null) {  msg $chan 14You Have Not Specified A Request/Command9 $nick   |  /_commands  |  /_helpowner  |  goto unknown  }
  if (protections isin $2) { msg $chan :: Channel Protections Regulate - Bans Ops Hops Modes ::  }
  if (status isin $2) {
    msg $chan 9Current Channel Protections Status:
    /timerprot1 1 1 msg $chan 14Ban Protection is9 $group(#BanProt) 
    /timerprot2 1 1 msg $chan 14Op Protection is9 $group(#OpProt) 
    /timerprot3 1 2 msg $chan 14Hop Protection is9 $group(#HopProt) 
    /timerprot4 1 2 msg $chan 14Channel Mode Protection is9 $group(#ModeProt) 
    halt
  }
  if /_owner  {
    if (fullon isin $2) {  /_ongroups  |  msg $chan 14All Channel Protections 9ENABLED   }
    if (fulloff isin $2) {  /_offgroups  |  msg $chan 14All Channel Protections 9DISABLED   }
    if (bpon isin $2) { .enable #BanProt  |  msg $chan 14Ban Protection 9ON }
    if (bpoff isin $2) { .disable #BanProt  |  msg $chan 14Ban Protection 9OFF }
    if (opon isin $2) { .enable #OpProt  |  msg $chan 14Op Protection 9ON }
    if (opoff isin $2) { .disable #OpProt  |  msg $chan 14Op Protection 9OFF }
    if (helpon isin $2) { .enable #HopProt  |  msg $chan 14HoP Protection 9ON }
    if (helpoff isin $2) { .disable #HopProt  |  msg $chan 14HoP Protection 9OFF }
    if (modeon isin $2) { .enable #ModeProt  |  msg $chan 14Mode Protection 9ON }
    if (modeoff isin $2) { .disable #ModeProt  |  msg $chan 14Mode Protection 9OFF }
    halt
  }
}

alias _commands {
  msg $chan 9Command Options : 9Channel Protection- 14!cp protections,14!cp status ::
}

alias _owner {
  (<your address here> iswm $Address($nick,5))
}

alias _ongroups {
  .enable #BanProt
  .enable #OpProt
  .enable #HopProt
  .enable #ModeProt
}

alias _offgroups {
  .disable #BanProt
  .disable #OpProt
  .disable #HopProt
  .disable #ModeProt
}

alias _helpowner {
  if (<your address here> iswm $Address($nick,5)) {
    .notice $nick Your Commands Available :: !cp - fullon, fulloff, banon, banoff, opon, opoff, helpon, helpoff, modeon, modeoff ::
  }
}

alias _cpstatus {
  msg #Crib 9Current Channel Protections Status:
  /timerprot1 1 1 msg #Crib 14Ban Protection is9 $group(#BanProt) 
  /timerprot2 1 1 msg #Crib 14Op Protection is9 $group(#OpProt) 
  /timerprot3 1 2 msg #Crib 14Hop Protection is9 $group(#HopProt) 
  /timerprot4 1 2 msg #Crib 14Channel Mode Protection is9 $group(#ModeProt) 
  halt
}

Comments

Sign in to comment.
ZabuzaMomochi   -  Jun 06, 2007

You might also want it to set mode +Q so nobody can kick, and then put mode protection on

 Respond  
AHBARAR   -  Jun 05, 2007

just change from #Cribs to #
like
on *:BAN:#: {

 Respond  
Jake   -  Nov 29, 2006

You might want to change the channel name on it. I\'m pretty sure not everyone uses #Cribs

 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.