Skip to content
General Snippets

Word Kicker

A TG007 community discussion started by Travis.

Discussion 6 posts
Page 1 of 1
Open
Topic #13576 · 6 published posts · 6,889 views

Kicks for chosen word strings.

 

I chose individual text events because I don't know Regex and using a while loop for every single text event seemed pretty weak and unstable.

 

on *:start:{
  if (!%cuss_b) set %cuss_b 10
}
alias cuss {
  if ($1 = kick) {
    if ($me isop $2) { access $2 add deny $4 %cuss_b :SwearKick( $3 ) | kick $2-3 SwearKick }
  }
  elseif ($1 = -a) {
    hadd -m prot cuss $addtok($hget(prot,cuss),$2-,46)
    var %xe_ = $lines($qt($script))) - 1
    write $+(-il,%xe_) $qt($script) on $+(@*:text:*,$2-,*:#:,$chr(123)) cuss kick $!chan $!nick $!address $chr(125)
    .load -rs $qt($script)
  }
  elseif ($1 = -d) {
    hadd -m prot cuss $deltok($hget(prot,cuss),$2,46)
    write $+(-dw,*,$2,*) $qt($script)
    .load -rs $qt($script)
  }
}
alias pp_cuss {
  if ($gettok($hget(prot,cuss),$1,46)) return $iif($ifmatch !isnum,$ifmatch) :cuss -d $ifmatch
}
menu channel,status,menubar {
  -
  $iif($group(#swear) = on,$style(1)) Swear Kick
  .Turn $iif($group(#swear) = on,Off,On):{ $iif($group(#swear) = on,.disable,.enable) #swear }
  .-
  .Ban Length ( %cuss_b min. ):set %cuss_b $$?="Enter ban length in minutes."
  .-
  .Add Word:cuss -a $$?="Enter text string to kick for."
  .$iif($hget(prot,cuss),Del Word)
  ..$submenu($pp_cuss($1))
}
#swear off
raw 822:*:{
  if (%822c_ [ $+ [ $1 ] ] > 3) return
  inc -u2 %822c_ [ $+ [ $1 ] ]
  var %821_ni = $right($gettok($rawmsg,1,33),-1)
  if ($me isop $1) {
    var %cus_ = $numtok($hget(prot,cuss),46)
    while (%cus_) {
      if ($gettok($hget(prot,cuss),%cus_,46) isin $2-) cuss kick $1 %821_ni $address
      dec %cus_
    }
  }
}
;text events
#swear end

Travis would be good if you could comment some of it so people know what it does :)

 

 

Spam Honeypot - http://www.haggistech.co.uk/honey(humans do not register)

Menu:

Swear Kicker

 

Turn Off/On

Change ban duration

 

Add Word(s)

Delete Word(s)

 

 

 

 

It kicks for word strings in text events and away events.

 

 

Doh! I'll add action to it soon. :oops:

Is this able to kick on special characters of some sort? I know some people use weird, funky ones in combination of profanity. To add, I suppose one has to convert them or else mirc won't be able to read them.

 

You enter the words you want to kick for.

 

You know, because mIRC doesn;t support unicode in dialogs, that also means $input and $$?="" windows don't translate unicode. So when the box pops up for you to enter your string it turns unicode into ?'s.

 

Im thinking I should make a custom window alias that acts as an input box to fix this issue.

 

I can tell you how to manually add special characters.

 

Add any word you want to the list. Then open the editor and find the text event that has your word. Replace the word with your special character one.

 

Then you will have to enter this code in the editbox. Make sure it has two forward slashes.

 

//hadd prot cuss $addtok($hget(prot,cuss),<Enter your unicode search string here>,46)

Edited Oct 19, 2009 5:49 PM by Travis

thx