ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Bug Reports (https://www.esoui.com/forums/forumdisplay.php?f=187)
-   -   [notabug] GetItemTotalCount returns 0 for BAG_VIRTUAL (https://www.esoui.com/forums/showthread.php?t=7617)

manavortex 02/10/18 10:37 AM

[notabug] GetItemTotalCount returns 0 for BAG_VIRTUAL
 
Lua Code:
  1. local itemCount
  2.  
  3. _, _, itemCount = GetItemTotalCount(BAG_VIRTUAL, slotIndex)
  4. -- itemCount is now 0
  5.  
  6. _, itemCount = GetItemInfo(BAG_VIRTUAL, slotIndex)
  7. -- itemCount is now valid

Ayantir 02/11/18 06:51 AM

So this function returns 2 values ? Maybe more ? It's more than someone forget to update a doc.

Rhyono 02/11/18 12:13 PM

So I tried this on the first item in my craftbag, rough oak. I did

Code:

AA,AB,AC = GetItemTotalCount(BAG_VIRTUAL,521)
AA is 0
AB and AC are nil

I couldn't find any instance of a second return, but it's not like the first return is correct for craftbag anyway...

Baertram 02/11/18 01:59 PM

Quote:

Originally Posted by Rhyono (Post 33895)
So I tried this on the first item in my craftbag, rough oak. I did

Code:

AA,AB,AC = GetItemTotalCount(BAG_VIRTUAL,521)
AA is 0
AB and AC are nil

I couldn't find any instance of a second return, but it's not like the first return is correct for craftbag anyway...

Same for me with my first entry in the craftbag.
0, nil, nil

Tested with another item, same results.
I can't get the function to return a valid count for me.

Tested on PTS only so far.

Rhyono 02/11/18 06:21 PM

It works fine in my inventory, but I don't know what its issue is with that.

votan 02/12/18 02:57 AM

Quote:

Originally Posted by Rhyono (Post 33895)
I couldn't find any instance of a second return, but it's not like the first return is correct for craftbag anyway...

The craft bag uses itemId as slotIndex. I guess 521 is not an item you have in there.

Rhyono 02/12/18 05:45 PM

I've semi-figured it out:

If you use it on an item in your inventory, it returns the number in your bank (if it's not in bank, returns inventory?).
You use it in the craft bag, it returns the number in your inventory.
You use it in the bank, it returns the number in your inventory.

ZOS_ChipHilseberg 02/13/18 10:50 AM

The code for this function is only targeting BAG_BACKPACK. It could rightly be called GetItemBackpackCount.


All times are GMT -6. The time now is 12:39 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI