Stuck autosell/autobuy
Moderator: Moderators
Stuck autosell/autobuy
my bot keeps getting stuck at auto buying probably because of the max weight autosell,autostore.
is there a way to autosell first then only auto buy or autosell everytime i go back to town
is there a way to autosell first then only auto buy or autosell everytime i go back to town
- fadreus
- The Kore Devil
- Posts: 708
- Joined: 17 Nov 2017, 23:32
- Noob?: No
- Location: Genting Highland, Malaysia
- Contact:
Re: Stuck autosell/autobuy
iRO Supporter.
Read before you ask is the wisest thing human can do.
Unless you're a cat.
Re: Stuck autosell/autobuy
This is the same case we were talking in the github fadreus! (fvegini)
How would you do an eventMacro to "always sell before buy"?
In the old macros.txt i used to have one "console /calculating route to auto buy/ call {do autosell}"
But I don't know how to make one without the console
How would you do an eventMacro to "always sell before buy"?
In the old macros.txt i used to have one "console /calculating route to auto buy/ call {do autosell}"
But I don't know how to make one without the console
- fadreus
- The Kore Devil
- Posts: 708
- Joined: 17 Nov 2017, 23:32
- Noob?: No
- Location: Genting Highland, Malaysia
- Contact:
Re: Stuck autosell/autobuy
Why you wanna use eventMacro when you can use normal macro?
If you really masochist type ( ) going da trouble with eventMacro, you can use something like this
If you really masochist type ( ) going da trouble with eventMacro, you can use something like this
Code: Select all
automacro OhShetRedPotGone {
InMap pay_in01
exclusive 1
run-once 1
call CrapBetterBuyPot
}
macro CrapBetterBuyPot {
if (&invamount (Red Potion) <= 0) goto ShetBotDumbCantCalculateWeight
stop
:ShetBotDumbCantCalculateWeight
do autosell; release GotMaPotNowMaNigga
stop
}
automacro GotMaPotNowMaNigga {
inMap payon
run-once 1
exclusive 1
call YeyMaNiggaPotIsHere
}
macro YeyMaNiggaPotIsHere {
if (&invamount (Red Potion) <= 0) goto ShetAintBuyNoPot
if (&invamount (Red Potion) >= 300) goto ThisPotAintGoingNoWhereNow
:ShetAintBuyNoPot
call CrapBetterBuyPot
:ThisPotAintGoingNoWhereNow
release OhShetRedPotGone
log I Got Ma Nigga Pot Now!
}
iRO Supporter.
Read before you ask is the wisest thing human can do.
Unless you're a cat.
Re: Stuck autosell/autobuy
fadreus wrote:Why you wanna use eventMacro when you can use normal macro?
If you really masochist type ( ) going da trouble with eventMacro, you can use something like this
Code: Select all
automacro OhShetRedPotGone { InMap pay_in01 exclusive 1 run-once 1 call CrapBetterBuyPot } macro CrapBetterBuyPot { if (&invamount (Red Potion) <= 0) goto ShetBotDumbCantCalculateWeight stop :ShetBotDumbCantCalculateWeight do autosell; release GotMaPotNowMaNigga stop } automacro GotMaPotNowMaNigga { inMap payon run-once 1 exclusive 1 call YeyMaNiggaPotIsHere } macro YeyMaNiggaPotIsHere { if (&invamount (Red Potion) <= 0) goto ShetAintBuyNoPot if (&invamount (Red Potion) >= 300) goto ThisPotAintGoingNoWhereNow :ShetAintBuyNoPot call CrapBetterBuyPot :ThisPotAintGoingNoWhereNow release OhShetRedPotGone log I Got Ma Nigga Pot Now! }
The use macro.txt "console" function makes the kore a bit slower! (at least is what everyone says)
Your idea would work if the only item the kore will buy is red potion!
But in the scenario where it buys red potion and fly wing... if the fly wing is over but openkore still have some red potion in inventory it will never proc.
When i got home I will test this... but it should work
src\Network\Receive\ServerType0.pm
Lines 1350
Code: Select all
} elsif ($args->{fail} == 1) {
error T("Buy failed (insufficient zeny).\n");
} elsif ($args->{fail} == 2) {
error T("Buy failed (insufficient weight capacity).\n");
Code: Select all
} elsif ($args->{fail} == 1) {
error T("Buy failed (insufficient zeny).\n");
use Plugins;
Plugins::callHook("Buy_failed");
} elsif ($args->{fail} == 2) {
error T("Buy failed (insufficient weight capacity).\n");
use Plugins;
Plugins::callHook("Buy_failed");
And in eventMacros.txt
Code: Select all
automacro autoSellWhenBuyCrash {
SimpleHookEvent Buy_failed
run-once 1
call {
do autosell
pause 2
release autoSellWhenBuyCrash
}
}
- fadreus
- The Kore Devil
- Posts: 708
- Joined: 17 Nov 2017, 23:32
- Noob?: No
- Location: Genting Highland, Malaysia
- Contact:
Re: Stuck autosell/autobuy
Slower? How many milliseconds? I see no different.Yaham wrote:The use macro.txt "console" function makes the kore a bit slower! (at least is what everyone says)
Nope. When running command autosell, autobuy and autostorage will follow up.Yaham wrote:Your idea would work if the only item the kore will buy is red potion!
When doing autobuy, everything set to buy will be restocked to maxAmount.
The only trigger I've made is when inMap pay_in01.it will never proc
And other is inMap payon.
It will proc.
If you read the previous post, I've deleted it 'coz I was high on sugar xD Hahahaha..
Last edited by fadreus on 22 Dec 2017, 08:58, edited 1 time in total.
iRO Supporter.
Read before you ask is the wisest thing human can do.
Unless you're a cat.
Re: Stuck autosell/autobuy
fadreus wrote:Slower? How many milliseconds?Yaham wrote:The use macro.txt "console" function makes the kore a bit slower! (at least is what everyone says)
Nope. When you put command autosell, autobuy and autostorage will follow up.Yaham wrote:Your idea would work if the only item the kore will buy is red potion!
But in the scenario where it buys red potion and fly wing... if the fly wing is over but openkore still have some red potion in inventory it will never proc.
When doing autobuy, everything you set to buy will be restocked to maxAmount.
It will proc.
I read a thread about why they didn't implement "console" option in eventMacro a few months ago.. don't remember exactly the arguments, but was something with "console" needs to check every single char that openkore sends... demanding an huge amount o CPU to only this function!
But it seems to me the autosell won't be triggered unless the Red Potion got to 0
If fly wing is 0 and red potion is 50
Autobuy is triggered... he tries to buy the "buy_auto" list
Try to buy the red potion to complete the 300.... stuck by weight!
automacro OhShetRedPotGone trigger
Red potion isn't <= 0 so don't go to :ShetBotDumbCantCalculateWeight
- fadreus
- The Kore Devil
- Posts: 708
- Joined: 17 Nov 2017, 23:32
- Noob?: No
- Location: Genting Highland, Malaysia
- Contact:
Re: Stuck autosell/autobuy
Hmm.. Really? I always use console condition & my sleepTime is 250000.Yaham wrote:I read a thread about why they didn't implement "console" option in eventMacro a few months ago.. don't remember exactly the arguments, but was something with "console" needs to check every single char that openkore sends... demanding an huge amount o CPU to only this function!
My CPU only 1.3 Ghz. No problemo.
Simple; changeYaham wrote:But it seems to me the autosell won't be triggered unless the Red Potion got to 0
If fly wing is 0 and red potion is 50
Autobuy is triggered... he tries to buy the "buy_auto" list
Try to buy the red potion to complete the 300.... stuck by weight!
automacro OhShetRedPotGone trigger
Red potion isn't <= 0 so don't go to :ShetBotDumbCantCalculateWeight
Code: Select all
if (&invamount (Red Potion) <= 0) goto ShetBotDumbCantCalculateWeight
Code: Select all
if (&invamount (Red Potion) <= 300) goto ShetBotDumbCantCalculateWeight
Edit as you see fit.
Don't have to follow letter by letter (which is why I use nigga there )
Hahahahahaha...
iRO Supporter.
Read before you ask is the wisest thing human can do.
Unless you're a cat.
- fadreus
- The Kore Devil
- Posts: 708
- Joined: 17 Nov 2017, 23:32
- Noob?: No
- Location: Genting Highland, Malaysia
- Contact:
Re: Stuck autosell/autobuy
Well, indeed eventMacro is more efficient but what's the point if I can't use as I wanted (by using hooks).
As for now, I using both macro and eventMacro; calling out each other and clearing/disabling one another.
EventMacro is still new and I haven't use it much.
To lazy writing all the stuff just for performance increase while using macro have nothing much different.
As for now, I using both macro and eventMacro; calling out each other and clearing/disabling one another.
EventMacro is still new and I haven't use it much.
To lazy writing all the stuff just for performance increase while using macro have nothing much different.
iRO Supporter.
Read before you ask is the wisest thing human can do.
Unless you're a cat.
Re: Stuck autosell/autobuy
I never had problems too... but just to be safe i'm slowing converting everything to eventMacros
I know you're just giving an suggestion!
I'm just showing some "errors" that may occur if he basically just copy paste the new code!
I never used hooks with the macros.txt, console aways supplyed everythin i always needed.
But now with eventMacro i'm using some simple hooks, like the one i posted earlyer.
Convert from macros to eventMacros really takes time... but in the end is kind of satisfying see that everything is running according to the plan! haha
I know you're just giving an suggestion!
I'm just showing some "errors" that may occur if he basically just copy paste the new code!
I never used hooks with the macros.txt, console aways supplyed everythin i always needed.
But now with eventMacro i'm using some simple hooks, like the one i posted earlyer.
Convert from macros to eventMacros really takes time... but in the end is kind of satisfying see that everything is running according to the plan! haha