# Attack every round, replicate every round IF possible. If we've received an # undef from Replicate previously, wait 5 rounds before attempting again so # we're not wasting time unnecessarily. ;predecl my $waitstate = 0; ;main # Check other warriors my $warriors = JProcRoutines::FindEnemyWarriors; if (keys %$warriors > 0) { # Pick a random enemy to hit my $rand_enemy = (keys %$warriors)[rand(keys %$warriors)]; # Hit them. &JProcRoutines::Hit($rand_enemy); } # Are we waiting to replicate again? if ($waitstate) { $waitstate--; if ($waitstate <= 0) { $waitstate = 0; } } else { # Replicate, and if we get an undef back, set up a wait if (!defined &JProcRoutines::Replicate) { $waitstate = 5; } }