Jump to content

Multiple Buy + AutoStack


Recommended Posts

If you don't have AddPointToNumberString in localeInfo (check if you have the function but with another name):

def AddPointToNumberString(n):
	return "%s" % ('.'.join([ i-3<0 and str(n)[:i] or str(n)[i-3:i] for i in range(len(str(n))%3, len(str(n))+1, 3) if i ])) 

Also, I would remove:

				dlgPickItem = uiPickItem.PickItemDialog()
				dlgPickItem.LoadDialog()
				self.dlgPickItem = dlgPickItem

to put it in UnselectItemSlot or w/e is your function where you select the item to buy:
 

			if app.IsPressed(app.DIK_LCONTROL):
				itemIndex = shop.GetItemID(selectedSlotPos)
				item.SelectItem(itemIndex)
				itemName = item.GetItemName()
				dlgPickItem = uiPickItem.PickItemDialog()
				dlgPickItem.LoadDialog()
				self.dlgPickItem = dlgPickItem
				self.dlgPickItem.SetTitleName(itemName)
				self.dlgPickItem.SetAcceptEvent(ui.__mem_func__(self.OnPickItem))
				self.dlgPickItem.Open(1)
				self.dlgPickItem.SetMax(2000)
				self.dlgPickItem.itemGlobalSlotIndex = selectedSlotPos
			else:
				net.SendShopBuyPacket(self.__GetRealIndex(selectedSlotPos))

and I would add in Close and Destroy:
 

		if self.dlgPickItem:
			self.dlgPickItem.Destroy()
			self.dlgPickItem = None	

Another thing, what is this?

6tlqyY3.png

 

Aren't we passing, like this, moneyValue with self.dlgPickItem.SetAcceptEvent(ui.__mem_func__(self.OnPickItem))?

 

At least, that's what happened with me, therefore I just:

		if not text.isdigit():
			text = 1
		if text:
			if self.eventAccept:
				self.eventAccept(text)

 

Or am I missing something and I am too tired to notice?

Also, be wary of putting more than one stack in the shops..

 

Edited by xXIntelXx (see edit history)
Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.