This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

need help with kick/ban script

Old posts that have not been replied to for several years.
Locked
B
Bart

need help with kick/ban script

Post by Bart »

Somehow, things go wrong with this script. I wrote a script, when I type:
!kb username some extra info here
it bans the user and kicks them. But somehow, I get this "bug":
<Bart>!kb barttest I'm testing around
[18:06] * Botje sets mode: +b *!*@*
[18:06] * barttest was kicked by Botje (I'm testing around)
[18:06] * Botje sets mode: -b *!*@*
This is my code:
bind pub ol !kb userban
proc userban {nick host handle channel arg} {
global botnick
if {[llength $arg] < 1} {
return 0
}
set vict [lindex $arg 0]
set reas [lrange $arg 1 end]
if {$reas == "" } {
set reas "requested"
}
if {$vict == $botnick} {
return 0
}
if {[isop $nick $channel]} {
set ban "*!*[string trimleft [getchanhost [lindex $arg 0] $channel] ~]"
putserv "MODE $channel +b $ban"
putkick $channel $vict $reas
} else {
if {([ishalfop $nick $channel] && [isop $vict $channel]) } {
putserv "PRIVMSG $channel :$nick, you can't kick someone who is an op on $channel"
} else {
set ban "*!*[string trimleft [getchanhost [lindex $arg 0] $channel] ~]"
putserv "MODE $channel +b $ban"
putkick $channel $vict $reas
}
}
}
I hope someone can help me, I'm already trying to figure it out for two weeks, now I'm desperate :D
M
Mandor

Post by Mandor »

Use the command "newchanban" (it's in tcl-commands.doc).
Locked