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.

commands2.9.tcl

Support & discussion of released scripts, and announcements of new releases.
Post Reply
User avatar
pig
Voice
Posts: 4
Joined: Fri Jul 08, 2005 9:05 am
Location: London

commands2.9.tcl

Post by pig »

Any help would be most appreciated.

Can anyone tell me what part of this code i need to change and to what in order for the bot to ban a nick and its ident only instead of the whole host ban that it is currently doing?

"bankick" {
if {![check:auth $nick $hand]} { return 0 }
if {![botisop $chan]} {
puthelp "NOTICE $nick :$fzcom(logo): I'm not oped on $chan."
return 0
}
if {[lindex [split $arg] 1] == ""} {
puthelp "NOTICE $nick :$fzcom(logo): SYNTAX: $fzcom(trigger)bankick <nick1/ban1,nick2/ban1,..> \[reason\] \[bantime\]."
return 0
}
set knicks [split [lindex [split $arg] 1] ,]
if {[llength [lrange [split $arg] 2 end]] == 1} {
if {[string is integer [lindex [split $arg] end]]} {
set kreason "$fzcom(logo): Requested by $nick."
set btime "[lindex [split $arg] end]"
} else {
set kreason "$fzcom(logo): ($nick) [join [lrange [split $arg] 2 end]]"
set btime "$fzcom(btime)"
}
} elseif {[llength [lrange [split $arg] 2 end]] > 1} {
if {[string is integer [lindex [split $arg] end]]} {
set kreason "$fzcom(logo): ($nick) [join [lrange [split $arg] 2 end-1]]"
set btime "[lindex [split $arg] end]"
} else {
set kreason "$fzcom(logo): ($nick) [join [lrange [split $arg] 2 end]]"
set btime "$fzcom(btime)"
}
} else {
set kreason "$fzcom(logo): Requested by $nick."
set btime "$fzcom(btime)"
}
foreach knick $knicks {
if {[string match -nocase *!*@* $knick]} {
if {![string match -nocase $knick $botname]} {
foreach kuser [chanlist $chan] {
if {[string match -nocase $knick $kuser![getchanhost $kuser $chan]]} {
if {![matchattr [nick2hand $kuser] mo|mo $chan]} {
pushmode $chan +b $knick
putquick "KICK $chan $kuser :$kreason"
lappend thebanked($knick) $kuser
} {
puthelp "NOTICE $nick :$fzcom(logo): I will not bankick a master/owner ($kuser matching $knick)"
}
}
}
if {![info exists thebanked]} {
puthelp "NOTICE $nick :$fzcom(logo): There are no nicks matching $knick on $chan."
} {
if {[lsearch -exact [array names thebanked] $knick] == -1} {
puthelp "NOTICE $nick :$fzcom(logo): There are no nicks matching $knick on $chan."
}
}
flushmode $chan
} {
puthelp "NOTICE $nick :$fzcom(logo): Can't outsmart me, I will not bankick myself"
}
} {
if {[onchan $knick $chan]} {
if {![isbotnick $knick] && ![matchattr [nick2hand $knick] mo|mo $chan]} {
pushmode $chan +b "*!*@[scan [getchanhost $knick $chan] %*\[^@\]@%s]"
putquick "KICK $chan $knick :$kreason"
timer $btime [list pushmode $chan -b "*!*@[scan [getchanhost $knick $chan] %*\[^@\]@%s]"]
lappend bankicked $knick
} else {
puthelp "NOTICE $nick :$fzcom(logo): Can't outsmart me, no bankicking a master."
}
} else {
puthelp "NOTICE $nick :$fzcom(logo): $knick is not on $chan."
}
}
}
if {[info exists bankicked]} {
foreach wrbankicked [wordwrap [join $bankicked ,] 70 ,] {
puthelp "NOTICE $nick :$fzcom(logo): Bankicked $wrbankicked from $chan."
}
}
if {[array exists thebanked]} {
foreach banked [array names thebanked] {
foreach wrbanked [wordwrap [join $thebanked($banked) ,] 70 ,] {
puthelp "NOTICE $nick :$fzcom(logo): Bankicked $wrbanked matching $banked on $chan."
}
}
}
flushmode $chan
return 0
}
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Download version 3.0. You can choose what bantype to ban in this version. It should be in the tcl archive soon.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

By the way if you still want todo it, you will need to replace:

Code: Select all

#this:
pushmode $chan +b "*!*@[scan [getchanhost $knick $chan] %*\[^@\]@%s]"

#with this:
pushmode $chan +b "$knick![lindex [split [getchanhost $knick $chan] @] 0]@*"
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Post Reply