Jump to content

Word Kicker


Guest Travis

Recommended Posts

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

Link to comment
Share on other sites

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:

Link to comment
Share on other sites

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 by Travis
Link to comment
Share on other sites

  • 3 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...