ComboApam.pl error

All resolved question will be found here. It is recommended that you browse / search through this section first and see if your question has been answered before

Moderators: Moderators, Documentation Writers

Message
Author
rafinhahot
Noob
Noob
Posts: 2
Joined: 03 Jun 2011, 11:49
Noob?: No

ComboApam.pl error

#1 Post by rafinhahot »

My plugin ComboSpam it's perfect but don't run in 2.1

I don't know what to do.
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 ($skillsStatus{$type} eq "Triple Attack Delay") {
$combo = $flag;
}
}

sub AI_pre {
my ($self, $args) = @_;

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

1;

EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: ComboApam.pl error

#2 Post by EternalHarvest »

openkore.com, "porting plugins".

Locked