ComboSpam.pl -> Help on Checking $char->{statuses}

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
powerbox
Noob
Noob
Posts: 2
Joined: 14 Mar 2011, 21:10
Noob?: Yes

ComboSpam.pl -> Help on Checking $char->{statuses}

#1 Post by powerbox »

Hi guys this is the first time I'm going to create my own plugin aside from doing it as a macro. I've been reading a lot of plugins on plugin SVN and some of the plugins and hooks on old code does not exists anymore. I wanted to use the comboSpam.pl on my monk but the code is not working properly.

So far I managed to accomplished the things I wanted and just spam chain combo and combo finished while attacking.

Code: Select all

package comboSpam;

use strict;
use Time::HiRes qw(time usleep);
use IO::Socket;
use Text::ParseWords;
use Config;
eval "no utf8;";
use bytes;

use Globals;
use Skill;
use Modules;
use Settings;
use Log qw(message warning error debug);
use FileParsers;
use Interface;
use Network::Receive;
use Network::Send;
use Commands;
use Misc;
use Plugins;
use Utils;
use ChatQueue;
use Time::HiRes qw(time usleep);

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

sub on_unload {
	Plugins::delHook("AI_pre", $hook1);
}

sub AI_pre {
	my ($self, $args) = @_;
	
	if ( AI::action eq "attack") {
		
		if ( main::timeOut($time, $delay)) {
			sendSkillUse($net, 272, 5, $accountID); 
			if ($char->{spirits}) { 
				sendSkillUse($net, 273, 5, $accountID); 
			}
			$time = time;
		}
	}
}
I copied the old code from comboSpam.pl and re-code it so that it will only be triggered when the current AI action is "attack". What I wanted to do is to know if current status is "Combo Attack". Can anyone show me how to do this properly? I've been playing with $char->{statuses} but I don't know how to extract the info properly. I've also read Misc.pl and it seems that statuses are being set to 1 if active or not and is accessed by some sort of a $handle. This is the point we're I'm lost, I don't know where to get the key actually.

Thanks for the help!

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

Re: ComboSpam.pl -> Help on Checking $char->{statuses}

#2 Post by EternalHarvest »

Code: Select all

if ($char->statusActive('EFST_COMBOATTACK')) {

powerbox
Noob
Noob
Posts: 2
Joined: 14 Mar 2011, 21:10
Noob?: Yes

Re: ComboSpam.pl -> Help on Checking $char->{statuses}

#3 Post by powerbox »

Thanks! Ok I didn't thought of looking on statusnametable.txt hehe.

Francesco24
Noob
Noob
Posts: 12
Joined: 06 Dec 2008, 11:59
Noob?: Yes

Re: ComboSpam.pl -> Help on Checking $char->{statuses}

#4 Post by Francesco24 »

Would be possible to use this plugin just with some monsters?
What's the code to add one more IF sentence to specify just some monsters?

Thanks

Post Reply