Page 1 of 1

Feedback on store class idea

Posted: Thu Jan 20, 2011 4:33 am
by rock5
Hi,

I'm about to commit an update to rombot with a lot of changes. 1 of the things I ended up doing was create a 'store' class. The way it works is, whenever buying stuff, it loads the store data once only for that npc. From then on player merchant should run supper fast. It only changes the data when you visit a different store.

I need peoples opinion as to which functions should be moved to the store class. buyItem() was a no brainer. buyconsumables() wasn't so obvious because it also uses the inventory but seeing as it's about 'buying' I moved that too. The main 1 I'm not sure about is autosell(). It also uses the inventory but doesn't use the data stored in 'store'. Seeing as the 'store' class is mainly about the items for sale I'm not sure if a selling function should be moved to it. But then again selling is still a store function I guess.

What are people opinions?

Re: Feedback on store class idea

Posted: Thu Jan 20, 2011 7:18 am
by Personalausweis
hi Rock5,

one thing that is disturbing me is the fact that consumables are always bought one by one.
perhaps it is possible to check how many potions are in bag and then buy the rest to maximun in one stack.

sth like this:

Code: Select all

inBag = getBagItemCount(ID)
toBuy = (Maximum to buy from profile?! - inBag)
sendmacro("StoreBuyItem(position,toBuy)")
:)

Re: Feedback on store class idea

Posted: Thu Jan 20, 2011 8:05 am
by rock5
Personalausweis wrote:one thing that is disturbing me is the fact that consumables are always bought one by one.
Yeah, me too. That's why I fixed it in rev 559.

Re: Feedback on store class idea

Posted: Thu Jan 20, 2011 10:57 am
by jduartedj
I love the idea. Idk if it exists but a buy-item-by-name option would be swell!

Re: Feedback on store class idea

Posted: Thu Jan 20, 2011 11:50 am
by rock5
jduartedj wrote:I love the idea. Idk if it exists but a buy-item-by-name option would be swell!
That would be

Code: Select all

store:buyItem(nameIdOrIndex, quantity)
By the way I've committed now. Guess I couldn't wait. Check out the changelog here
http://www.solarstrike.net/phpBB3/viewt ... =21&t=2101