[comboSpam] Updated

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
goldseeker
Noob
Noob
Posts: 13
Joined: 03 Jul 2008, 22:06
Noob?: No

[comboSpam] Updated

#1 Post by goldseeker »

Well, I did some corrections to compoSpam, it's working with up to date version of Openkore:

Code: Select all

package comboSpam;

use strict;
use Plugins;
use Globals;
use Skill;
use Misc;
use Network;
use Network::Send;
use Utils;
use Time::HiRes qw(time usleep);


Plugins::register('comboSpam', 'spam combo packets', \&on_unload);
my $hook1 = Plugins::addHook('packet/actor_status_active', \&combo);
my $hook2 = Plugins::addHook('AI_pre', \&AI_pre);
my $combo = 0;
my $delay = .2;
my $time = time;

sub on_unload {
	# This plugin is about to be unloaded; remove hooks
	Plugins::delHook("packet/actor_status_active", $hook1);
	Plugins::delHook("AI_pre", $hook1);
}

sub combo {
	my ($packet, $args) = @_;
	my ($type, $ID, $flag) = @{$args}{qw(type ID flag)};
	
	if ($char->statusActive('EFST_COMBOATTACK')) {
		$combo = $flag;
	}
}

sub AI_pre {
	my ($self, $args) = @_;
	
	if ($combo && main::timeOut($time, $delay)) {
		#sendSkillUse($net, 272, 5, $accountID); # Chain Combo
		$messageSender->sendSkillUse($net, 272, 5, $accountID); # Chain Combo
		if ($char->{spirits}) { # Make sure there is a spirit sphere
			#sendSkillUse($net, 273, 5, $accountID); # Combo Finish
			$messageSender->sendSkillUse($net, 273, 5, $accountID); # Combo Finish
		}
		$time = time;
	}
}

1;