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.

drag ip from nick

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
ultralord
Master
Posts: 255
Joined: Mon Nov 06, 2006 6:52 pm

drag ip from nick

Post by ultralord »

hello how i can drag the ip from one nick? not host the ip with number.. is that possible?


thanks
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Post by arfer »

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
N
Nimos
Halfop
Posts: 80
Joined: Sun Apr 20, 2008 9:58 am

Post by Nimos »

but, most irc networks cloak the real host of their users, so it might not work like that...
c
c0re
Voice
Posts: 16
Joined: Sun Jan 18, 2009 4:45 pm

Post by c0re »

your bot must be oper to see the real ip

rAw(378) MoarBOT is connecting from *@67.220.75.77 67.220.75.77
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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
Post Reply