Page 1 of 2

arrowCraft.pl 2.0.5.+

Posted: 19 Aug 2008, 03:37
by fco2783

Code: Select all

package arrowCraft;
 
#
# This plugin is licensed under the GNU GPL
# Copyright 2005 by kaliwanagan
# Fixed for OpenKore 2.0.5+
# --------------------------------------------------
#
# How to install this thing..:
#
# in control\config.txt add:
# 
#arrowCraft Zargon {
#       delay 3 # specify number of seconds to wait before crafting another arrow; defaults to 1
#       inInventory Silver Arrow <10
#       onAction attack
#}
 
use strict;
use Plugins;
use Globals;
use Log qw(message warning error debug);
use AI;
use Misc;
use Network;
use Network::Send;
 
Plugins::register('arrowCraft', 'use arrow craft without SP', \&Unload);
my $hook = Plugins::addHook('AI_pre', \&cast);
 
sub Unload {
        Plugins::delHook('AI_pre', $hook);
}
 
my %delay;
 
sub cast {
	my $prefix = "arrowCraft_";
	my $i = 0;
       
	while (exists $config{$prefix.$i}) {
		my $item = $char->inventory->getByName($config{$prefix.$i});
		
		$delay{'timeout'} = $config{$prefix.$i."_delay"} || 1;
		if ((@{$char->{inventory}->getItems()}) &&
			(main::timeOut(\%delay)) &&
			($item->{'amount'} > 0) &&
			(main::checkSelfCondition($prefix.$i))) 
		{
				#Remove the comment bellow if you play on eathena server
				#Commands::run('arrowcraft use');
			sendArrowCraft($messageSender,$item->{'nameID'});
			message ("You use Arrow Craft on item: " . $item->{'name'} . "\n", "selfSkill");
			$delay{'time'} = time;
		}
		$i++;
        }
}
 
return 1;
Usage:
arrowCraft Zargon {
delay 3
inInventory Silver Arrow <10
onAction attack
}

Re: arrowCraft.pl 2.0.5.+

Posted: 19 Aug 2008, 04:26
by fco2783
i hope someone could post here arrowCraft for openkore 2.0.0 :)

Re: arrowCraft.pl 2.0.5.+

Posted: 19 Aug 2008, 09:18
by sli
There's always the built in functionality in the SVN version...

Re: arrowCraft.pl 2.0.5.+

Posted: 19 Aug 2008, 23:24
by fco2783
sli wrote:There's always the built in functionality in the SVN version...
yah i know but they did not preform what i wanted...

at config.txt

Code: Select all

autoMakeArrows 1
at arrowcraft.txt

Code: Select all

Red Blood 1
Live Coal 1
Burning Hair 1
Buning Heart 1
this configuration only just work when kore log-in... but while on the actual botting in the mid attack on the monster or in the route AI... kore just ignored this configuration...

i want something like arrowCraft.pl

Code: Select all

arrowCraft Zargon {
delay 3
inInventory Silver Arrow <10
onAction attack
}
i could not use macro on this...

Re: arrowCraft.pl 2.0.5.+

Posted: 19 Aug 2008, 23:59
by help_us

Code: Select all

automacro arrowCraft {
	eval AI::action eq "attack" # when ai seq is attack
	inventory "Silver Arrow" < 10 # when silver arrow less than 10
	delay 3 # delay before call
	call {
		do ss 147 1 # here your skill Arrow Crafting
	}
}
still can use in macros :lol:

Re: arrowCraft.pl 2.0.5.+

Posted: 20 Aug 2008, 04:50
by fco2783
@help_us
you been very helpful to me... but that wont work... it only trigger the Arrow Crafting skills.

in which you got to type on the console "arrowcraft 0"
in which 0 might be Zargon, Elunium, Burning Heart, Flame Heart, Crystal Blue and etc...

Re: arrowCraft.pl 2.0.5.+

Posted: 21 Aug 2008, 07:35
by help_us
oh sorry i`m forget part convert item.

Code: Select all

automacro arrowCraft {
	eval AI::action eq "attack"
	inventory "Silver Arrow" < 10
	delay 3
	call crafting
}

macro crafting {
	do ss 147
	pause 1
	$ID = 912
	# 912 = Zargon

	do eval $::messageSender->sendArrowCraft($ID);
}
for OK 2.0.0 mayb u need change eval. not so sure but sure you can test it,

Code: Select all

do eval sendArrowCraft(\$remote_socket,$ID);

Re: arrowCraft.pl 2.0.5.+

Posted: 21 Aug 2008, 08:00
by iamanoob
help_us wrote:

Code: Select all

do eval sendForgeItem(\$remote_socket,$ID);
is this for whitesmith refine skill?
or for arrowcraft ONLY or TOO?

Re: arrowCraft.pl 2.0.5.+

Posted: 21 Aug 2008, 09:36
by help_us
i`m not sure about it for refine.

p/s : sorry my bad, wrong eval. edit*

Re: arrowCraft.pl 2.0.5.+

Posted: 24 Aug 2008, 03:27
by fco2783
thanks a lot help_us

will this be ok putting some "route" instead of "attack"

Code: Select all

automacro arrowCraft {
	eval AI::action eq "route"
	inventory "Fire Arrow" < 50
	inventory "Fire Arrow" > 10
	delay 3

	call {
		do ss 147
		pause 1
		$ID = 7097
		# 912 = Zargon

		do eval $::messageSender->sendArrowCraft($ID);
	}
}