Code: Select all
# Private Ops Channel where the commands can be used from
set private_channel "#hunters.priv"
# Main Channel where the commands will be sent to
set main_channel "#hunters"
bind pub -|- !op pub:op
bind pub -|- !voice pub:voice
bind pub -|- !ban pub:ban
bind pub -|- !unban pub:unban
proc pub:op {nick uhost hand chan text} {
global private_channel main_channel
set chan [string tolower $chan]
set target [lindex [split $text] 0]
if {($chan == $private_channel)&&($target != "")&&([onchan "$target" "$main_channel"])} {
pushmode $main_channel +o $target
}
}
proc pub:voice {nick uhost hand chan text} {
global private_channel main_channel
set chan [string tolower $chan]
set target [lindex [split $text] 0]
if {($chan == $private_channel)&&($target != "")&&([onchan "$target" "$main_channel"])} {
pushmode $main_channel +v $target
}
}
proc pub:ban {nick uhost hand chan text} {
global private_channel main_channel tmp3
set chan [string tolower $chan]
set target [lindex [split $text] 0]
set reason [lrange [split $text] 1 end]
if {$reason == ""} {
set reason "requested"
}
if {($chan == $private_channel)&&($target != "")&&(![isbotnick $target])&&([onchan $target "$main_channel"])} {
if {![info exists tmp3($target)]} {
set tmp3($target) "[getchanhost $target $main_channel]"
}
putserv "KICK $main_channel $target :$reason"
putserv "MODE $main_channel +b *!*@[lindex [split [getchanhost $target $main_channel] @] 1]"
}
}
proc pub:unban {nick uhost hand chan text} {
global private_channel main_channel tmp3
set chan [string tolower $chan]
set target [lindex [split $text] 0]
if {($chan == $private_channel)&&($target != "")} {
if {[info exists tmp3($target)]} {
putserv "MODE $main_channel -b *!*@[lindex [split $tmp3($target) @] 1]"
} else {
puthelp "PRIVMSG $chan :I dont remenber banning '$target'"
}
}
}
Code: Select all
bind pub -|- !op pub:op
bind pub -|- !voice pub:voice
bind pub -|- !ban pub:ban
bind pub -|- !unban pub:unban
proc pub:op {nick uhost hand chan text} {
set chan [string tolower $chan]
if {![regexp {^(#hunters.priv|#otlws.priv)$} "$chan"]} {
return
}
if {$chan == "#hunters.priv"} {
set dest "#hunters"
} else {
set dest "#otlws"
}
set target [lindex [split $text] 0]
if {($target != "")&&([onchan "$target" "$dest"])} {
pushmode $dest +o $target
}
}
proc pub:voice {nick uhost hand chan text} {
set chan [string tolower $chan]
if {![regexp {^(#hunters.priv|#otlws.priv)$} "$chan"]} {
return
}
if {$chan == "#hunters.priv"} {
set dest "#hunters"
} else {
set dest "#otlws"
}
set target [lindex [split $text] 0]
if {($target != "")&&([onchan "$target" "$dest"])} {
pushmode $dest +v $target
}
}
proc pub:ban {nick uhost hand chan text} {
global tmp3
set chan [string tolower $chan]
if {![regexp {^(#hunters.priv|#otlws.priv)$} "$chan"]} {
return
}
if {$chan == "#hunters.priv"} {
set dest "#hunters"
} else {
set dest "#otlws"
}
set target [lindex [split $text] 0]
set reason [lrange [split $text] 1 end]
if {$reason == ""} {
set reason "requested"
}
if {($target != "")&&(![isbotnick $target])&&([onchan "$target" "$dest"])} {
if {![info exists tmp3($target)]} {
set tmp3($target) "[getchanhost $target $dest]"
} else {
# I've added this incase someone's IP or host changes
if {![string match "$tmp3($target)" "[getchanhost $target $dest]"]} {
set tmp3($target) "[getchanhost $target $dest]"
}
}
putserv "KICK $dest $target :$reason"
putserv "MODE $dest +b *!*@[lindex [split [getchanhost $target $dest] @] 1]"
}
}
proc pub:unban {nick uhost hand chan text} {
global tmp3
set chan [string tolower $chan]
if {![regexp {^(#hunters.priv|#otlws.priv)$} "$chan"]} {
return
}
if {$chan == "#hunters.priv"} {
set dest "#hunters"
} else {
set dest "#otlws"
}
set target [lindex [split $text] 0]
if {($target != "")} {
if {[info exists tmp3($target)]} {
putserv "MODE $dest -b *!*@[lindex [split $tmp3($target) @] 1]"
} else {
puthelp "PRIVMSG $chan :I dont remenber banning '$target'"
}
}
}
Code: Select all
setudef str destchan
Code: Select all
if {![validchan [set dest [channel get $chan destchan]]]} {return}
Code: Select all
setudef str ...