user wrote:Don't 'join' the string returned by 'lindex' and everything should be fine
Code: Select all
proc academy:ban {nick host handle chan text} {
global botnick guardmethod
if {(![authed $handle]) || ![string equal -nocase $chan "#jedi-academy"]} { return 0 }
set userlevel [level $handle]
set nickhost [lindex [split $text] 0]
set time [lindex $text 1]
set reason [join [lrange [split $text] 2 end]]
if {$userlevel == "Knight" || $nickhost == ""} {return 0}
if {$time == "perm"} { set time "0" }
if {[onchan $nickhost $chan]} {
if {[string match "*.users.quakenet.org" [getchanhost $nickhost $chan]]} {
set banmask "*!*@[lindex [split [getchanhost $nickhost $chan] @] 1]"
} else {
set banmask "*!*[string trimleft [maskhost [getchanhost $nickhost $chan]] *!]"
}
}
if {$reason == ""} {
set reason "Banned via JAbot by $nick. No reason specified."
}
if {[nick2hand $nickhost] != "*"} {
if {[matchattr [nick2hand $nickhost $chan] f|f $chan]} {
return 0
}
}
if {[botisop $chan]} {
if {[onchan $nickhost $chan]} {
if {![string equal -nocase [maskhost [getchanhost $botnick]] [maskhost $nickhost]] && ![string equal -nocase $botnick $nickhost]} {
if {$time == "0"} {
newchanban $chan $banmask [nick2hand $nick] "$reason (permanent)" $time
} else {
newchanban $chan $banmask [nick2hand $nick] "$reason ($time minutes)" $time
}
webbanlist_createhtml
} else {
putserv "$guardmethod $nick : $nick whats wrong with you?"
}
} else {
if {![string equal -nocase [maskhost [getchanhost $botnick]] $nickhost] && ![string equal -nocase $botnick $nickhost]} {
newchanban $chan $nickhost $handle "$reason" $time
putserv "$guardmethod $nick : $nick, \002$nickhost\002 has been added to the $chan banlist, and will be banned when he enters."
webbanlist_createhtml
} else {
putserv "$guardmethod $nick : $nick, quit messing around."
}
}
} else {
putserv "$guardmethod $nick : $botnick is not opped on $chan"
}
}
Code: Select all
if {![string equal -nocase [maskhost [getchanhost $botnick]] $nickhost] .. etc.
Code: Select all
if {[string match -nocase $nickhost $botname]} { # etc. }
Code: Select all
if {![string equal -nocase [maskhost [getchanhost $botnick]] [maskhost $nickhost]] && ![string equal -nocase $botnick $nickhost]} {
Code: Select all
if {[nick2hand $nickhost] != "*"} {
if {[matchattr [nick2hand $nickhost $chan] f|f $chan]} {
return 0
}
}
Code: Select all
if {[matchattr [nick2hand $nickhost $chan] f|f $chan]} {
return 0
}
Code: Select all
if {$time == "perm"} { set time "0" }
Code: Select all
if {[string tolower $time] == "perm"} { set time 0 }
Code: Select all
proc academy:ban {nick host handle chan text} {
global botnick guardmethod botname
if {(![authed $handle]) || ![string equal -nocase $chan "#jedi-academy"]} { return 0 }
set userlevel [level $handle]
set nickhost [lindex [split $text] 0]
set time [lindex $text 1]
set reason [join [lrange [split $text] 2 end]]
if {$userlevel == "Knight" || $nickhost == ""} {return 0}
if {[string tolower $time] == "perm"} { set time 0 }
if {[onchan $nickhost $chan]} {
if {[string match "*.users.quakenet.org" [getchanhost $nickhost $chan]]} {
set banmask "*!*@[join [lindex [split [getchanhost $nickhost $chan] @] 1]]"
} else {
set banmask "*!*[string trimleft [maskhost [getchanhost $nickhost $chan]] *!]"
}
}
if {$reason == ""} {
set reason "Banned via JAbot by $nick. No reason specified."
}
if {[matchattr [nick2hand $nickhost $chan] f|f $chan]} {
return 0
}
if {[botisop $chan]} {
if {[onchan $nickhost $chan]} {
if {![string match -nocase $nickhost $botname] || ![isbotnick $nickhost]} {
if {$time == "0"} {
newchanban $chan $banmask [nick2hand $nick] "$reason (permanent)" $time
} else {
newchanban $chan $banmask [nick2hand $nick] "$reason ($time minutes)" $time
}
webbanlist_createhtml
} else {
putserv "$guardmethod $nick : $nick whats wrong with you?"
}
} else {
if {![string equal -nocase [maskhost [getchanhost $botnick]] $nickhost] && ![string equal -nocase $botnick $nickhost]} {
newchanban $chan $nickhost $handle "$reason" $time
putserv "$guardmethod $nick : $nick, \002$nickhost\002 has been added to the $chan banlist, and will be banned when he enters."
webbanlist_createhtml
} else {
putserv "$guardmethod $nick : $nick, quit messing around."
}
}
} else {
putserv "$guardmethod $nick : $botnick is not opped on $chan"
}
}