[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Followup #2: Need to create alias/script that affects scripts
On Sun, 2003-08-03 at 11:03, David Oftedal wrote:
> >For stuff like this, check the perl documentation (perl language, not
> >xchat-perl) for Data::Dumper and how to use it, as it is your bestest
> >buddy when exploring strange data structures. You also might want to
> >have that code print out the value of $nick to be 100% certain you're
> >not having a blonde moment.
> >
> Ah.
>
> I already tested this by forcing the nick value to be "Danner" and
> "Rounin", and it still returns the info for "absolon". It seems I'm
> going to have to turn to another function to get the IP of the nick I'm
> sending to.
>
> Thanks for your input, though. :)
Hmm... Looks like you're right and that the user_info function is broken
as all heck.
#!/usr/bin/perl
#
IRC::register("my script", "1.0", "", "");
IRC::add_command_handler("spoolie", "spoolie");
sub spoolie {
my ($nick) = @_;
IRC::print("Zoobie: $nick");
my @info = IRC::user_info("$nick");
$targetip = $info[1];
IRC::print("Zoobah: $targetip");
}
I just tried the above with 2.0.3 and in channel context I get the uhost
of the first user in the channel list. In a query context I get back
diddly-squat.
/me goes to get CVS source.
--
XChat-discuss: mailing list for XChat users
Archive: http://mail.nl.linux.org/xchat-discuss/