kick/ban

By anthony1293 on Jun 06, 2009

with this you can either set a permeant ban or a timed ban.
commands:
!kb - sets a regular ban
!ban - sets a timed ban
!kick - kicks

this also takes off +e on someone's name/address so they will be banned/kicked no matter what. (only if the bot is halfop+)

edited: cleaned it up a little bit.

on $*:TEXT:/^[!@.]ban/Si:#: {
  if ($nick isop $chan) || ($nick ishop $chan) {
    if ($1 != !ban) { halt
    }
    if ($2 == $null) {
      notice $nick please enter a nick to ban! | halt 
    }
    if ($2 isop $chan) && ($nick ishop $chan) || ($address($2,2) == $address($me,2)) {
      notice $nick you cannot ban $2 from $chan | halt
    }
    if  ($3 != $null) {
      ban -ku $+ $calc($3 * 60) $chan $address($2,2) $4-
      .kick $chan $2 14you've been banned for4 $3 14$iif($3 == 1,minute,minutes) $+ . reason:4 $iif($4- == $null,no reason.,$4-) | halt
    }
    if ($3 == $null) {
      notice $nick 14if the ban time in seconds is not specified the default is4 120 14seconds
      ban -ku120 $chan $address($2,2)
      kick $chan $2 14 you've been banned for2 14minutes. reason: $iif($4- == $null,no reason.,$4-) | halt 
    }
  }
  else notice $nick access denied 
}
on $*:TEXT:/^[!@]kb/Si:#: { 
  if ($2 == $null) {
    notice $nick you must enter a nick to kb! | halt 
  }
  if ($2 isop $chan) && ($nick ishop $chan) {
    notice $nick you cannot ban $2 from $chan | halt
  }
  if ($nick isop $chan) || ($nick ishop $chan) || ($wildsite == $address($me,2)) { 
    mode $chan -e $address($2,2)
    mode $chan -e $2
    ban $chan $address($2,2)
    kick $chan $2 $iif($3- == $null,no reason.,$3-)
  }
}
on $*:TEXT:/^[!@](k|ick)/Si:#: {
  if ($2 == $null) {
    notice $nick you must enter a nick to kick! | halt 
  }
  if ($1 == $kill) { halt }
  if ($2 isop $chan) && ($nick ishop $chan) || ($address($2,2) == $address($me,2)) {
    notice $nick you cannot kick $2 from $chan | halt
  }
  if ($nick isop $chan) || ($nick ishop $chan) || ($wildsite == $address($me,2)) { 
    .kick $chan $2 $iif($3- == $null,no reason.,$3-)
  }
}
on *:BAN:#: {
  if ($me isop $chan) {
    mode $chan -e $address($2,2)
    mode $chan -e $2
  }
}
on *:KICK:#: {
  if ($me isop $chan) {
    mode $chan -e $2 
    mode $chan -e $address($2,2) 
  }
}

Comments

Sign in to comment.
morfina   -  Feb 08, 2010

Great script but only one thing...

[16:38:00] * member was kicked by TESTTT (you've been banned for 1 $iif($3 == 1,minute,minutes). reason: testing)

 Respond  
anthony1293   -  Jun 07, 2009

ayon, i added that because if it was just ban then the person would stay in the channel until they either left or got kicked. so i thought that would make it easier.

John Daniels  -  Jan 22, 2013

The halt was stopping it from banning and kicking that is what i noticed because when i tried banning it said can not kick [nick] from [#channel]

Sign in to comment

Weasel   -  Jun 06, 2009

good, could do

 on *:text:!kb*:#: {

 if ($4 isnum) mode # +b $2 | kick # $nick $3 | timer1 1 $4 $calc($4 * 60)
 Respond  
Ayon   -  Jun 06, 2009

looks good, but you should check that $3 is a number .. $regex($3,/[\d]/) or something

and why did you add a kick in !ban? thought that was what !kb was for.. bug might just be me misunderstanding the purpose :)

also why do you have 2x

if (($nick isop $chan) || ($nick ishop $chan) && (!$3))

 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.