Error in modified storage process

Forum closed. All further discussion to be discussed at https://github.com/OpenKore/

Moderator: Moderators

Message
Author
setsunaseiei
Human
Human
Posts: 38
Joined: 17 May 2011, 07:09
Noob?: No

Error in modified storage process

#1 Post by setsunaseiei »

Inventory to storage in CoreLogic.pm:

Code: Select all

$args->{nextItem} = 0 unless $args->{nextItem};
				for (my $i = $args->{nextItem}; $i < @{$char->inventory->getItems()}; $i++) {
					my $item = $char->inventory->getItems()->[$i];
					next if $item->{equipped};
					next if ($item->{broken} && $item->{type} == 7);
Then, I have added this line of code in CoreLogic.pm

Code: Select all

next if ($item->{name} =~ /(.*) Card/);
When the cards are to be stored, the sub jumps to

Code: Select all

if (percent_weight($char) >= $config{'itemsMaxWeight_sellOrStore'} && ai_storageAutoCheck()) {
			error T("Character is still overweight after storageAuto (storage is full?)\n");
			if ($config{dcOnStorageFull}) {
				error T("Disconnecting on storage full!\n");
				chatLog("k", T("Disconnecting on storage full!\n"));
				quit();
			}
Is there something wrong with the line that I have added?
オペンコレ!

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

Re: Error in modified storage process

#2 Post by EternalHarvest »

ai_storageAutoCheck checks for items to be storaged too. Instead, modify Misc::items_control which is used to determine whether to storage a certain item or not, to something like this:

Code: Select all

sub items_control {
	my ($name) = @_;

	my $control = $items_control{lc($name)} || $items_control{all} || {};
	$control->{storage} = 0 if $name =~ /^.* Card$/;
	return $control;
}

ruov
Noob
Noob
Posts: 2
Joined: 07 Aug 2011, 04:05
Noob?: Yes

Re: Error in modified storage process

#3 Post by ruov »

I used this code for the Misc.pm for my bot to automatically recognize any card and not store it.
I got it from EternalHarvest from this thread: http://forums.openkore.com/viewtopic.php?f=37&t=14974

Code: Select all

my $control = $items_control{lc($name)} || $items_control{all} || {};
	$control->{storage} = 0 if $name =~ /^.* Card$/;
	return $control; 
So my sub items_control looks like this:

Code: Select all

sub items_control {
	my ($name) = @_;

	my $control = $items_control{lc($name)} || $items_control{all} || {};
	$control->{storage} = 0 if $name =~ /^.* Card$/;
	return $control;
}
The code did it's job in recognizing cards and not storing it
(Since cards cannot be put into storage in my server) but
it also did not store anything else in my inventory so my
character ended up being overweight.

What it did was everytime autostorage is triggered when
my bot ran out of potions, it getAuto'ed potions
but did not autostore any of my loot.

My character is stuck at 77% weight.
This is what my autostorage log looked like:

Code: Select all

Initiating auto-storage.
You are now in the game
Your Coordinates: 154, 182
You are now: Owg 50%
You are now: Awakening Potion (Duration: 1260.674s)
Allowed other player invite to Party
Other players are not allowed to view your Equipment.
NPC Exists: Second_Cash_Seller (151, 183) (ID 50030) - (0)
NPC Exists: Odin's Cash manager#phi (158, 183) (ID 50407) - (1)
NPC Exists: Mr. Click#job_min (143, 170) (ID 50748) - (2)
NPC Exists: Karian#cmd2 (146, 168) (ID 50749) - (3)
NPC Exists: Eden Teleport Officer#1 (144, 189) (ID 50943) - (4)
NPC Exists: Airship  Representative (142, 183) (ID 51793) - (5)
NPC Exists: Cool Event Voting Staff (153, 191) (ID 55897) - (6)
NPC Exists: Kafra Employee (152, 187) (ID 57256) - (7)
NPC Exists: First_Cash_Seller (164, 183) (ID 50010) - (8)
NPC Exists: Kafra Voting Staff#yuno (162, 191) (ID 55895) - (9)
NPC Exists: Magic Tool Dealer (163, 187) (ID 57117) - (10)
Kafra Employee: [Kafra Employee]
Kafra Employee: The Kafra Corporation
Kafra Employee: is always working to provide
Kafra Employee: you with convenient services.
Kafra Employee: How may I be of assistance?
Kafra Employee: Auto-continuing talking
----------Responses-----------
#  Response
0  Save
1  Use Storage
2  Use Teleport Service
3  Rent a Pushcart
4  Check Other Information
5  Cancel
6  Cancel Chat
-------------------------------
Kafra Employee: Type 'talk resp #' to choose a response.
You are again: Owg 50%
You lost 40 zeny.
Kafra Employee: [Kafra Employee]
Kafra Employee: Here, let me open
Kafra Employee: your Storage for you.
Kafra Employee: Thank you for using
Kafra Employee: the Kafra Service.
Kafra Employee: Done talking
Done talking with Kafra Employee.
Successfully entered storage password.
Storage opened.
Storage logged
Disconnecting (202.57.117.125:5000)...disconnected
Relogging in 5 seconds...
I've only started understanding and experimenting with the codes
so I'm no expert yet.

What code do I need to insert to fix this?

*EDIT: removed word "not" in "my character is NOT stuck"

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

Re: Error in modified storage process

#4 Post by EternalHarvest »

ruov wrote:

Code: Select all

Storage opened.
Storage logged
Disconnecting (202.57.117.125:5000)...disconnected
Looks like a wrong or buggy serverType.

ruov
Noob
Noob
Posts: 2
Joined: 07 Aug 2011, 04:05
Noob?: Yes

Re: Error in modified storage process

#5 Post by ruov »

EternalHarvest wrote:
ruov wrote:

Code: Select all

Storage opened.
Storage logged
Disconnecting (202.57.117.125:5000)...disconnected
Looks like a wrong or buggy serverType.
I think it's not. I have mine set so that every time it finishes auto-storing, it reconnects automatically.
I'm trying to come up with a macro instead. Will keep you posted.

Locked