Saturday, January 22, 2011

New Copybot.pl by Hookbot Script Function

This is a function that can be added to Copybot.pl that makes the Bot copy it's targets frame.
Note: I have only tested this with dancing.
sub handleSendFrame {
my $self = shift;
my $room_id_internal = shift;
my $PenguinID = shift;
my $state_code = shift;
if (my $u = $self->{penguin}->{$PenguinID}) {
my $who = $u->{name};
$u->{update} = time;
print scalar(localtime).": [$$] [$self->{username}] INTERPRET: Penguin [$who] did frame [$state_code]\n";
if ($target and $who =~ /$target/i) {
select(undef,undef,undef,0.55);
$self->doSendFrame($state_code);
}
}
-v0rtex

0 comments: