Page 1 of 1

critCount

Posted: 30 Jul 2008, 13:38
by sli
UPDATED: New hook name committed to SVN, plugin has been updated. No more complicated install procedure!

This is what it does:
Exp gained: 1293/0 (0.01%/0.00%)
Critical Percentage: 8.18% (Atks: 272 | Crits: 22)
This plugin isn't for those who aren't comfortable modifying OpenKore's source. If you don't like how I implemented the plugin, then you do it your own way. I wanted my crit percent displayed after every kill with the experience gained. Don't be surprised if it says 100% crit the first few times. Here's the plugin:

Code: Select all

package critCount;

use Plugins;

Plugins::register('critCount','Various crit stats.', \&onUnload);
my $hooks = Plugins::addHooks(
	['packet_attack', \&onAttack, undef],
	['target_died', \&onKill, undef]
);

my $crits = 0;
my $attacks = 0;
my $critPerc = 0;

sub onAttack {
	my @args = @_;

	$attacks++;
	if ($args[1]{'type'} == 10) {
		$crits++;
		$critPerc = ($crits / $attacks) * 100;
	}
}

sub onKill {
	printf "Critical Percentage: %.2f%% (Atks: %d | Crits: %d)\n", $critPerc, $attacks, $crits;
}

sub onUnload {
	Plugins::deleteHooks($hooks);
}
No more editing required to install!

Re: critCount

Posted: 31 Jul 2008, 10:25
by iamanoob
in src/AI/Attack.pm

sub finishAttacking {
my $args = AI::args;
$timeout{'ai_attack'}{'time'} -= $timeout{'ai_attack'}{'timeout'};
my $ID = $args->{ID};
AI::dequeue;
if ($monsters_old{$ID} && $monsters_old{$ID}{dead}) {
message T("Target died\n"), "ai_attack";
//Plugins::callHook('TargetDied');
Plugins::callHook('monster_dead');
monKilled();

ive done it to be like this because its a party
AND its NOT accurate... XD

Re: critCount

Posted: 04 Aug 2008, 18:14
by sli
Pretty damn accurate when I use it. How long do you let it run?

Critical Percentage: 11.23% (Atks: 1550 | Crits: 174)
174 / 1550 = 0.11225806451612903225806451612903
0.11225806451612903225806451612903 * 100 = 11.225806451612903225806451612903%

That doesn't seem inaccurate to me. Unless you consider rounding up to 11.23 as an gross inaccuracy.
Also...
sli wrote:Don't be surprised if it says 100% crit the first few times.

Re: critCount

Posted: 21 Aug 2008, 11:11
by Kafka
does this work on 2.0.5.1 and is it a running count of your TOTAL hit percentage or does it just calculate hit percentage from single fights?

Re: critCount

Posted: 21 Aug 2008, 15:37
by sli
No idea and ALL it does is count your total crit percentage. This...

Code: Select all

Critical Percentage: 11.23% (Atks: 1550 | Crits: 174)
...would be one hell of a fight.

Re: critCount

Posted: 21 Aug 2008, 17:40
by Kafka
1550 hits... critical 1s.

99 DEX/LUK 1 STR.

Re: critCount

Posted: 04 Oct 2008, 06:51
by freedoom07
ImageImage

why in my Openkore not work ???
i use Openkore 2.0.5.1 and 2.0.6.1
and i try in 2 Openkore not work all.
:( :(

Re: critCount

Posted: 04 Oct 2008, 14:38
by sli
Your plugin loading settings are wrong.