bot type on kick

By _Lestat_ on Oct 29, 2011

just another little snippet I made to kick pretty self explanitory for a bot. Uses are !kon nick !koff nick

on *:text:!kon*:#: { if ($nick isop $chan) {
    set %kick $2 
    msg $chan $2 next time you get talk you will be kicked 
  } 
} 
on *:text:!koff:#: { if ($nick isop $chan) { 
    msg $chan %kick you have been taken off the kick list 
    unset %kick 
  }
}
on *:text:*:#: { if ($nick == %kick) { kick # %kick 
  } 
}

Comments

Sign in to comment.
Fuzionx   -  Oct 30, 2011

Hehe you're welcome :)

 Respond  
Jethro   -  Oct 29, 2011

You're correct, Fuzionx. I mispositioned that if check. :P I edited the code to reflect that just now. Thanks for spotting the fallacy. I'm only human and mistakes happen to the best of us.

 Respond  
Fuzionx   -  Oct 29, 2011

Jethro, with your code non-ops won't be kicked.

 Respond  
_Lestat_   -  Oct 29, 2011

yes I was actually looking for the way to kick even on nick change as I have had this problem before and the channel would set $chan on !Kon and unset $chan so that way will only be used on that nick in that chan?

 Respond  
Jethro   -  Oct 29, 2011

One thing nobody realizes is that a user can change his or her nickname to avoid being kicked. Here is my take on yours:

on @*:text:*:#:{
  tokenize 32 $strip($1-)
  if ($nick == %kick) {
    kick # $v1
  }
  if ($nick isop #) && ($regex($1,/^!ko(n|ff)/iS)) {
    if ($regml(1) == n) && ($$2 ison #) {
      set %kick $2
      msg # $2 next time you get talk you will be kicked
      halt
    }
    msg # %kick you have been taken off the kick list
    unset %kick
  }
}

As Savage_CL has pinpointed that this script can only watch one nickname at a time, so you may want to consider using $addtok() / $istok() and $remtok() to match more than one nickname.

 Respond  
Fuzionx   -  Oct 29, 2011

You might want to change your code to:

on *:text:!kon *:#: { 
  if ($nick isop $chan && $$2 ison $chan) {
    set %kick $2 
    msg $chan $2 next time you get talk you will be kicked 
  }
}

Hence the space between !kon and the *, and the $$2. This makes sure $2, the nickname, is set and that it is in your channel.

You should also combine those three text events.

 Respond  
Savage_CL   -  Oct 29, 2011

This would be a great place to explore the wonders of token identifiers. Use of $addtok, $remtok, and $istok would allow for multiple nicks to be monitored at the same time. Also, and this is just an anal thing for me, don't put your first if statement in the same line as an event. Space it out. space is your friend.

Happy Scripting :)

-Savage_CL

 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.