|
Joined: Oct 2003
Posts: 39
Ameglian cow
|
OP
Ameglian cow
Joined: Oct 2003
Posts: 39 |
Would it be possible to make a ban list that i can put in my script, but gives me the option to enter a name, length of ban, reason for ban.
The server that i use has an akick list which only permits 32 entries so id like to have one to use in my script which i can add as many as i want.. I know just by adding a name then that user could come back with a different name so maybe something better than that..
Would anyone be generous and make me something along these lines
Thanks in advance
Gary
|
|
|
|
Joined: Oct 2004
Posts: 31
Ameglian cow
|
Ameglian cow
Joined: Oct 2004
Posts: 31 |
I made one that I think sounds like what you want. The following text is a long desciption I made when I posted it on another site The snippet is a ban script You or operators in any channel you are op in can ban certain addresses Unless the actual ban expires in less than 5 minutes, it unbans the person (like mode -b #channel) in 5 minutes. It stores all the bans in a hash table When someone joins a channel, it checks then versus the bans on that channel. If a ban matchs, they are kicked, at the actual mask that was banned is banned... That might not be too clear, Its hard to explain. Examples will help: Other operators use: !+ban ADDRESS TIME REASON !-ban REASON !baninfo ADDRESS You use: /+ban CHANNEL ADDRESS TIME REASON /-ban CHANNEL ADDRESS /baninfo ADDRESS Address is in the form: NICKNAME!NAME@HOST Time is in seconds Reason can be anything Channel must have a # before it !+ban bear!*@* 60000 Learn some manners That bans the address "bear!*@*". That means it bans the nickname "bear" on the channel the operator typed it in. Anyone on that channel matching that address (wildcards such as * and ? are applied) is kick/banned !+ban *!*@*.IP 0 No IP addresses allowed in here That would ban anyone with a .IP address. A 0 time ban never expires /-ban #realmasks *!*@*.IP That is what you type to unban *!*@*.IP from #realmasks /+ban #bear ?!*@* 0 Get a longer name please That is what you type to ban all 1 character nicknames from #bear It lasts forever (even though it does the actual mode -b in 5 minutes, everytime someone joins or changes their nick to a 1 character it will kick and ban them again) This script can be useful for longterm bans, or for a network where you can have limited amounts of channel bans. It can also be used to ban certain nicknames (Like Java???, Guest?????, people from a certain ISP, and one, two etc charater nicknames The only downside is if you arent on the channel, the banned person/address can get on. In action: (bear_test) !+ban bear!*@* 60 Learn some manners * bearruler sets mode: +b bear!*@* * bear was kicked by bearruler (Banned by: bear_test because: Learn some manners. Expires in: 1min) (bear_test) !+ban bear!*@* 600 Learn some manners * bear2 has joined #bear * bear2 is now known as bear * bear was kicked by bearruler (Banned by: bear_test because: Learn some manners. Expires in: 8mins 5secs) * bear has joined #bear * bearruler sets mode: +b bear!*@* * bear was kicked by bearruler (Banned by: bear_test because: Learn some manners. Expires in: 6mins 12secs) Any questions, comments, concerns, suggestions, etc, email me at bearruler@gmail.com
on *:text:!+ban*:#: {
if ($me !isop $chan) || ($nick !isop $chan) halt
if (!$4 || $3 !isnum || $3 < 0) { .notice $nick Invalid ban format. !+ban ADDRESS TIME(Seconds) REASON -- For a Never ending ban, use 0 for Time. | halt }
if (*?!*?*@?* !iswm $2 || $count($2,!) > 1 || $count($2,@) > 1 || ** isin $2) {
.notice $nick Error, Invalid address. Use the format: *!*@* eg: !+ban bearruler!*@*.40E7B703.A8CC573C.IP 600 Learn some manners
halt
}
ban_c $2 $chan
if ($ban_($+($chan,.,$2))) { .notice $nick The address $2 is already banned | halt }
hadd ban $+($chan,.,$2) $iif($3 == 0,0,$calc($ctime + $int($3))) $nick $4-
.notice $nick The address $2 was added to # $+ 's ban list, expiring $iif($3 == 0,Never,in $duration($int($3))) $+ . Reason: $4-
ban_kba $2 $chan
}
on *:text:!-ban*:#: {
if ($me !isop $chan || $nick !isop $chan) halt
if (!$2) { .notice $nick Invalid unban format. !-ban ADDRESS | halt }
ban_c $2 $chan
if (!$ban_($+($chan,.,$2))) {
.notice $nick The address $2 is not banned
halt
}
hdel ban $+($chan,.,$2)
.notice $nick $2 was unbanned from #
mode # -b $2
}
alias +ban {
if (!$4 || $3 !isnum || $3 < 0) { echo -a - Ban - Invalid ban format. /+ban #CHANNEL ADDRESS TIME(Seconds) REASON -- For a Never ending ban, use 0 for Time. | halt }
if ($me !isop $1) halt
if (*?!*?*@?* !iswm $2 || $count($2,!) > 1 || $count($2,@) > 1 || ** isin $2) {
echo -a - Ban - Error, Invalid address. Use the format: *!*@* eg: /+ban #bearruler bearruler!*@*.40E7B703.A8CC573C.IP 600 Learn some manners
halt
}
ban_c $2 $1
if ($ban_($+($1,.,$2))) { echo -a - Ban - The address $2 is already banned | halt }
hadd ban $+($1,.,$2) $iif($3 == 0,0,$calc($ctime + $int($3))) $me $4-
echo -a - Ban - The address $2 was added to $1 $+ 's ban list, expiring $iif($3 == 0,Never,in $duration($int($3))) $+ . Reason: $4-
ban_kba $2 $1
}
alias -ban {
if (!$2) { echo -a - Ban - Invalid unban format. /-ban #CHANNEL ADDRESS | halt }
if ($me !isop $1) halt
ban_c $2 $1
if (!$ban_($+($1,.,$2))) {
echo -a - Ban - The address $2 is not banned
halt
}
hdel ban $+($1,.,$2)
echo -a - Ban - $2 was unbanned from #
mode $1 -b $2
}
on *:text:!baninfo*:#: {
if ($me !isop # || $nick !isop #) halt
if (!$2) { .notice $nick Format: !baninfo ADDRESS (in form *!*@*) | halt }
ban_c $2 $chan
if (!$ban_($+($chan,.,$2))) .notice $nick No information on the ban of $2 on #
else .notice $nick $+ $2 was banned by $ban_b($+($chan,.,$2)) for the reason $ban_r($+($chan,.,$2)) $+ . It expires $iif($ban_t($+($chan,.,$2)) == 0,: Never,in: $duration($calc($v1 - $ctime)))
}
alias baninfo {
if ($me !isop $1) halt
if (!$2) { echo -a - Ban - Format: /baninfo #CHANNEL ADDRESS (in form *!*@*) | halt }
ban_c $2 $1
if (!$ban_($+($chan,.,$2))) echo -a - Ban - No information on the ban of $2 on $1
else echo -a - Ban - $nick $+ $2 was banned by $ban_b($+($1,.,$2)) for the reason $ban_r($+($1,.,$2)) $+ . It expires $iif($ban_t($+($1,.,$2)) == 0,: Never,in: $duration($calc($v1 - $ctime)))
}
alias ban_rem {
hdel ban $2 $+ . $+ $1
ban -r $2 $1
}
alias ban_ return $hget(ban,$1-)
alias ban_t return $gettok($hget(ban,$1-),1,32)
alias ban_b return $gettok($hget(ban,$1-),2,32)
alias ban_r return $gettok($hget(ban,$1-),3-,32)
alias ban_c if ($ctime > $ban_t($+($2,.,$1)) && $v2 != 0) ban_rem $1 $2
on *:start: {
hmake ban 500
if ($isfile(ban.hsh)) hload ban ban.hsh
.timer 0 600 hsave ban ban.hsh
}
on *:exit: hsave ban ban.hsh
on *:join:#: {
if ($me !isop $chan) halt
updatenl
var %a = 1,%c
while $hget(ban,%a).item {
%c = $v1
if ($gettok(%c,1,46) == $chan && $gettok(%c,2-,46) iswm $address($nick,5)) {
ban_kba $gettok(%c,2-,46) $chan
halt
}
inc %a
}
}
on *:nick: {
var %a = 1,%c = 0
while $comchan($newnick,%a) {
if ($comchan($newnick,%a).op) %c = 1
inc %a
}
if (%c = 0) halt
updatenl
%a = 1
while $hget(ban,%a).item {
%c = $v1
if ($newnick ison $gettok(%c,1,46) && $gettok(%c,2-,46) iswm $address($newnick,5)) {
ban_kba $gettok(%c,2-,46) $gettok(%c,1,46)
halt
}
inc %a
}
}
alias ban_kba {
ban_c $1 $2
if ($ban_t($+($2,.,$1)) == $null) halt
ban -u $+ $iif($ban_t($+($2,.,$1)) == 0 || $calc($v1 - $ctime) > 300,300,$v1) $2 $1
var %a = 1
while $ialchan($1,$2,%a).nick {
kick $2 $v1 Banned by: $ban_b($+($2,.,$1)) because: $ban_r($+($2,.,$1)) $+ . Expires $iif($ban_t($+($2,.,$1)) == 0, $+ : Never,in: $duration($calc($v1 - $ctime)))
inc %a
}
}
Bear
Last edited by bearruler; 13/08/06 04:06 AM.
|
|
|
|
Joined: Apr 2006
Posts: 464
Fjord artisan
|
Fjord artisan
Joined: Apr 2006
Posts: 464 |
wow, pretty impressive bear.
|
|
|
|
Joined: Oct 2003
Posts: 39
Ameglian cow
|
OP
Ameglian cow
Joined: Oct 2003
Posts: 39 |
Thanks for the code you posted, ill give it a try out and see how i get on with it The code does seems long is there another way but with shorter codeing in it, open for suggestions
Gary
|
|
|
|
Joined: Dec 2005
Posts: 58
Babel fish
|
Babel fish
Joined: Dec 2005
Posts: 58 |
alias banlist {
if ($1) {
var %i 1
while %i <= $ibl($1,0) {
echo -a $ibl($1,%i) - $ibl($1,%i).by - $date($ibl($1,%i).ctime) $time($ibl($1,%i).ctime)
inc %i
}
}
else { echo -a write channel }
}
usage ; /banlist #channel
i like that
|
|
|
|
Joined: Oct 2003
Posts: 39
Ameglian cow
|
OP
Ameglian cow
Joined: Oct 2003
Posts: 39 |
i would put this in my alias?
and how would i use it from there or does this go in my remotes?
sorry total n00b
Gary
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
That code, as written, would go into your remotes, not aliases.
If you want to put it in your aliases, remove the word alias from the first line.
|
|
|
|
Joined: Mar 2004
Posts: 210
Fjord artisan
|
Fjord artisan
Joined: Mar 2004
Posts: 210 |
It's still an alias, though, regardless of where you put it. It shows you the contents of the internal ban list.
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
I realize that. I also know that it won't work properly in the Remotes section without the word alias in the first line, and, likewise, the word alias isn't required in the first line, if they're going to put it in the Aliases section.
|
|
|
|
Joined: Mar 2004
Posts: 210
Fjord artisan
|
Fjord artisan
Joined: Mar 2004
Posts: 210 |
I was sure you knew, Russel, I just wanted to make sure that Matrixx was aware.
|
|
|
|
Joined: Jan 2003
Posts: 3,012
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 3,012 |
Next time click 'reply' next to the original poster's name then.
The forums use referenced-replies. When you click a reply next to a user's name, it's assumed you're directing your response to that person. Just some friendly advice.
-KingTomato
|
|
|
|
|