ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   Getting information about item (inside bag, or at bank) (https://www.esoui.com/forums/showthread.php?t=644)

Baertram 04/06/14 03:39 PM

Getting information about item (inside bag, or at bank)
 
Hi there,

i'm totally new to LUA but I think I understood how it works so far.
I tried some smaller code lines and read other bigger addons to understand, how LUA works with ESO.

Currently I try to find out, how I can see, if an item is inside my inventory or only at my bank.
I'll see this already, if I open the research tab at a craft station e.g. But it will only sho inside the tooltip of the item (at the top right edge of the tooltip).
I#d like to check this for every icon shown in the research item's list.

Is there any function in the API which returns this information for me, without having to mouseover an item and check the tooltip? I did not find any so far.
I only saw there is a global variable BAG which will indicate me BAG_BANK e.g. as a value. But I'm not sure if I can use this variable somehow and if this is the information I'm searching for.

I appreciate every help I can get.

Thank you.

Xrystal 04/06/14 05:23 PM

Unfortunately there isn't a way that I can see of getting to that information barring searching through all bags and slots.

There are several functions that have a bagID, slotID set of parameters.

bagID 0 is your equipped armor with the slotID being the individual equipped items.

bagID 1 is your inventory with slotID being the individual stack of items.

I assume bagID's 2 and higher will be for the various other inventory related storage such as bank or store etc.

EG.
bagCount = GetMaxBags()
bagIcon,bagSlots = GetBagInfo(bagId)
itemName = GetItemName(bagID, slotID)

So it looks like all you can do is cycle through and check that way.

I found a similar important value that isn't available that would help matters and that is the itemID is embedded into the itemLink but isn't extractable without going through the gmatch search patterns to extract it. There is an instanceID but think this is different to itemID based on what I have seen so far.

Xrystal 04/06/14 08:50 PM

Just been playing around with bag/slot info and it seems that bagID 2 may be the bank but it also seems to be the bagID for the Alchemy Stations solvent and reagent slots.

However, I suspect that bank info will not be accurate if you don't have it open as I have transferred stuff back and forth between bank and inventory and only inventory found a specific item correctly. The bank found 1 of the items but somehow not the other.

Seerah 04/06/14 09:05 PM

*ahem*
http://wiki.esoui.com/Globals#Bag

Wukar 04/07/14 02:54 AM

lua Code:
  1. itemName = GetItemName(bagID, slotID)

itemName isn't exactly the expected result. It contains the singular and plural item name
Code:

{singularName}^x|{pluralName}^y
The x and y are one or more letters long. Maybe encoded category - i'm not sure yet.

Seerah 04/07/14 11:00 AM

I'll throw out one more hint. :)

Mouse over something in your inventory, then type
/zgoo moc()

Baertram 04/07/14 11:06 AM

Hey, thanks for all the hints. I came home this moment and will try it later when the EU servers are back online.

As I wrote before Seerah this global variable BAG got to my attention too.
I thought it might solve the problem :-) but actually, as I'm new to LUA, I do not know how to use it.

I'll try the /zgoo mouseover and see if this helps me learning :-)

Xrystal 04/07/14 11:09 AM

On further inspection what I thought were alchemy table slot references were in fact references to which bag/slot the item came from rather than where it is put. The enchant table doesn't seem to have a similar function though to grab the bag and slotIDs of the runes being combined and the enchant item being deconstructed.

But yes I have seen both ^p after items looted from a body or node or ^n from a crafting station. Perhaps a symbol to denote the source. Maybe one day we will get access to that sort of information :D

Xrystal 04/07/14 11:14 AM

Quote:

Originally Posted by Seerah (Post 3042)

oh my, see it there when I wasn't looking for it and ignore it when I am .. rofl

I assume buyback and the banks need to be open to read their contents properly.

But will play with these values and see if they work as I suspect they will.

Anixai 04/07/14 11:43 AM

I am pretty new to add-on development, so apologies if my proposal is pretty stupid.

You could created some sort of saved table where you keep the items in your bank and bags of your characters. Whenever you update your bank list or a bag, you update this saved list. On opening bank, you refresh the contents of the bank table (to make sure it does not get out of sync. Same for when you log on / log off your character, but then to sync your character bag.

Advantages: you can check if you have the item a) in the bank, 2) on another character and which one.

Just my 2 cents...

Anixai aka Jeroen

Baertram 04/07/14 11:54 AM

I thought about this way too to see what my other chars will have in their bags.
But currently this is too much for my needs ;-)

I just want to check if an item is in the bank, when I open the craft station and want to analyse or destroy an item. Then it should show a bank icon next to the name, instead of only showing it in the tooltip.

Baertram 04/07/14 06:31 PM

Ok, I used the tgoo moc() function to see what the tooltip gives for variables etc.

["dataEntry"] = table: 385E96F8 [#0,4]
["data"] = table: 385E96D0 [#0,10]
["bagId"] = 2

It seems, that the bagID in the DataEntry -> data table/array? is the thing i was looking for.
bagId = 1: Backpack
bagId = 2: Bank

But I'm not sure what this moc() function started with at the top and how I'm able to acces the dataEntry -> data -> bagId variable for each item now.

Do you have any further hints for me?

Seerah 04/07/14 11:16 PM

moc stands for "mouse over control"


All times are GMT -6. The time now is 11:36 AM.

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