#by wiebe @ QuakeNet
#requires country.tcl



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

proc c_country:help:pub { nick uhost handle chan text } {
  if { [catch {country:pub $nick $uhost $handle $chan ""} error] } {
    putlog "ERROR using country.tcl, perhaps you have not loaded it?"
    error $error
  }
  putloglev c $chan "[lindex [split $text] 1]: $nick $uhost $handle $chan [join [lrange [split $text] 2 end]]"
}



#help country msg
bind msgm fvlomn|fvlomn "help country" c_country:help:msg

proc c_country:help:msg { nick uhost handle text } {
  if { [catch {country:msg $nick $uhost $handle ""} error] } {
    putlog "ERROR using country.tcl, perhaps you have not loaded it?"
    error $error
  }
  putcmdlog "($nick!$uhost) !$handle! $text"
}



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



#country msg
bind msg fvlomn|fvlomn country c_country:msg

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

