Swear pro with specified channels dialog

By kddjoe on Sep 11, 2008

I've been using this snippet for a while when suddenly someone asked me to modify it so that only specified channels will be protected under this snippet. So I simply made a dialog where you can enter your channels which you want to protect it. It's a swearing protection for channels. It's kind of messy by the way but its still good enough for me. As you can see there are snippet for text swearing and notice swearing as well. To set the channels you want to protect, simply right click at irc windows and click on Protection > Channels To Protect. Enter the channel like this : #hot,#club,#happy, etc. and click add. That's all.. oh and just copy this snippet and paste it into your remote editor.

Please leave your comment. Thanks.

#swear off
on 1:TEXT:*kima*:%chanprot:{
  if ($nick isop #) { return }
  if ($nick isvo #) { return }
  if ($me isop #) { ban -ku600 # $nick Swearing detected %logox Banned for : 10mins 
  }
}

on 1:TEXT:*fuck*:%chanprot:{
  if ($nick isop #) { return }
  if ($nick isvo #) { return }
  if ($me isop #) { ban -ku600 # $nick Swearing detected %logox Banned for : 10mins 
  }
}

on 1:TEXT:*amput*:%chanprot:{
  if ($nick isop #) { return }
  if ($nick isvo #) { return }
  if ($me isop #) { ban -ku600 # $nick Swearing detected %logox Banned for : 10mins 
  }
}
on 1:TEXT:*entot*:%chanprot:{
  if ($nick isop #) { return }
  if ($nick isvo #) { return }
  if ($me isop #) { ban -ku600 # $nick Swearing detected %logox Banned for : 10mins 
  }
}
on 1:TEXT:*lancau*:%chanprot:{
  if ($nick isop #) { return }
  if ($nick isvo #) { return }
  if ($me isop #) { ban -ku600 # $nick Swearing detected %logox Banned for : 10mins 
  }
}

on 1:notice:*kima*:%chanprot:{
  if ($nick isop #) { return }
  if ($nick isvo #) { return }
  if ($me isop #) { ban -ku600 # $nick Swearing detected %logox Banned for : 10mins 
  }
}

on 1:notice:*fuck*:%chanprot:{
  if ($nick isop #) { return }
  if ($nick isvo #) { return }
  if ($me isop #) { ban -ku600 # $nick Swearing detected %logox Banned for : 10mins 
  }
}

on 1:notice:*amput*:%chanprot:{
  if ($nick isop #) { return }
  if ($nick isvo #) { return }
  if ($me isop #) { ban -ku600 # $nick Swearing detected %logox Banned for : 10mins 
  }
}
on 1:notice:*entot*:%chanprot:{
  if ($nick isop #) { return }
  if ($nick isvo #) { return }
  if ($me isop #) { ban -ku600 # $nick Swearing detected %logox Banned for : 10mins 
  }
}
on 1:notice:*lancau*:%chanprot:{
  if ($nick isop #) { return }
  if ($nick isvo #) { return }
  if ($me isop #) { ban -ku600 # $nick Swearing detected %logox Banned for : 10mins 
  }
}

alias -l swear.words { RETURN shit.bitch.kentot.cock.pussy.cunt.blowjob.ass.asshole.paler.pelir.penis.cipap }

ON @*:TEXT:*:%chanprot: {
  IF ($nick isop #) return
  if ($nick isvo #) return
  VAR %x = $strip($1-) , %i = $numtok($swear.words,46)
  WHILE (%i) {
    IF ($istok(%x,$gettok($swear.words,%i,46),32)) {
      ban -u600 # $nick $wildsite
      kick # $nick Swearing detected %logox Banned for : 10mins 
      RETURN
    }
    DEC %i
  }
}

ON @*:notice:*:%chanprot: {
  IF ($nick isop #) return
  if ($nick isvo #) return
  VAR %x = $strip($1-) , %i = $numtok($swear.words,46)
  WHILE (%i) {
    IF ($istok(%x,$gettok($swear.words,%i,46),32)) {
      ban -u600 # $nick $wildsite
      kick # $nick Swearing detected %logox Banned for : 10mins 
      RETURN
    }
    DEC %i
  }
}
#swear end

dialog chanp {
  title "Channels To Protect"
  size -1 -1 129 52
  option -dbu
  box "Enter Channel" 1, 2 4 125 22
  edit "" 2, 6 12 86 10,autohs
  button "Add" 3, 95 11 30 12
  button "List" 4, 5 27 32 13
  button "Clear" 6, 39 27 32 13
  button "Exit" 7, 93 27 32 13,cancel
}

on *:dialog:chanp:sclick:3:{
  set %chanprot $did(2).text | echo -a Added %chanprot To Favorites.
}

on *:dialog:chanp:sclick:*:{
  if ($did == 4) { echo -a Your Protected Channels Are %chanprot }
  if ($did == 6) { unset %chanprot | echo -a Favourite Channels Cleared. }
}

menu menubar,channel,status {
  -
  Protection
  .Channels To Protect:/dialog -m chanp chanp | echo -a 4ATTENTION : Use This Method To Add More Than 1 Channel(ex:#hot,#club)
}

menu menubar,channel {
  Protection
  .Chan Pro
  ..Swearing ( $+ $group(#swear).status $+ ): {
    echo -a Swear Protection $iif( $group(#swear).status == ON, Disabled, Enabled) %sc
    $iif($group(#swear).status == on, .disable, .enable) #swear
  } 
}

Comments

Sign in to comment.
kddjoe   -  Sep 12, 2008

Owh.. thanks guys.. I'll try it both

 Respond  
napa182   -  Sep 11, 2008

the problem with setting channels like the way you have it set is say i set 5 channels and the next day someone wants me to add their channel to run the script in. i would have to retype all the channels i had in before along with the new channel im adding.
you can fix that by useing tokens.

so instead of this line

on *:dialog:chanp:sclick:3:{
  set %chanprot $did(2).text | echo -a Added %chanprot To Favorites.
}

you can do this

on *:dialog:chanp:sclick:3:{
  set %chanprot $addtok(%chanprot,$did(2).text,44) | noop $input(Channel $did(2).text Added,uio,Added)
}

and instead of useing

ON @*:TEXT:*:%chanprot: {
  IF ($nick isop #) return
  if ($nick isvo #) return 

i would do

ON @*:TEXT:*:#: {
 if ($istok(%chanprot,$chan,44) && $nick(#,$nick,r)) { 
 Respond  
guest598594   -  Sep 11, 2008
on 1:TEXT:*kima*:%chanprot:{
  if ($nick isop #) { return }
  if ($nick isvo #) { return }
  if ($me isop #) { ban -ku600 # $nick Swearing detected %logox Banned for : 10mins 
  }
}

Couple of suggestions:

1) You can use on @*:TEXT... to substitute if ($me isop $chan)
2) Rather than ending if the nick isop or voice, you can just do

  if ($me isop $chan && $nick isreg $chan) { ban -k... }

Or maybe instead of an on text per word you could do:

on @*:text:*:%somechan:{
  if ($nick isreg $chan) {
    if (WORD isin $1- || WORD2 isin $1- || WORD3 isin $1-) {
      ban -k...
    }
  }
}
 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.