On 2002-12-22 03:31:47 -0700, BoBB wrote:
> Im looking for a command i can use in my script that will let me specify
> a server and a channel on that server to send a command to. something
> like
>
> Irssi::command(command, server, channel);
an command bind in irssi gets the following 3 parameters
Irssi::command_bind 'foo' => sub {
my ($data, $server, $windowitem) = @_;
}
if you call /foo in the target window with the channel as aktive item
you just could do
$windowitem -> command ("say $data");
# $data == parametes to the /foo command
otherwise you could use
if ( ref ($windowitem) == 'CHANNEL' ) {
$server->command ("msg $window�tem->{'name'} $data");
}
hope this helps a bit.
for more examples see
http://scripts.irssi.org./ ( http://irssi.org./scripts/ )
darix
--
irssi - the client of the smart and beautiful people
http://www.irssi.de/