Made this script quite a while ago.
First off, i'd like to thank Blady and Alcoholx for helping me out with this script.
To be able to use this script you have to create a txtfile named users.txt and put your host in it. The host should be equal to *!*@auth.users.quakenet.org.
Usage
!bl <add> <nick/host> ?reason? ?-global? - Add someone to the blacklist (Reason and Global are optional)
!bl del <host> ?-global? - Delete a blacklisted host (Global is optional)
!bl info - Author and Scriptversion
!bl help - Shows you the available commands
!bl list ?-global? - Shows you a list of your added blacklisted hosts (Global is optional)
Global would mean, the bot would ban the person on ALL channels the bot is on.
This script is no longer in development
Here goes
- Code: Select all
on *:text:!bl*:#: {
if ($read(users.txt,w,$address($nick,2))) {
if (!$2) { .notice $nick Syntax: $1 <add|del|info|help|list> | halt }
elseif ($2 == help) { .notice $nick Syntax: $1 <add|del|info|help|list> | halt }
elseif ($2 == info) { .notice $nick %auth.ver | halt }
elseif ($2 == add) {
if (!$3) { .notice $nick Syntax: $1 <add> <nick/host> ?reason? ?-global? | halt }
var %reason You are blacklisted from this channel
var %reasong You are globally blacklisted from all known channels
var %mask = $address($3,2)
if (*!*@* iswm $3) { var %mask = $3 }
if ($gettok($1-,-1,32) == -global) {
if ($4 && $4 != -global) { var %reasong $remtok($4-,-global,32) }
writeini bl.ini global %mask %reasong
.notice $Nick Done: Added %mask to global blacklist with reason: %reason
;; kick/ban on all channel
var %x = 1, %y = 0
while ($comchan($me,%x)) {
if ($me isop $v1) {
.timer 1 %y pwnd.noob $v2 %mask %reasong
inc %y 4
}
inc %x
}
}
else {
if ($4) { var %reason $4- }
pwnd.noob $chan %mask %reason
writeini bl.ini $chan %mask %reason | .notice $Nick Done. Added %mask to $chan blacklist with reason: %reason }
}
elseif ($2 == del) {
if (!$3) { .notice $nick Syntax: $1 $2 <host> ?-global? | halt } {
var %mask = $address($3,2)
if (*!*@* iswm $3) { var %mask = $3 }
if ($4 == -global) {
if ($ini(bl.ini,global,$3)) { remini bl.ini global $3 | .notice $nick Done, removed $3 from global blacklist | removebans %mask }
else { .notice $Nick That banmask cannot be found. }
}
elseif (!$4) {
if ($ini(bl.ini,$chan,$3)) { remini bl.ini $chan $3 | .notice $nick Done, removed $3 from channel blacklist. | mode $chan -b $3 }
else { .notice $nick That banmask cannot be found. }
}
}
}
elseif ($2 == list) {
if ($3 == -global) var %topic = Global
else var %topic = $chan
notice $nick %topic banlist:
var %x = 1, %y = 2
while ($ini(bl.ini,%topic,%x)) {
var %h = $v1, %r = $readini(bl.ini,%topic,%h)
.timer 1 %y notice $nick Host: %h - Reason: %r
inc %x
inc %y 2
}
}
}
}
;The join Event
on *:join:#: {
if ($ini(bl.ini,global,$address($nick,2))) {
mode $chan -o+b $nick $address($nick,2) | kick $chan $nick Global blacklist: $readini(bl.ini,global,$address($nick,2))
}
else {
if ($ini(bl.ini,$chan,$address($nick,2))) {
mode $chan -o+b $nick $address($nick,2) | kick $chan $nick Blacklisted: $readini(bl.ini,$chan,$address($nick,2)) }
}
}
;; /pwnd.noob <#chan> <host> [reason]
alias pwnd.noob {
if ($left($1,1) != $chr(35)) halt
if (*!*@* !iswm $2) halt
var %x = 1
while ($ialchan($2,$1,%x).nick) {
mode $1 +b $2
kick $1 $v1 $iif($3,$3-,Matching host $2)
inc %x
}
}
;;usage: removebans %mask
alias removebans {
if (*!*@* !iswm $1) { halt }
var %x = 1, %y = 1
while ($comchan($me,0) >= %x) {
:loop
if ($me isop $comchan($me,%x)) {
while ($ibl($comchan($me,%x),0) >= %y) {
if ($1 iswm $ibl($comchan($me,%x),%y)) { mode $comchan($me,%x) -b $1 | inc %x | goto loop }
else { inc %y }
}
}
inc %x
}
}
on *:load: {
set %author zNigel-
set %version 2.57
set %auth.ver Blacklist v $+ %version $+ by $+ %author $+ $+ .
echo -a Blacklist v $+ %version by %author loaded.
}