hi i am trying to write a bot that passes messages to OSC from and IRC i'm having a bit of problem formating my output the messages i get in my OSC client look like this:
/irc/11811/$VAR1 = rob;/$VAR1 = testing 1 2 3
when i would like them to look like this:
/irc/11811/rob/testing 1 2 3
any hints to what i am doing wrong?
also it complains about Odd number of elements in anonymous hash for this line:
$client->send(["/irc/11811/$nick/$str"])
many thanks,
rob
code below:
package OSCBot;
use base qw(Bot::BasicBot);
use Net::OpenSoundControl::Client;
use Data::Dumper;
use warnings;
use strict;
my $client = Net::OpenSoundControl::Client->new(
Host => "localhost", Port => 7777)
or die "Could not start client: $...@\n";
sub said {
my ($self, $message) = @_;
if ($message->{body} =~ /\b^osc \b/) {
my $nick = Dumper($message->{who});
$nick =~ s/'//g;
chomp($nick);
my $str = Dumper($message->{body});
$str =~ s/'//g;
$str =~ s/osc//g;
return {
$client->send(["/irc/11811/$nick/$str"])
}
}
}
OSCBot->new(
server => "irc.goto10.org",
channels => #bottest",
nick => 'x11811',
ignore_list => [qw(3340)],
)->run();
--------------
[email protected]
rob.goto10.org
--------------
signature.asc
Description: Digital signature
