}
++$bot->{seen}{$k0}{$k1};
- if($bot->{lastuse} && $channel == $bot->{lastchannel})
+ if(($bot->{lastuse} // -666) >= $time - $time_forgetfulness && $channel == $bot->{lastchannel})
{
$bot->{lastchannelsequence} += 1;
}
map
{
my $q = 0;
- if(($_->{lastuse} // -666) >= $time - $time_forgetfulness)
+ if($channel != 10) # percussion just should do round robin
{
- if($channel == $_->{lastchannel})
+ if(($_->{lastuse} // -666) >= $time - $time_forgetfulness)
{
- $q += $_->{lastchannelsequence};
- }
- else
- {
- # better leave this one alone
- --$q;
+ if($channel == $_->{lastchannel})
+ {
+ $q += $_->{lastchannelsequence};
+ }
+ else
+ {
+ # better leave this one alone
+ $q -= $_->{lastchannelsequence};
+ }
}
}
[$_, $q, rand]
my $votehigh = 0;
my $votelow = 0;
my $votegood = 0;
- for(@busybots_allocated)
+ for(@busybots_allocated, grep { $_->{count} > 0 } values %$busybots)
{
next # I won't play on this channel
if defined $_->{channels} and not $_->{channels}->{$channel};