doCommand plugin
Posted: 05 Apr 2008, 05:21
tested can be use on Openkore v2.0.0 to 2.0.5.2
Usage
Code: Select all
package doCommand;
# This plugin is licensed under the GNU GPL
# Copyright 2005 by kaliwanagan
# --------------------------------------------------
use strict;
use Plugins;
use Globals;
use Log qw(message warning error);
use Misc;
use Utils;
use Commands;
use Time::HiRes qw(time);
Plugins::register('doCommand', 'do a command on certain conditions', \&Unload);
my $hook = Plugins::addHook('AI_post', \&doCommand);
sub Unload {
Plugins::delHook('AI_post', $hook);
}
my $time;
sub doCommand {
my $prefix = "doCommand_";
for (my $i =0; (exists $config{$prefix.$i}); $i++) {
if ((main::checkSelfCondition($prefix.$i)) && main::timeOut($time, $config{$prefix.$i."_timeout"})) {
Commands::run($config{$prefix.$i});
$time = time;
}
}
}
return 1;
Other sub-condition can be use...doCommand ai clear {
timeout 3500
}
doCommand e thx {
whenStatusActive Blessing
timeout 120
}
doCommand e heh {
whenStatusActive Increase AGI
timeout 120
}
doCommand e no1 {
whenStatusActive Kyrie Eleison
timeout 120
}
Code: Select all
maxUses
target
* (Target Monster Conditions)
lvl
maxCastTime
minCastTime
equip
* (Target Monster Conditions)
aggressives
defendMonsters
disabled
hp
inCart
inInventory
inLockOnly
monsters
notInTown
notMonsters
notOnAction
notInMap
notWhileSitting
onAction
inMap
partyAggressives
sp
spirit
stopWhenHit
timeout
whenFlag
whenFollowing
whenGround
whenIdle
whenNotFlag
whenNotGround
whenNotPermitSkill
whenPermitSkill
whenStatusActive
whenStatusInactive
whenWater
* (Target Monster Conditions)
target_deltaHp
target_dist
target_misses
target_timeout
target_totalMisses
target_whenGround
target_whenNotGround
target_whenShieldEquipped
target_whenStatusActive
target_whenStatusInactive
target_whenWeaponEquipped