Optimisation autoBuy

Wrote new code? Fixed a bug? Want to discuss technical stuff? Feel free to post it here.

Moderator: Moderators

Click
Human
Human
Posts: 39
Joined: 15 Apr 2008, 06:08
Noob?: Yes
Location: Russia, Velikiy Novgorod

Optimisation autoBuy

#1 Post by Click »

original https://ro-fan.ru/viewtopic.php?t=4956 [rus]

idea:
1. Bulk buyAuto
2. add message 'list needed items' for auto-buy [svn6342]
3. add "price" [svn6582] (need for "Bulk buyAuto" and fix bug loop "Buy failed (insufficient zeny)")
4. add to config "autoBuyAfterSell 1" (compulsory sale before purchase)
5. add to config "autoBuy 1"
autoBuy 0 - disable buyAuto (nice for macro)
autoBuy 1 - standart buyAuto
autoBuy 2 - Bulk buyAuto

bugs:
1. "standpoint" does not work [fix svn6546]
question:
1. "zeny" need? [remove svn6582], [return svn6583]
Last edited by Click on 22 Oct 2008, 01:00, edited 9 times in total.
Click
Human
Human
Posts: 39
Joined: 15 Apr 2008, 06:08
Noob?: Yes
Location: Russia, Velikiy Novgorod

Re: Optimisation autoBuy

#2 Post by Click »

svn6582

zeny=2004

inventory:
Bouquet x 3
Flower x 1
buyAuto Bouquet {
npc prontera 58 182
standpoint
distance 5
price 2000
minAmount 2
maxAmount 5
}

buyAuto Flower {
npc prontera 58 182
standpoint
distance 5
price 2
minAmount 2
maxAmount 5
}

Code: Select all

Auto-buy: Flower
Calculating auto-buy route to: Prontera City, Capital of Rune Midgard (prontera): 58, 182
...
...
Flower Girl: Type 'store' to start buying, or type 'sell' to start selling
----------Flower Girl's Store List-----------
#  Name                    Type               Price
0  Flower                  Non-usable            2z
1  Bouquet                 Non-usable         2000z
-------------------------------
Done talking with Flower Girl.
You lost 2,000 zeny.
Item added to inventory: Bouquet (17) x 1 - Non-usable
Buy completed.
Flower Girl: Type 'store' to start buying, or type 'sell' to start selling
----------Flower Girl's Store List-----------
#  Name                    Type               Price
0  Flower                  Non-usable            2z
1  Bouquet                 Non-usable         2000z
-------------------------------
Done talking with Flower Girl.
You lost 4 zeny.
Item added to inventory: Flower (18) x 2 - Non-usable
Buy completed.
zeny=0
inventory:
Bouquet x 4
Flower x 3
:mrgreen: