This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

dns reverse ip ?

Old posts that have not been replied to for several years.
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

yes i did ;)
XplaiN but think of me as stupid
r
rolandguy
Voice
Posts: 25
Joined: Wed Aug 13, 2003 1:50 pm

Post by rolandguy »

did you restart the bot, so that it actually triggers the USERHOST command on connect? if you're already connected, the it wouldn't have set the IP yet...

am guessing you probably did tho...

here's everything so far all in one chunk lol...I took out writing the file just to make it easier to look at, and also a check to see if bot_ip exists in the testing proc, just in case ;)

Code: Select all

bind EVNT - init-server conn:init 
bind RAW - 302 reslove:raw 
bind pub - !test test:pub 

proc conn:init { init-server } { 
  global botnick 
  putserv "USERNAME $botnick" 
} 

proc reslove:raw {from key arg} { 
  global bot_ip 
  set bot_ip [lindex [split $arg @] 1] 
  putlog "Succesfully cached ip: \002$bot_ip\002." 
} 

proc test:pub {nick host hand chan args} { 
  global bot_ip botnick
  if {![info exists bot_ip]} {
    putserv "USERNAME $botnick"
    return
  }
  putserv "notice $nick :$bot_ip" 
}
that should work fine :)

roland
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

hmm i get a strange result it shows the ip of an other bot on my lan ? well not exactly ip but computer netbios name
XplaiN but think of me as stupid
r
rolandguy
Voice
Posts: 25
Joined: Wed Aug 13, 2003 1:50 pm

Post by rolandguy »

if it's showing a name and not an IP, that means that you're checking USERHOST for someone other than you...ermmm....check $botnick lol :) is the only thing I can figure...

roland
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

thats almost the same script as me i tought you meanth bot_ip was a global var like botnick ... its the same script i got almost then ..

Code: Select all

bind EVNT - init-server conn:init 

proc conn:init init-server { 
global botnick
  putserv "USERHOST $botnick" 
}

bind RAW - 302 reslove:raw

proc reslove:raw {from key arg} {
global botnick
  set bothost [join [lrange $arg 0 end]]
  set sbothost [lindex [split $bothost @] 1]
  set nslookup [dnslookup $sbothost reslove:ipaddress]
}

proc reslove:ipaddress {ipaddres hostname status} {
  set wfile [open "MyIP" "w"]
  puts -nonewline $wfile $ipaddres
  close $wfile
  putlog "Succesfully cached ip: \002$ipaddres\002."
}

proc MyIP {} {
  set rfile [open "MyIP" "r"] 
  set MyIP [read $rfile]
  close $rfile 
  if {"$MyIP" == "" || "$MyIP" == "0.0.0.0"} {
    set MyIP "" 
    foreach a {a b c d e f g h i j k} { 
      catch { 
      set external [socket $a.root-servers.net 53] 
      set MyIP [lindex [fconfigure $external -sockname] 0] 
      close $external             
      } 
    if { ![string equal $MyIP ""] } { break } 
    }
    return $MyIP
  } else {
    return $MyIP
  }
}
XplaiN but think of me as stupid
Locked