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 

equivalent to getchanhost for a user outside the channel

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


Joined: 17 Aug 2005
Posts: 1

PostPosted: Wed Sep 05, 2007 9:57 pm    Post subject: equivalent to getchanhost for a user outside the channel Reply with quote

Greetings all,

I'm trying to grab ident@host for a user not in the bot chan. Is there an easy way to do this, or is a raw bind my only option?

Thanks,

--red
Back to top
View user's profile Send private message
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Wed Sep 05, 2007 11:57 pm    Post subject: Reply with quote

The only two methods I can think of currently are either perform a WHOIS or a WHO on that user. Unless if you are an OPER on that network then there are other ways.

CTCP hmmm, not really sure and it is unreliable since people can change their replies through scripting.

Obviously a WHO would be more simpler solution:

Code:

putserv "WHO $nick"


And then use the raw binding with 352 as the keyword to get that user's user@host. Here is a simple example.

Code:

bind raw - 352 get:uhost

proc get:uhost {from key arg} {
 set arg [split $arg]
 set uhost [lindex $arg 2]@[lindex $arg 3]
 #do your stuff here
}


In my case and honest oppinion:
You would have to use raw --> if the user is not on any of the channels the bot is on --> so the bot can retrieve that user's user@host

Other than that, I can't think of any other way not to use raw. Because raw is the only way you can retrieve information from the server if you can't see that user on any channel which you are in. (this goes the same if you are a user yourself and not a bot, you have to use: /whois or /who)
_________________
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Thu Sep 06, 2007 9:37 am    Post subject: Reply with quote

Keep in mind to always explicitly define the return-value when using raw bindings...
doc/tcl-commands.doc wrote:
(17) RAW (stackable)
bind raw <flags> <keyword> <proc>
procname <from> <keyword> <text>

Description: previous versions of Eggdrop required a special compile
option to enable this binding, but it's now standard. The keyword
is either a numeric, like "368", or a keyword, such as "PRIVMSG".
from will be the server name or the source user (depending on
the keyword); flags are ignored. The order of the arguments is
identical to the order that the IRC server sends to the bot. The
pre-processing only splits it apart enough to determine the
keyword. If the proc returns 1, Eggdrop will not process the line
any further (this could cause unexpected behavior in some cases).

Module: server

_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Thu Sep 06, 2007 2:48 pm    Post subject: Reply with quote

I would use WHO with the nuh arguments (n=nickname,u=username(identd),h=hostname)

Code:
putserv "WHO $nick %nuht,22"

bind raw - 354 get:uhost

proc get:uhost {from key arg} {
    if {[lindex [split $arg] 1] == "22"} {
        set hostname "[lindex [split $arg] 2]@[lindex [split $arg] 3]"
        set nickname "[lindex [split $arg] 4]"
        # do stuff here
    }
}


I prefer special formatted who's as it does not return all the other junk.
_________________
r0t3n @ #r0t3n @ Quakenet
Back to top
View user's profile Send private message MSN Messenger
user
 


Joined: 18 Mar 2003
Posts: 1452
Location: Norway

PostPosted: Fri Sep 07, 2007 9:16 am    Post subject: Reply with quote

WHO? Why not USERHOST?
_________________
Have you ever read "The Manual"?
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