!Ban & !Infoban

By Purcell on Dec 22, 2008

NEW: only @ and % can use it!

I maked a !ban & !infoban snippet

Created by Purcell, Modified by Khmer

Image

on *:connect:{
  var %x 1
  var %y $read(Baninfo.txt,0)
  while %x <= %y {
    hload -si $gettok($read(Baninfo.txt,%x),1,32) Baninfo.ini $gettok($read(Baninfo.txt,%x),1,32)
    inc %x
  }
}

on *:text:!ban*:#:{
  if ($1- == !ban) { /notice $nick Say: !ban <Name> <Reason> | halt
  }
  if $gettok($read(Baninfo.txt,w,$2),2,32) !== $null {
    .msg # That name has been banded.
    halt
  }
  else {
    if ($nick isop $chan) || ($nick ishop $chan) {
    hmake $2
    hadd $2 user $2
    hadd $2 bannedby $nick
    hadd $2 reason $3-
    hadd $2 channel $chan
    hadd $2 issue $fulldate
    hsave -i $2 baninfo.ini $hget($2,user)
    write -l1 baninfo.txt $calc($read(baninfo.txt,-1) + 1)
    write baninfo.txt $2 $nick
    timer 1 1 .msg # 14 Created by 4 Purcell, 14 Modified by 4 Khmer 14
    timer 1 2 .msg # User:  $2  , Bannedby:  $nick  , Reason:  $3- 
    timer 1 4 /mode # +b $address($2,2)
    timer 1 5 /notice $2 14 Say 4 !infoban 14 for see why ur bannnedby:
    timer 1 7 /kick # $2 $3-
  }
  else { /notice $nick Your don't got @ or % ! | halt
  } 
}

on *:TEXT:!infoban:?:{
  if !$hget($nick) {
    .msg $nick Ur not banded! | halt
  }
  else {
    msg $nick ----------Ban Information----------
    msg $nick [User: $+($hget($nick,user),])
    msg $nick [Channel: $+($hget($nick,channel),])
    msg $nick [Bannedby: $+($hget($nick,bannedby),])
    msg $nick [Reason: $+($hget($nick,reason),])
    msg $nick [Issue: $+($hget($nick,issue),])
    msg $nick ----------Ban Information----------
    halt
  }
}    

Comments

Sign in to comment.
Purcell   -  Mar 17, 2010

Version: 1.2

  • Added ban by Address.
 Respond  
Jethro   -  Sep 28, 2009

if ($nick isop $chan) || ($nick ishop $chan) {
can be combined into:

if ($nick($chan,$nick,oh)) {

And yes, instead of banning $2, you should consider using $address($2,2)
By banning nicks, people can change them and bypass the ban instantly.

 Respond  
TheProdigY   -  Sep 27, 2009

You should add the $address to it too. It only bans the nick, not the address. So all they have to do is change nicks and be right back in the room.

 Respond  
Purcell   -  Feb 24, 2009

Beceause hes banned...

U first need unban him then..

 Respond  
nivLa 10   -  Feb 24, 2009

i mean if i ban user.. and i ban him again.. the codes didnt work

 Respond  
Purcell   -  Feb 23, 2009

What u mean?

 Respond  
nivLa 10   -  Feb 23, 2009

hey... this script is 1 time can ban? in same IP? just asking

 Respond  
ReFuSeR   -  Feb 02, 2009

A little mistake in the !ban which I fixed...

on *:text:!ban*:#:{
  if ($1- == !ban) { /notice $nick Say: !ban <Name> <Reason> | halt
  }
  if $gettok($read(Baninfo.txt,w,$2),2,32) !== $null {
    .msg # That name has been banded.
    halt
  }
  else {
    if ($nick isop $chan) || ($nick ishop $chan) {
      hmake $2
      hadd $2 user $2
      hadd $2 bannedby $nick
      hadd $2 reason $3-
      hadd $2 channel $chan
      hadd $2 issue $fulldate
      hsave -i $2 baninfo.ini $hget($2,user)
      write -l1 baninfo.txt $calc($read(baninfo.txt,-1) + 1)
      write baninfo.txt $2 $nick
      timer 1 1 .msg # 14 Created by 4 Purcell, 14 Modified by 4 Khmer 14
      timer 1 2 .msg # User:  $2  , Bannedby::  $nick  , Reason:  $3- 
      timer 1 4 /mode # +b $2
      timer 1 5 /notice $2 14 Say 4 !infoban 14 for see why ur bannnedby:
      timer 1 7 /kick # $2 $3-
    }
    else /notice $nick Your don't got @ or % ! | halt
  } 
}
 Respond  
Purcell   -  Jan 09, 2009

I maked timer becease then they can see who, and the reason and al.

 Respond  
Purcell   -  Dec 24, 2008

U can add too: If u want that other players can see too why ur banded:

on *:TEXT:!infoban*:?:{
  if !$hget($2) {
    .msg $nick $2 is not banned! | halt
  }
  else {
    msg $nick ----------Ban Information----------
    msg $nick [User: $+($hget($2,user),])
    msg $nick [Channel: $+($hget($2,channel),])
    msg $nick [Bannedby: $+($hget($2,bannedby),])
    msg $nick [Reason: $+($hget($2,reason),])
    msg $nick [Issue: $+($hget($2,issue),])
    msg $nick ----------Ban Information----------
    halt
  }
}    
 Respond  
Purcell   -  Dec 23, 2008

NEW: only @ and % can use it!

 Respond  
Kirby   -  Dec 22, 2008

Might want to add ban masks?
The snapshot of this snippet bans at mask 1, default.
Maybe add a ban mask function, for example:
!ban [Name] [Mask] [Reason]?

 Respond  
Purcell   -  Dec 22, 2008

:)

 Respond  
Aucun50   -  Dec 22, 2008

Tested it, works good if i didn't already have a ban script i would use this one.

 Respond  
PuNkTuReD   -  Dec 22, 2008

gd work pucell nice little snippet

 Respond  
Purcell   -  Dec 22, 2008

I hope u like!

Thanks PunkTuReD

 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.