New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autobuy -> Overweight #1526

Open
Fvegini opened this Issue Dec 21, 2017 · 6 comments

Comments

Projects
None yet
5 participants
@Fvegini

Fvegini commented Dec 21, 2017

------------------ Bug Report Template ------------------

Summary:

Kore keeps trying to "autobuy" when weight is full instead of do an autosell and only then do the autobuy

Affected configuration(s)/ file(s):

config.txt

Impact:

Openkore keeps stucked until manually insert an "autosell" or "autostorage" command

Expected Behavior:

When kore got the error from autobuy, it should try to release from the items exceed, selling or storaging then (if none are configurated, then it should keep stucked)

Actual Behavior:

Kore jeeps stuck in the autobuy routine

peso

@sctnightcore

This comment has been minimized.

Show comment
Hide comment
@sctnightcore

sctnightcore Dec 21, 2017

Contributor

Use with New openkore ?

Contributor

sctnightcore commented Dec 21, 2017

Use with New openkore ?

@Fvegini

This comment has been minimized.

Show comment
Hide comment
@Fvegini

Fvegini Dec 21, 2017

Maybe one version from two weeks ago!

I will update and try to simulate it again to see if keeps hapening!

Fvegini commented Dec 21, 2017

Maybe one version from two weeks ago!

I will update and try to simulate it again to see if keeps hapening!

@Fvegini

This comment has been minimized.

Show comment
Hide comment
@Fvegini

Fvegini Dec 21, 2017

Same issue with the last version of openkore.

Kore is with 68% of weight trying to buy red potions.

I think the config is alright:

buyAuto Red Potion {
npc payon_in01 5 49
standpoint
distance 5
price 50
minAmount 0
maxAmount 300
batchSize
disabled 0
label buyredpot
}

If I manually send him "autosell", he sells, return to the autobuy routine and go to lockmap

Edit: I think this is an old problem, because I can see in my old macros.txt (two years ago) this automacro:

automacro pesou {
console /(excesso de peso)/
timeout 20
overrideAI 1
exclusive 1
call {
pause 2
do autosell
pause 2
}
}

Fvegini commented Dec 21, 2017

Same issue with the last version of openkore.

Kore is with 68% of weight trying to buy red potions.

I think the config is alright:

buyAuto Red Potion {
npc payon_in01 5 49
standpoint
distance 5
price 50
minAmount 0
maxAmount 300
batchSize
disabled 0
label buyredpot
}

If I manually send him "autosell", he sells, return to the autobuy routine and go to lockmap

Edit: I think this is an old problem, because I can see in my old macros.txt (two years ago) this automacro:

automacro pesou {
console /(excesso de peso)/
timeout 20
overrideAI 1
exclusive 1
call {
pause 2
do autosell
pause 2
}
}

@Fadreus

This comment has been minimized.

Show comment
Hide comment
@Fadreus

Fadreus Dec 22, 2017

Contributor

I believe this happen when;

You loot items > Then red pot reach minimum > bot autoBuy > your loots in the way = prevent buying 300 red pot.

If this is the case, I wouldn't say it's a bug or problem on kore (unless kore suppose to ignore autobuy when exceed weight).

Contributor

Fadreus commented Dec 22, 2017

I believe this happen when;

You loot items > Then red pot reach minimum > bot autoBuy > your loots in the way = prevent buying 300 red pot.

If this is the case, I wouldn't say it's a bug or problem on kore (unless kore suppose to ignore autobuy when exceed weight).

@Fvegini

This comment has been minimized.

Show comment
Hide comment
@Fvegini

Fvegini Dec 22, 2017

fadreus, this seems to be the exactly scenario when it happens!

In my point of view openkore don't use the weight of the items.. so it can't ignore the autobuy when it checks is "full"
But just adding an autosell/autostorage after the prompted message would be enough

One bad way I can think in do it, would be: (bad programming skills)

src/Network/Receive/ServerType0.pm Line 1352

} elsif ($args->{fail} == 2) {
	error T("Buy failed (insufficient weight capacity).\n")
}

to

} elsif ($args->{fail} == 2) {
	error T("Buy failed (insufficient weight capacity).\n")
	if (Autosell == 1) do autosell
	if (Autostorage ==1) do autostorage
}

I know this isn't the correct syntax and not even the correct file to put actions... but I don't know how to get to the file that is calling this sub and never saw perl outside the openkore world.

Fvegini commented Dec 22, 2017

fadreus, this seems to be the exactly scenario when it happens!

In my point of view openkore don't use the weight of the items.. so it can't ignore the autobuy when it checks is "full"
But just adding an autosell/autostorage after the prompted message would be enough

One bad way I can think in do it, would be: (bad programming skills)

src/Network/Receive/ServerType0.pm Line 1352

} elsif ($args->{fail} == 2) {
	error T("Buy failed (insufficient weight capacity).\n")
}

to

} elsif ($args->{fail} == 2) {
	error T("Buy failed (insufficient weight capacity).\n")
	if (Autosell == 1) do autosell
	if (Autostorage ==1) do autostorage
}

I know this isn't the correct syntax and not even the correct file to put actions... but I don't know how to get to the file that is calling this sub and never saw perl outside the openkore world.

@lututui lututui added the bug label Dec 22, 2017

@lututui lututui self-assigned this Dec 22, 2017

@OpenKore OpenKore deleted a comment from imthemenace Dec 23, 2017

@Mortimal

This comment has been minimized.

Show comment
Hide comment
@Mortimal

Mortimal Dec 27, 2017

Contributor

Try src/Network/Receive/ServerType0.pm Line 1352:

	} elsif ($args->{fail} == 2) {
		error T("Buy failed (insufficient weight capacity).\n");
		AI::args->{recv_buy_packet_owg} = 1;

and src/AI/CoreLogic.pm Line 1735:

if (AI::action eq "buyAuto" && AI::args->{'done'}) {
		if (exists $args->{recv_buy_packet_owg}){
			delete $args->{recv_buy_packet_owg};
			delete $args->{recv_buy_packet};
			AI::dequeue;
			AI::queue("sellAuto", {forcedByBuy => 1});
			return;
		}
		if (exists AI::args->{'error'}) {
			error AI::args->{'error'}.".\n";
		}

I cant test this i am not botting now

Contributor

Mortimal commented Dec 27, 2017

Try src/Network/Receive/ServerType0.pm Line 1352:

	} elsif ($args->{fail} == 2) {
		error T("Buy failed (insufficient weight capacity).\n");
		AI::args->{recv_buy_packet_owg} = 1;

and src/AI/CoreLogic.pm Line 1735:

if (AI::action eq "buyAuto" && AI::args->{'done'}) {
		if (exists $args->{recv_buy_packet_owg}){
			delete $args->{recv_buy_packet_owg};
			delete $args->{recv_buy_packet};
			AI::dequeue;
			AI::queue("sellAuto", {forcedByBuy => 1});
			return;
		}
		if (exists AI::args->{'error'}) {
			error AI::args->{'error'}.".\n";
		}

I cant test this i am not botting now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment