| View previous topic :: View next topic |
| Author |
Message |
redlander Voice
Joined: 17 Aug 2005 Posts: 1
|
Posted: Wed Sep 05, 2007 9:57 pm Post subject: equivalent to getchanhost for a user outside the channel |
|
|
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 |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Wed Sep 05, 2007 11:57 pm Post subject: |
|
|
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 |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Thu Sep 06, 2007 9:37 am Post subject: |
|
|
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 |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Thu Sep 06, 2007 2:48 pm Post subject: |
|
|
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 |
|
 |
user

Joined: 18 Mar 2003 Posts: 1452 Location: Norway
|
Posted: Fri Sep 07, 2007 9:16 am Post subject: |
|
|
WHO? Why not USERHOST? _________________ Have you ever read "The Manual"? |
|
| Back to top |
|
 |
|