Maintenance for the week of March 25:
• [COMPLETE] ESO Store and Account System for maintenance – March 28, 9:00AM EDT (13:00 UTC) - 12:00PM EDT (16:00 UTC)

Exporting Guild Bank Data - asking for advice

 Raiborn
Raiborn
✭✭
My main guild has our own add on for pulling character data and posting it to our website's roster, but I wanted to inquire about doing the same for our guild's bank.

It seems that the guild bank 'item stacker' add ons execute a function that is able to pull that data. Could someone enlighten me with how to recreate that function so that the list of items in the guild is exported to a data file that could then be utilized on the website?

It seems like it should be simple enough...

Thanks,
-Raiborn
Edited by Raiborn on September 12, 2014 7:55PM
Raiborn, Imperial Templar
Officer of Strayhold
  • katkat42
    katkat42
    ✭✭✭
    The guild bank is treated the same as character inventory and player bank. You should be able to get the info you need using these functions. The bag ID for the guild bank is 3, though there's also a global constant called BAG_GUILDBANK which is set to 3 and makes your code more readable if you use it instead. :smile:
    Stonehenge ROCKS!
  •  Raiborn
    Raiborn
    ✭✭
    katkat42 wrote: »
    The guild bank is treated the same as character inventory and player bank. You should be able to get the info you need using these functions. The bag ID for the guild bank is 3, though there's also a global constant called BAG_GUILDBANK which is set to 3 and makes your code more readable if you use it instead. :smile:

    Thank you kindly for the response.
    So to utilize the GetItemName(integer bagId, integer slotIndex) function for instance, I would want to use an iterator to go through the 'slotIndex' up to 500 with the bagId set to 3 or the global constant for guild bank and save those to an array? How do you specify which guild it pulls from? Can it only be pulled when the guild bank is open, or can it be pulled at any time from another trigger?
    Edited by Raiborn on September 13, 2014 1:50AM
    Raiborn, Imperial Templar
    Officer of Strayhold
  • katkat42
    katkat42
    ✭✭✭
    Yeah, basically. Be aware that not all slots will be occupied, and the occupied slots are not contiguous, so check for empty strings before you record the info. Don't forget to GetSlotStackSize(bagid, slotindex).

    Although, I suggest using GetItemLink(bagid, slotindex). Then you can use the link to get the item's name with GetItemLinkName(link), its level with GetItemLinkRequiredLevel(link) or GetItemLinkRequiredVeteranLevel(link), its color with GetItemLinkQuality(link), and its price, equiptype, and itemstyle from GetItemLinkInfo(link).

    There's a complete list of functions and constants available to us as an attachment to this post. The API for update 4, due next week by all accounts, is attached to this post. These files are a bit of a slog, though; your text editor's Search function is your friend.

    In it, I found this function:
    * GetSelectedGuildBankId()
    ** _Returns:_ *integer:nilable* _guildId_
    and this one:
    * SelectGuildBank(*integer* _guildId_)

    I'm pretty sure the data can be pulled at any time. There are even events called EVENT_GUILD_BANK_ITEM_ADDED and EVENT_GUILD_BANK_ITEM_REMOVED, but I'm not sure whether they fire when your guild bank interface isn't open. (Haven't tested it).

    As a side note, if you're really interested in addon dev, I cannot strongly enough recommend the Zgoo addon. It displays every item in the public namespace, lists all events your client receives, and gives you info on whatever UI element you're moused over.
    Stonehenge ROCKS!
  •  Raiborn
    Raiborn
    ✭✭
    Sweet! Thanks for the advice and giving some great places to start.
    The next step is on me.

    Oh boy... API update :s
    Raiborn, Imperial Templar
    Officer of Strayhold
Sign In or Register to comment.