#Make the bot halfop someone
proc pub_do_halfop {nick host handle channel testes} {
global usehalfop owner
set who [lindex $testes 0]
if {$usehalfop == 1} {
if {$who == ""} {
if {![botisop $channel]} {
putserv "NOTICE $nick :I'm not op'd. Lamer."
return 1
}
if {[halfop $channel]} {
putserv "NOTICE $nick :YOU are ALREADY halfop'd in $channel you dumbass."
return 1
}
putserv "MODE $channel +h $nick"
return 1
}
if {![botisop $channel]} {
putserv "NOTICE $nick :I'm not op'd. Lamer."
return 1
}

if {[halfop $who $channel]} {
putserv "NOTICE $nick :$who is ALREADY halfop'd in $channel you dumbass."
return 1
} 

putserv "MODE $channel +h $who"
putserv "NOTICE $nick :Halfop'd $who on $channel."
putlog "$nick made me halfop $who in $channel."
return 1
}
if {$usehalfop == 0} {
if {[matchattr $nick +n]} {
putserv "NOTICE $nick :Halfop isn't enabled. To enable, edit avenger.tcl."
return 1
}
putserv "NOTICE $nick :Halfop isn't enabled. If this server uses halfop, tell it to $owner"
}
}
#End of pub_do_halfop