Thread Tools Display Modes
04/30/21, 02:02 AM   #1
TeilzeitLegende
AddOn Author - Click to view addons
Join Date: Apr 2021
Posts: 2
First AddOn - Auto restock style materials

Hello Everyone,

I am fairly new to writing AddOns and wanted to start with something that I thought is an easy first task.
The idea is to create an AddOn which automatically restocks style materials once I visit a vendor/ merchant and if I am below a given threshold.
At the moment I am at the point where the addon reacts to the on_open_store event and checks for the stack size of each style material that is used for daily writs.
Until now I was not able to find a function to buy from the merchant.
From searching the web I found the functions
zo_storemanager:buymultiplepurchase() and zo_storemanager:getstoreitems() which seem to be promising but unfortunately I was not able to find any description on the usage of these functions, especially how to the the function which Item tom by (using the ItemLink?).
Is anyone able to help? Any other functions that might do the trick?

Thanks in advance!
  Reply With Quote
04/30/21, 03:29 AM   #2
Irniben
 
Irniben's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2021
Posts: 6
Hello TeilzeitLegende, welcome :-)

I have not tested them, but listed in the API there are the following functions:

BuyStoreItem(number entryIndex, number quantity)
GetNumStoreItems()
GetStoreItemLink(number entryIndex, number LinkStyle linkStyle)

So you should be able to iterate over all the items in a store and buy the ones you need.

https://wiki.esoui.com/API
https://wiki.esoui.com/APIVersion
  Reply With Quote
04/30/21, 04:07 AM   #3
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
Randactyl had once created such type of addon already, maybe it helps if you watch his code:
https://www.esoui.com/downloads/info705-StockUp.html
  Reply With Quote
05/01/21, 07:16 AM   #4
TeilzeitLegende
AddOn Author - Click to view addons
Join Date: Apr 2021
Posts: 2
thanks to both of you.
For the mentioned API functions as well as for the example addon.
  Reply With Quote
05/04/21, 08:28 AM   #5
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
I've found another addon doing the same:
https://www.esoui.com/downloads/info...ndorMagic.html
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » First AddOn - Auto restock style materials

Thread Tools
Display Modes

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