Sir_Fz wrote:Code: Select all
bind join - * check:ban
bind msg - unban unban:nick
proc check:ban {nick uhost hand chan} {
global unbanc
set banned 0
set hostmask [string tolower $nick!$uhost]
foreach ban [banlist $chan] {
set b [lindex $ban 0]
if {[string match -nocase $b $hostmask]} {
set banned 1
break
}
}
if {$banned} {
set unbanc($hostmask) [randstring 5]:$chan:$b
puthelp "privmsg $nick :/msg Eggdrupy unban [lindex [split $unbanc($hostmask) :] 0]"
}
}
proc unban:nick {nick uhost hand arg} {
global unbanc
set code [lindex [split $arg] 0]
set hostmask [string tolower $nick!$uhost]
if {[info exists unbanc($hostmask)]} {
foreach {c chan b} [split $unbanc($hostmask) :] {break}
if {[string equal $code $c]} {
killchanban $chan $b
unset $unbanc($hostmask)
} {
puthelp "privmsg $nick :Invalid code: $code"
}
}
}
Edit: Modified code to remove the ban from the bot's internal banlist instead of channel banlist.
Hi Sir_Fz.
u can insert this code in your blacklist.1.3? so i like ur tcl blacklist
b coz, want now remove bans puts it a bd (blacklist.txt).
and add to blackist with a public command, without reason (only ex: %badd nick) so my eggdrop add this host in blacklist *!*@host.domain.
so, when a user have ban in bd, my egg put kick:
* Testuser2 was KICKED by myeggdrop (you're in a blacklist, if this an error put: /msg Chasse unban)
so, when this user put: /msg Chasse unban
eggdrop response in privmsg with a code generate:
"hi $nick, if u want unbanned put now: /msg Chasse unban $code.
(if other user don't have ban, and put command unban, my eggdrop ignore this user.)
if user is kicked and don't put /msg Chasse unban.
my eggdrop DON'T send privmsg to user.
aaaaaaaaaaahh and u can add this type to enable script?
.chanset #mychan +/-blacklist
and
.chanset #mychan +/-lockban
ex:
If
.chanset #mychan +lockban
only flags +n or +m can remove bans via dcc or pub command.
.chanset #mychan -lockban
flags +n or +m AND ONLY user banned can remove ur own ban.
sorry for disturb you.