critCount

Other plugins for extending OpenKore's functionality. This forum is only for posting new plugins and commenting on existing plugins. For support, use the Support forum.

Moderator: Moderators

Message
Author
sli
Perl Monk
Perl Monk
Posts: 810
Joined: 04 Apr 2008, 17:26
Noob?: No

critCount

#1 Post 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!
cs : ee : realist

iamanoob
Plain Yogurt
Plain Yogurt
Posts: 82
Joined: 04 Apr 2008, 09:49

Re: critCount

#2 Post 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
Image
DARKest Ninja

sli
Perl Monk
Perl Monk
Posts: 810
Joined: 04 Apr 2008, 17:26
Noob?: No

Re: critCount

#3 Post 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.
cs : ee : realist

Kafka
Human
Human
Posts: 26
Joined: 15 Aug 2008, 08:54
Noob?: No

Re: critCount

#4 Post 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?
You're not going to try and tell me you think you can diddle your way out of a criminal charge with an adding machine!

sli
Perl Monk
Perl Monk
Posts: 810
Joined: 04 Apr 2008, 17:26
Noob?: No

Re: critCount

#5 Post 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.
cs : ee : realist

Kafka
Human
Human
Posts: 26
Joined: 15 Aug 2008, 08:54
Noob?: No

Re: critCount

#6 Post by Kafka »

1550 hits... critical 1s.

99 DEX/LUK 1 STR.
You're not going to try and tell me you think you can diddle your way out of a criminal charge with an adding machine!

freedoom07
Noob
Noob
Posts: 2
Joined: 19 Jul 2008, 10:33
Noob?: Yes

Re: critCount

#7 Post 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.
:( :(

sli
Perl Monk
Perl Monk
Posts: 810
Joined: 04 Apr 2008, 17:26
Noob?: No

Re: critCount

#8 Post by sli »

Your plugin loading settings are wrong.
cs : ee : realist

Post Reply