egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

drag ip from nick

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
ultralord
Master


Joined: 06 Nov 2006
Posts: 255

PostPosted: Tue Mar 17, 2009 2:42 pm    Post subject: drag ip from nick Reply with quote

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


thanks
Back to top
View user's profile Send private message
arfer
Master


Joined: 26 Nov 2004
Posts: 436
Location: Manchester, UK

PostPosted: Tue Mar 17, 2009 3:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
Nimos
Halfop


Joined: 20 Apr 2008
Posts: 80

PostPosted: Thu Mar 19, 2009 12:48 pm    Post subject: Reply with quote

but, most irc networks cloak the real host of their users, so it might not work like that...
Back to top
View user's profile Send private message
c0re
Voice


Joined: 18 Jan 2009
Posts: 16

PostPosted: Thu Mar 19, 2009 6:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Thu Mar 19, 2009 6:52 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber