I am using badchan.tcl by bass, and wants to change the default ban type to *!*@host.ip here is the bass code responsible for it.
Code: Select all
proc bmaskhost {uhost} {
set uhost [lindex [split $uhost !] [expr [llength [split $uhost !]] -1]]
set temp [string range [lindex [split $uhost @] 0] [expr [string length [lindex [split $uhost @] 0]] - 8] e]
return "*!*$temp@[lindex [split [maskhost *!*@[lindex [split $uhost @] 1]] @] 1]"
}
proc bc_whois {from key args} {
global bchan bcqueue bcnicks
# putlog "319: $args"
set args [join $args]
set nick [string tolower [lindex $args 1]]
if {[info exists bcnicks($nick)]} {set chan $bcnicks($nick)} {return 0}
set chans [string tolower [lrange $args 2 e]]
if {[lsearch $bchan(exempt) $chan] == -1 && $bchan(global) != ""} {set bans $bchan(global)} {set bans ""}
if {[lsearch $bchan(chans) $chan] > -1} {set bans "$bans $bchan($chan)"}
foreach tok $chans {
set tok [string trimleft $tok ":@+"]
foreach ban $bans {
if {[string match [lindex $ban 0] $tok]} {
putlog "badchan: match! $nick k/b'd from $chan because [lrange $ban 1 e]"
putlog "args: $args, ban: $ban"
if {[onchan $nick $chan]} {newchanban $chan [bmaskhost [getchanhost $nick $chan]] badchan "[lrange $ban 1 e]" 10}
return 0
}
}
}
return 0
}
Code: Select all
proc bmaskhost {uhost} {
set uhost "*!*@[lindex [split $uhost @] 1]"
return "$uhost"
}