From: Rudolf Polzer Date: Tue, 27 Sep 2011 09:05:06 +0000 (+0200) Subject: stay more on the same bot with a channel X-Git-Tag: xonotic-v0.6.0~75 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4ba4a584242aff4b60f922162a4cc8e4dc518618;p=xonotic%2Fxonotic.git stay more on the same bot with a channel --- diff --git a/misc/tools/midi2cfg-ng.pl b/misc/tools/midi2cfg-ng.pl index 1111f468..52dbd3a9 100755 --- a/misc/tools/midi2cfg-ng.pl +++ b/misc/tools/midi2cfg-ng.pl @@ -473,10 +473,19 @@ sub busybot_note_on_bot($$$$$$$) } ++$bot->{seen}{$k0}{$k1}; + if($bot->{lastuse} && $channel == $bot->{lastchannel}) + { + $bot->{lastchannelsequence} += 1; + } + else + { + $bot->{lastchannelsequence} = 1; + } $bot->{lastuse} = $time; $bot->{lastchannel} = $channel; - $bot->{lastprogram} = $program; - $bot->{lastnote} = $note; + +# print STDERR "$time $bot->{id} $channel:$note\n" +# if $channel == 11; return 1; } @@ -534,15 +543,7 @@ sub botsort($$$$@) { if($channel == $_->{lastchannel}) { - ++$q; - if($program == $_->{lastprogram}) - { - ++$q; - if($note == $_->{lastnote}) - { - ++$q; - } - } + $q += $_->{lastchannelsequence}; } else {