| View previous topic :: View next topic |
| Author |
Message |
ultralord Master

Joined: 06 Nov 2006 Posts: 255
|
Posted: Tue Mar 17, 2009 2:42 pm Post subject: drag ip from nick |
|
|
hello how i can drag the ip from one nick? not host the ip with number.. is that possible?
thanks |
|
| Back to top |
|
 |
arfer Master

Joined: 26 Nov 2004 Posts: 436 Location: Manchester, UK
|
Posted: Tue Mar 17, 2009 3:33 pm Post subject: |
|
|
Use the Eggdrop Tcl command
getchanhost <nick>
It returns user@host so you would then have to split at the @ character
set host [lindex [split [getchanhost $nick] @] 1]
You could then use a regexp to test if the host is numeric, if not use dnslookup to convert hostname into a numeric ip.
It's a little more difficult than that because you would have to code the event of a hostname that will not dns resolve.
This works for nicks in a bot channel. For any nick it becomes even more difficult. You would have to send a network /whois and interpret the raw numeric response. _________________ I must have had nothing to do |
|
| Back to top |
|
 |
Nimos Halfop
Joined: 20 Apr 2008 Posts: 80
|
Posted: Thu Mar 19, 2009 12:48 pm Post subject: |
|
|
| but, most irc networks cloak the real host of their users, so it might not work like that... |
|
| Back to top |
|
 |
c0re Voice
Joined: 18 Jan 2009 Posts: 16
|
Posted: Thu Mar 19, 2009 6:41 pm Post subject: |
|
|
your bot must be oper to see the real ip
rAw(378) MoarBOT is connecting from *@67.220.75.77 67.220.75.77 |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Thu Mar 19, 2009 6:52 pm Post subject: |
|
|
The 378 numeric response is not a standardized numeric, and is conflicting across different irc networks. You would have to be very cautious to check that this numeric is supported in this manner for your irc network. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
|