Thread Tools Display Modes
04/06/14, 03:39 PM   #1
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,979
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.
  Reply With Quote
04/06/14, 05:23 PM   #2
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
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.
  Reply With Quote
04/06/14, 08:50 PM   #3
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
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.
  Reply With Quote
04/06/14, 09:05 PM   #4
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
*ahem*
http://wiki.esoui.com/Globals#Bag
  Reply With Quote
04/07/14, 02:54 AM   #5
Wukar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 27
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.
  Reply With Quote
04/07/14, 11:00 AM   #6
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
I'll throw out one more hint.

Mouse over something in your inventory, then type
/zgoo moc()
  Reply With Quote
04/07/14, 11:06 AM   #7
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,979
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 :-)
  Reply With Quote
04/07/14, 11:09 AM   #8
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
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
  Reply With Quote
04/07/14, 11:14 AM   #9
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
Originally Posted by Seerah View Post
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.
  Reply With Quote
04/07/14, 11:43 AM   #10
Anixai
Join Date: Apr 2014
Posts: 2
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
  Reply With Quote
04/07/14, 11:54 AM   #11
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,979
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.
  Reply With Quote
04/07/14, 06:31 PM   #12
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,979
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?
  Reply With Quote
04/07/14, 11:16 PM   #13
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
moc stands for "mouse over control"
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Getting information about item (inside bag, or at bank)


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off