bad word kick

By token on Sep 25, 2007

simple. to change swear words go to the swear variable %swear in each event and type the words you want to be blocked seperated by commas.

commands:
/swear.kick enable (action/text) - disables your parameters
/swear.kick disable (action/text) - enables your parameters
/swear.kick status - displays the status of both groups.

#swear.kick.text on
on @*:text:*:#:{ 
  var %swear = darn,damn
  var %i = $numtok(%swear,44)  
  var %u = 2
  while (%i) { 
    if ($istok($1-,$gettok(%swear,%i,44), 32)) {
      var %n @,%
      if ($left($nick($chan, $nick).pnick,1) != $gettok(%n,1-,44)) {
        inc $+(%,swear,$chr(46),$nick,$chr(46),$active,$chr(46),$wildsite)
        var %tmp.time $($+(%,swear,$chr(46),$nick,$chr(46),$active,$chr(46),$wildsite),2)
        if (%tmp.time < %u) { 
          notice $nick This is your $ord(%tmp.time) warning. Your limit is %u swears. Any more of this conduct and you will be kicked.
        } 
        if (%tmp.time > %u) { 
          ban -ku300 # $nick This was your $ord(%tmp.time) warning, you are now banned.
          unset $+(%,swear,$chr(46),$nick,$chr(46),$active,$chr(46),$wildsite)
        } 
      } 
    }
    dec %i
  }
}

#swear.kick.text end

#swear.kick.action on

on @*:action:*:#:{ 
  var %swear = darn,damn
  var %i = $numtok(%swear,44)  
  var %u = 2
  while (%i) { 
    if ($istok($1-,$gettok(%swear,%i,44), 32)) {
      var %n @,%
      if ($left($nick($chan, $nick).pnick,1) != $gettok(%n,1-,44)) {
        inc $+(%,swear,$chr(46),$nick,$chr(46),$active,$chr(46),$wildsite)
        var %tmp.time $($+(%,swear,$chr(46),$nick,$chr(46),$active,$chr(46),$wildsite),2)
        if (%tmp.time <= %u) { 
          notice $nick This is your $ord(%tmp.time) warning. Your limit is $calc(%u +1) swears. Any more of this conduct and you will be kicked.
        } 
        if (%tmp.time > %u) { 
          ban -ku300 # $nick This was your $ord(%tmp.time) warning, you are now banned.
          unset $+(%,swear,$chr(46),$nick,$chr(46),$active,$chr(46),$wildsite)
        } 
      } 
    }
    dec %i
  }
}

#swear.kick.action end

on *:disconnect:{ 
  unset %swear.*
}

on *:exit:{
  unset %swear.*
}

alias swear.kick {
  if ($1) { 
    if ($v1 = enable) {
      if ($2) { 
        if ($v1 = text) enable #swear.kick.text 
        if ($v1 = action) enable #swear.kick.action
      }
    }
    if ($v1 = disable) { 
      if ($2) { 
        if ($v1 = text) disable #swear.kick.text 
        if ($v1 = action) disable #swear.kick.action
      }
    }
    if ($v1 = status) echo $color(info) -a Current status for group $+(",#swear.kick,",$chr(32),text,$chr(32),events:) $group(#swear.kick.text).status and for $+(",#swear.kick,",$chr(32),action,$chr(32),events:) $group(#swear.kick.action).status 
  }
}

Comments

Sign in to comment.
token   -  Nov 29, 2007

updated modified for \'proper\' use of /var and will be updating again soon with a dialog to make it a bit easier to view, edit, and add words. ^^

 Respond  
Ghost-lit Warder   -  Sep 26, 2007

Good job.

 Respond  
token   -  Sep 25, 2007

alright i fixed the snippet up. i just bagged the dialog and went with an alias to disable/enable ceretain events. you now have full configuration over the script and it shouldn\'t be hard to edit the words. any other feedback would be great. =)

 Respond  
guest598594   -  Sep 25, 2007

you should also add an option in either the dialog or a menu, to turn it on/off

 Respond  
token   -  Sep 25, 2007

thanks guys ^^ this script was a bit of a rush so it\'s not truly perfect, i now have more free time on hand and will add much more options to the dialog thanks again for your feedback =P

 Respond  
guest598594   -  Sep 25, 2007

which is

on *:disconnect:{

 Respond  
Olliegod   -  Sep 25, 2007

Your on quit event will trigger anytime anyone quits irc. You should change it to check it the nick is yours.

 Respond  
guest598594   -  Sep 25, 2007

its not that great, you should add a remove button when you click a word

rather than looping all of those variables, simply do

/didtok <name> <id> <C> <%variable>

also, why dont you just do

set %swear $addtok(%swear,$!,44)
 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.