#by wiebe @ QuakeNet
#requires peak.tcl




#help netpeak pub
bind pubm fvlomn|fvlomn "% ${botnet-nick} help netpeak" c_netpeak:help:pub

proc c_netpeak:help:pub { nick uhost handle chan text } {
  lappend output "Usage: netpeak"
  lappend output "Shows the highest known user peak for the network."
  if { [catch {set x [cnotice $nick $output]} error] || !$x } {
    foreach t $output { puthelp "NOTICE $nick :$t" }
  }
  putloglev c $chan "[lindex [split $text] 1]: $nick $uhost $handle $chan [join [lrange [split $text] 2 end]]"
}



#help netpeak msg
bind msgm fvlomn|fvlomn "help netpeak" c_netpeak:help:msg

proc c_netpeak:help:msg { nick uhost handle text } {
  lappend output "Usage: netpeak"
  lappend output "Shows the highest known user peak for the network."
  if { [catch {set x [cnotice $nick $output]} error] || !$x } {
    foreach t $output { puthelp "NOTICE $nick :$t" }
  }
  putcmdlog "($nick!$uhost) !$handle! $text"
}



#netpeak pub
bind pubm fvlomn|fvlomn "% ${botnet-nick} netpeak" c_netpeak:pub
bind pubm fvlomn|fvlomn "% ${botnet-nick} netpeak *" c_netpeak:pub

proc c_netpeak:pub { nick uhost handle chan text } {
  if { [catch {peak:netpeak:pub $nick $uhost $handle $chan $text} error] } {
    putlog "ERROR using peak.tcl, perhaps you have not loaded it?"
  }
  putloglev c $chan "[lindex [split $text] 1]: $nick $uhost $handle $chan [join [lrange [split $text] 2 end]]"
}



#netpeak msg
bind msg fvlomn|fvlomn netpeak c_netpeak:msg

proc c_netpeak:msg { nick uhost handle text } {
  if { [catch {peak:netpeak:msg $nick $uhost $handle $text} error] } {
    putlog "ERROR using peak.tcl, perhaps you have not loaded it?"
  }
  return 1
}

