Auto Refine (2.0.6 SVN only)

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
shinchan_007
Noob
Noob
Posts: 10
Joined: 20 Dec 2009, 01:19
Noob?: No

Re: Auto Refine (2.0.6 SVN only)

#51 Post by shinchan_007 »

hello guys

I am not getting any solution for my Refine Armor and shoes related issue so i thought of posting my config txt here in
in which i play in the high rate server the zeny required 2000 only to refine the shoes and armor . so do i have to update the zeny from 3000 to 2000 once ???

and also how do i know my plugins is working or not ?????? so i a uploading my plugins too some techinical support ??? if my auto-refine.pl is wrong or corrupted plz correct me by guiding me the rightway ..

thanks in advance

Code: Select all

autoRefine Shoes [1] {
	refineStone Elunium
	refineNpc prt_in 63 60
	npcSequence c r1 c r0 c w1 c w1 r0 w1 c c n
	zeny 3000
	maxRefine 9
	disabled 0
}



itemsTakeAuto 2
itemsTakeAuto_party 0
itemsGatherAuto 2
itemsMaxWeight 89
itemsMaxWeight_sellOrStore 48
itemsMaxNum_sellOrStore 99
cartMaxWeight 7900
itemsTakeAuto_new 0
    
route_escape_reachedNoPortal 1
route_escape_randomWalk 1
route_escape_shout
route_avoidWalls 1
route_randomWalk 1
route_randomWalk_inTown 0
route_randomWalk_maxRouteTime 75
route_maxWarpFee
route_maxNpcTries 5
route_teleport 0
route_teleport_minDistance 150
route_teleport_maxTries 8
route_teleport_notInMaps
route_step 15



sitAuto_hp_lower 40
sitAuto_hp_upper 100
sitAuto_sp_lower 0
sitAuto_sp_upper 0
sitAuto_over_50 0
sitAuto_idle 1
sitAuto_look
sitAuto_look_from_wall




sellAuto 0
sellAuto_npc
sellAuto_standpoint
sellAuto_distance 5

storageAuto 0
storageAuto_npc
storageAuto_distance 5
storageAuto_npc_type 1
storageAuto_npc_steps
storageAuto_password
storageAuto_keepOpen 0
storageAuto_useChatCommand
relogAfterStorage 1
minStorageZeny 50

npcTimeResponse

getAuto {
	minAmount
	maxAmount
	passive
}
Attachments

[The extension pl has been deactivated and can no longer be displayed.]


Cirvaazny
Noob
Noob
Posts: 3
Joined: 19 Jan 2010, 00:57
Noob?: No
Location: Anchorage, Alaska, USA

Re: Auto Refine (2.0.6 SVN only)

#52 Post by Cirvaazny »

shinchan_007 wrote:hello guys

I am not getting any solution for my Refine Armor and shoes related issue so i thought of posting my config txt here in
in which i play in the high rate server the zeny required 2000 only to refine the shoes and armor . so do i have to update the zeny from 3000 to 2000 once ???

and also how do i know my plugins is working or not ?????? so i a uploading my plugins too some techinical support ??? if my auto-refine.pl is wrong or corrupted plz correct me by guiding me the rightway ..

thanks in advance

<snip>

Code: Select all

autoRefine Shoes [1] {
	refineStone Elunium
	refineNpc prt_in 63 60
	npcSequence c r1 c r0 c w1 c w1 r0 w1 c c n
	zeny 3000
	maxRefine 9
	disabled 0
}
<snip>
This was the only part of the config that is relevant to this plugin (what was needed), from what I can see it looks OK. You have the latest version of the plugin as well so that shouldn't be an issue. Changing the zeny to 2000 is optional, basically Kore will check against it and will only attempt to upgrade if you have more than zeny amount.

I read your other post, I believe you said the plugin would route to the npc then just sit in front of it? If this is not the case (it won't route), check to make sure the plugin is getting loaded (type plugin in your OpenKore console). Also double check the npcSequence and make sure it is correct to what you are trying to upgrade, and check the refine npc's location (map name and co-ordinates).

If you get any kind of error while the plugin is running, list the error here.

shinchan_007
Noob
Noob
Posts: 10
Joined: 20 Dec 2009, 01:19
Noob?: No

Re: Auto Refine (2.0.6 SVN only)

#53 Post by shinchan_007 »

hello guys

Still no solution of my queries. my bot is just sitting not refining anything and i have also updated the given code in my config txt

Code:
autoRefine Shoes [1] {
refineStone Elunium
refineNpc prt_in 63 60
npcSequence c r1 c r0 c w1 c w1 r0 w1 c c n
zeny 3000
maxRefine 9
disabled 0
}

plugin code status :

--------- Currently loaded plugins ---------
# Name Description
0 Auto-Refine What do you think?
1 macro allows usage of macros
--------------------------------------------

-----------NPC List-----------
# Name Coordinates ID
0 Hollengrhen (63, 60) 110003257

esengwafu
Noob
Noob
Posts: 10
Joined: 19 Nov 2009, 20:03
Noob?: Yes

Re: Auto Refine (2.0.6 SVN only)

#54 Post by esengwafu »

Here is the config

Code: Select all

autoRefine Shoes [1] {
refineStone Elunium
refineNpc prt_in 63 60
npcSequence c r1 c r0 c w1 c w1 r0 w1 c c n
zeny 3000
maxRefine 9
disabled 0
}
Here is the Updated Plugin

Code: Select all

#########################################################################
#  OpenKore - Auto-Refine
#  Copyright (c) 2008 Bibian
#
# This plugin is licensed under Creative Commons "Attribution-NonCommercial-ShareAlike 2.5"
#
# You are free:
#    * to copy, distribute, display, and perform the work
#    * to make derivative works
# 
# Under the following conditions:
#    * by Attribution: You must attribute the work in the manner specified by the author or licensor.
#    * Noncommercial: You may not use this work for commercial purposes.
#    * Share Alike: If you alter, transform, or build upon this work, you may distribute the resulting work only under a license identical to this one.
#
#    * For any reuse or distribution, you must make clear to others the license terms of this work.
#    * Any of these conditions can be waived if you get permission from the copyright holder.
#
# Your fair use and other rights are in no way affected by the above.
#
# This is a human-readable summary of the Legal Code ( Full License: http://creativecommons.org/licenses/by-nc-sa/2.5/legalcode ). 
# Disclaimer: http://creativecommons.org/licenses/disclaimer-popup?lang=en
# 
#########################################################################
package autoRefine;

use strict;
use Plugins;
use Settings;
use Log qw(message error);
use Utils;
use Globals;
use Task;
use Task::MapRoute;
use Task::TalkNPC;

Plugins::register('Auto-Refine', 'What do you think?', \&unload);
my $hooks = Plugins::addHooks(
	['AI_pre',\&main, undef],
	['map_loaded', \&MapLoaded, undef],
	['packet/sendMapLoaded', \&MapLoaded, undef],
	['parseMsg/pre', \&itemEquiped, undef],
);

my ($item,$metal,$maploaded,$routeCallback,$talkCallback,%npc,$startRefine,$talking);

# Set $maploaded to 1, this incase we reload the plugin for whatever reason...
if ($net && $net->getState() == Network::IN_GAME) {
	$maploaded = 1;
}

sub unload {
    Plugins::delHooks($hooks);
}

$timeout{'refine'}{'timeout'} = 2; # No need to go any faster than 1 iteration per second
$timeout{'refine'}{'time'} = time;

sub main {
	return if (!$maploaded || !$config{"autoRefine_0"} || !timeOut($timeout{'refine'} || ($item && !$item->{equipped})));
	selectItem() if (!$item);
	
	return if (!$item || !$metal || $metal->{amount} < 1);
	
	my ($upgrade,$plus) = $item->name =~ /(.){2}/;
	$item->{upgrade} = $upgrade if ($plus eq "+");
	
	if (!$startRefine) {
		route($npc{map},$npc{x},$npc{y});
	} elsif ($startRefine && $item->{equipped} && $item->{upgrade} < $config{"autoRefine_0_maxRefine"}) { # Item exists, we have metals are near the refiner and equiped the item... it is also below the + treshhold we want
		talkNPC($npc{x},$npc{y},$npc{sequence});
	} elsif ($startRefine && !$item->{equipped}) { # Item exists in inventory but is not equiped, equip it
		$item->equip();
	} elsif ($startRefine && $item->{equipped} && $item->{upgrade} => $config{"autoRefine_0_maxRefine"}) { # Max refined reached, unequip it
		$item->unequip();
		undef $item;
		undef $metal;
	} else {
		$startRefine = 0;
		message("We have run out of items to refine or metals to refine them with!\n","info");
	}
	$timeout{'refine'}{'time'} = time;
}

sub selectItem {
	if ($config{"autoRefine_0"} && !$config{"autoRefine_0_disabled"} && $config{"autoRefine_0_refineStone"} && 
		$config{"autoRefine_0_refineNpc"} && $config{"autoRefine_0_npcSequence"} && $config{"autoRefine_0_zeny"} < $char->{zeny}) {
			
			$item = $char->inventory->getByName($config{"autoRefine_0"});
			$metal = $char->inventory->getByName($config{"autoRefine_0_refineStone"});
			($npc{map},$npc{x},$npc{y}) = $config{"autoRefine_0_refineNpc"} =~ /^(.*) (.*) (.*)$/ if ($item && $metal);
			$npc{sequence} = $config{"autoRefine_0_npcSequence"};
			if (!$item || !$metal) {
				undef $item;
				undef $metal;
			}
		}
	return 0;
}

sub route {
	return if ($taskManager->countTasksByName("MapRoute") > 0 || $startRefine);
	
	my $map = shift;
	my $x = shift;
	my $y = shift;
	my $routeTask = Task::MapRoute->new(map => $map, x => $x, y => $y, distFromGoal => 10, notifyUponArrival => 1);
	$taskManager->add($routeTask);
	$routeCallback = $taskManager->onTaskFinished->add(undef,\&toggleRefine);
}

sub toggleRefine {
	$taskManager->onTaskFinished->remove($routeCallback);
	$startRefine = 1;
}

sub talkNPC {
	return if ($taskManager->countTasksByName("TalkNPC") > 0 || $talking);
	my $x = shift;
	my $y = shift;
	my $sequence = shift;
	my $talkTask = Task::TalkNPC->new(x => $x, y => $y, sequence => $sequence);
	$taskManager->add($talkTask);
	$talking = 1;
	$talkCallback = $taskManager->onTaskFinished->add(undef,\&checkItem);
}

sub checkItem {
	$talking = 0;
	$item = $char->inventory->getByServerIndex($item->{index});
	$taskManager->onTaskFinished->remove($talkCallback);
	if (!$item) {
		$startRefine = 0;
		message("Item broke :(\n","info");
	} else {
		message("Upgraded ".$item->{name}."\n","info");
	}
}

sub itemEquiped {
	my ($self, $args) = @_;
	return if ($args->{switch} ne "00AA" || $args->{switch} ne "00AC"); # 00AA = Item is Equiped packet, 00AC = unequipped	
	$item->{equipped} = ($args->{switch} eq "00AA") ? 1 : 0; # If 00AA then 1, else 0
}

sub MapLoaded {
	$maploaded = 1;
}

return 1;
I'm Using Openkore 2.0.7

but still its just sitting can someone tell me why?
Last edited by esengwafu on 28 Jan 2010, 00:31, edited 1 time in total.

shinchan_007
Noob
Noob
Posts: 10
Joined: 20 Dec 2009, 01:19
Noob?: No

Re: Auto Refine (2.0.6 SVN only)

#55 Post by shinchan_007 »

hello guys

MY bot is still sitting not triggering any plugins nor refine the shoes

Plz give me download link for auto-refine.pl file , i am confused about these

plugins .in which format is auto-refine.pl file is ex ; HTML FORMAT OR DOS PL FORMATE ????

Code :
autoRefine Shoes [1] {
refineStone Elunium
refineNpc prt_in 63 60
npcSequence c r1 c r0 c w1 c w1 r0 w1 c c n
zeny 3000
maxRefine 9
disabled 0
}

Cloud
Plain Yogurt
Plain Yogurt
Posts: 86
Joined: 09 Apr 2008, 13:39

Re: Auto Refine (2.0.6 SVN only)

#56 Post by Cloud »

rename to .pl

shinchan_007
Noob
Noob
Posts: 10
Joined: 20 Dec 2009, 01:19
Noob?: No

Re: Auto Refine (2.0.6 SVN only)

#57 Post by shinchan_007 »

Hello guys
same problem bot is still sitting .......

My bot getting bug errors while loading the plugin load 0

someone please give me a download link for auto-refine.pl file coz i am getting bug in my console commands when i type the load plugin all . its showing the status plugins loaded

but when iI input the load plugin 0 which is the plugin for auto-refine.pl which is occuring frequent bug report for me...

so i am uploading my error txt file here!!!!!
Attachments
errors.txt
(1.04 KiB) Downloaded 357 times

Scarya
Moderators
Moderators
Posts: 136
Joined: 26 May 2008, 12:25
Noob?: No

Re: Auto Refine (2.0.6 SVN only)

#58 Post by Scarya »

shinchan_007 wrote:Hello guys
same problem bot is still sitting .......

My bot getting bug errors while loading the plugin load 0

someone please give me a download link for auto-refine.pl file coz i am getting bug in my console commands when i type the load plugin all . its showing the status plugins loaded

but when iI input the load plugin 0 which is the plugin for auto-refine.pl which is occuring frequent bug report for me...

so i am uploading my error txt file here!!!!!
How good are your reading skills?

Code: Select all

Loaded plugins:
  plugins/auto-refine.pl (Auto-Refine)
  plugins/macro.pl (macro)
If you load all plugins you don't have to single load auto-refine.pl.
And because of your sitting... check config.txt, like followSitAuto and sitAuto*.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs and the universe trying to produce bigger and better idiots.
So far, the universe is winning.

Richard Cook

Wiki

shinchan_007
Noob
Noob
Posts: 10
Joined: 20 Dec 2009, 01:19
Noob?: No

Re: Auto Refine (2.0.6 SVN only)

#59 Post by shinchan_007 »

Hello Guys


Please give me you whole file of Config txt file and Plugins for auto-refine pl file


I have done everything so far as mention in wiki and forums but i dont know whey my plugins is not triggering the bot and not refine any armor nor shoes

again i am updating my what i have still done so far to make everything

config txt file
autoRefine Shoes [1] {
refineStone Elunium
refineNpc prt_in 63 60
npcSequence c r1 c r0 c w1 c w1 r0 w1 c c n
zeny 3000
maxRefine 9
disabled 0
}

shinchan_007
Noob
Noob
Posts: 10
Joined: 20 Dec 2009, 01:19
Noob?: No

Re: Auto Refine (2.0.6 SVN only)

#60 Post by shinchan_007 »

Hello Guys

Still no reply yet ???

Post Reply