Code: Select all
bind pub - !nsl pub_nslookup
bind msg - !nsl msg_nslookup
bind pub - !dns pub_nslookup
bind msg - !dns msg_nslookup
bind pub - !nslookup pub_nslookup
bind msg - !nslookup msg_nslookup
proc pub_nslookup {nick uhost hand chan arg} {
  global nsl_path
  set input [open "|$nsl_path $arg" r]
  while {![eof $input]} {
    catch {set contents [gets $input]}
    if {[string first "Name:" $contents] >= 0} {
      set name [string range $contents 9 end]
    }
    if {[string first "Address:" $contents] >= 0} {
      set address [string range $contents 10 end]
    }
  }
  catch {close $input}
  if {![info exists name]} {
    putserv "PRIVMSG $chan :DNS Lookup: Unable to resolve address."
    return 0
  }
  if {$name != ""} {
    putserv "PRIVMSG $chan :DNS Lookup: $name <-> $address"
    return 0
  } else {
    putserv "PRIVMSG $chan :DNS Lookup: Unable to resolve address."
    return 0
  }
} 
Code: Select all
[14:59] <teste> [16:01] Tcl error [pub_nslookup]: can't read "nsl_path": no such variable
Code: Select all
[15:00] <made_of_storm> .set errorInfo
[15:00] <teste> [16:03] tcl: builtin dcc call: *dcc:set made_of_storm 9 errorInfo
[15:00] <teste> [16:03] #made_of_storm# set errorInfo
[15:00] <teste> Currently: can't read "nsl_path": no such variable
[15:00] <teste> Currently:     while executing
[15:00] <teste> Currently: "open "|$nsl_path $arg" r"
[15:00] <teste> Currently:     (procedure "pub_nslookup" line 3)
[15:00] <teste> Currently:     invoked from within
[15:00] <teste> Currently: "pub_nslookup $_pub1 $_pub2 $_pub3 $_pub4 $_pub5"

