View previous topic :: View next topic |
Author |
Message |
pig Voice

Joined: 08 Jul 2005 Posts: 4 Location: London
|
Posted: Fri Jul 15, 2005 9:42 am Post subject: commands2.9.tcl |
|
|
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
} |
|
Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri Jul 15, 2005 9:54 am Post subject: |
|
|
Download version 3.0. You can choose what bantype to ban in this version. It should be in the tcl archive soon. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Sat Jul 16, 2005 6:51 am Post subject: |
|
|
By the way if you still want todo it, you will need to replace:
Code: |
#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.
================================== |
|
Back to top |
|
 |
|