Download
(63 Kb)
Download
Updated: 04/10/18 05:05 PM
Pictures
File Info
Compatibility:
Dragon Bones (3.3)
Updated:04/10/18 05:05 PM
Created:08/19/14 02:05 AM
Monthly downloads:29
Total downloads:6,421
Favorites:9
MD5:
Stock Up  Popular! (More than 5000 hits)
Version: 2.1.0.0
by: Randactyl [More]
Always keep your inventory stocked with your most used items!

Whether it's siege weapons, repair kits, potions, soul gems, or whatever, Stock Up can automatically buy whatever you need when you open a store.

Stocking an item works much the same way as splitting a stack of items. Right click an item and choose "Stock Item" from the context menu. Then, a dialog will pop up where you can enter the amount you want to always have on hand.

In the settings menu, you can check an option to prefer buying items with your alliance points (when available) and see which items you are currently stocking.

---

This is my take on the request from this thread. If this addon proves too hefty for your needs, check out CyroSiege by Ayantir

---

If you like my work and feel the urge to contribute, I'm always willing to accept in-game gold sent to @Randactyl

If you REALLY like my work and want to help me out with ESO Plus, I won't say no to Paypal donations
2.1.0.0 - Scootworks, Randactyl
- general code refresh
- updated LibAddonMenu to version 2.0r25
- updated LibCustomMenu to version 5
- changed message printing so they show up on all tabs
- updated German strings
- changed string registration to use ZOS functions
- changed default "Prefer AP" setting to on (won't change existing saved preference)
- updated minimum API version to 100022 (ESO 3.3.x, Dragon Bones)

2.0.1.0
- fixed stocking bug due to function name typo
- updated minimum API version to 100019 (ESO 3.x, Morrowind)

2.0.0.0
- added support for stocking items that cost writ vouchers
- added LibCustomMenu version 4.2
- added LibSlashCommander version 4
- general code/whitespace/comment cleanup
- fixed issue caused by some items having no currency type
- refactored into "namespace" style
- updated LibAddonMenu to version 2.0r23
- updated minimum API version to 100018 (ESO 2.7.x, Homestead)

1.4.0.0
- added support for character name changes
- added craft bag support
- included craft bag count in the stock calculation
- added how much of which currency was used to the purchase messages
- updated API version

1.3.0.1
- update LibAddonMenu to version 2.0r20

1.3.0.0
- update LibAddonMenu to version 2.0r19
- remove UI reload when refreshing stock in settings
- updated API version

1.2.1.0 - merlight
- cleaned up stocking logic
- updated API version

1.2.0.0
- updated LibStub to 1.0r4
- updated LibAddonMenu to 2.0r18
- updated English strings
- fixed items not being bought with gold
- expanded to allow stocking of items that cost Tel Var stones
- updated API version

1.1.0.1
- fix typo in strings file

1.1.0.0
- NOTE: The manifest is updated for 1.6 and will show as out of date in 1.5, however it still works in 1.5!
- update LAM to r17
- added a debug mode to prevent buying of items and give details in chat - use /stockupdebug to toggle
- now scans the items in the store so buying items you are completely out of will work
- added stock/destock context menu items to store items
- added "support" for Russian and Spanish (they're just empty and default to English)

1.0.1.0
- update API version
- removed string format artifacts from item names
- improved reliability for buying items

1.0.0b
- Update API version to 100009

1.0.0
- initial release.
This addon was based on Item Saver and retains Item Saver's method of "marking" an item as well as Item Saver's saved variables structure.
Archived Files (12)
File Name
Version
Size
Uploader
Date
2.0.1.0
60kB
Randactyl
05/22/17 12:48 AM
2.0.0.0
60kB
Randactyl
02/06/17 05:47 AM
1.4.0.0
45kB
Randactyl
08/11/16 10:27 PM
1.3.0.1
45kB
Randactyl
03/30/16 10:52 AM
1.3.0.0
40kB
Randactyl
03/07/16 06:31 AM
1.2.1.0
40kB
Randactyl
11/02/15 03:50 PM
1.2.0.0
40kB
Randactyl
08/31/15 02:24 AM
1.1.0.1
33kB
Randactyl
02/23/15 10:55 AM
1.1.0.0
33kB
Randactyl
02/23/15 02:28 AM
1.0.1.0
30kB
Randactyl
11/03/14 10:26 AM
1.0.0b
29kB
Randactyl
09/20/14 11:47 AM
1.0
29kB
Randactyl
08/19/14 02:05 AM


Post A Reply Comment Options
Unread 04/12/18, 03:08 AM  
Alassirana

Forum posts: 0
File comments: 29
Uploads: 0
bug in new version

This is a doozy that I've noticed, and it seems to only happen when I have stockup activated (which I use when doing crafting writs to restock my style stones). For whatever reason, since the update, I've had the game fail to open loot boxes (like our pretty new gifts) while the mod is active. Has anyone else had this problem? I attempt to right click and then click on use, and the game refuses to acknowledge a click on the use command there. This means I can't use this addon until it's either updated or the event is over.

@alassirana
Report comment to moderator  
Reply With Quote
Unread 04/10/18, 09:07 PM  
Randactyl
 
Randactyl's Avatar
AddOn Author - Click to view AddOns

Forum posts: 251
File comments: 462
Uploads: 17
Originally Posted by lukkian
Well, thank you.

I already know and use Bank Manager Revived.

The problem is that I have not found in it a way to, for example, always remove the excess of soul gens and at the same time always leave a certain amount for personal use.

The use case is:

I go to the bank with more than 200 soul gens;
I need to deposit the excess of this item in the bank;
I need to leave in my inventory a certain amount, let's say 100 soul gens.

Do it with half a dozen more items...

Happiness.
Hmm I know I had that functionality from somewhere. I thought it was that one, but it might have been PersonalAssistant. PA hasn't been updated since Morrowind, but it might still work.
Report comment to moderator  
Reply With Quote
Unread 04/10/18, 06:42 PM  
lukkian
 
lukkian's Avatar

Forum posts: 3
File comments: 37
Uploads: 0
Well, thank you.

I already know and use Bank Manager Revived.

The problem is that I have not found in it a way to, for example, always remove the excess of soul gens and at the same time always leave a certain amount for personal use.

The use case is:

I go to the bank with more than 200 soul gens;
I need to deposit the excess of this item in the bank;
I need to leave in my inventory a certain amount, let's say 100 soul gens.

Do it with half a dozen more items...

Happiness.
Last edited by lukkian : 04/10/18 at 06:46 PM.
Report comment to moderator  
Reply With Quote
Unread 04/10/18, 06:03 PM  
Randactyl
 
Randactyl's Avatar
AddOn Author - Click to view AddOns

Forum posts: 251
File comments: 462
Uploads: 17
Originally Posted by lukkian
I almost had a glimpse of happiness...
I accidentally found this addon and for a moment I thought my frustrations would be over.

The thing is, I always have to restock some items, not from a merchant but from my bank.
For example soul gens and lockpicks are items that the game already gives us quite abundantly and I deposit the excesses in the bank, but from time to time I need to come back and restock and do this manually is boring, time-consuming and error prone.

In short, would it be possible for this addon to do the same as it does today, but instead of buying from a merchant withdraw the bank?

I hope I explained it well. Thank you.
http://www.esoui.com/downloads/info7...erRevived.html
Report comment to moderator  
Reply With Quote
Unread 04/10/18, 05:42 PM  
lukkian
 
lukkian's Avatar

Forum posts: 3
File comments: 37
Uploads: 0
I almost had a glimpse of happiness...
I accidentally found this addon and for a moment I thought my frustrations would be over.

The thing is, I always have to restock some items, not from a merchant but from my bank.
For example soul gens and lockpicks are items that the game already gives us quite abundantly and I deposit the excesses in the bank, but from time to time I need to come back and restock and do this manually is boring, time-consuming and error prone.

In short, would it be possible for this addon to do the same as it does today, but instead of buying from a merchant withdraw the bank?

I hope I explained it well. Thank you.
Report comment to moderator  
Reply With Quote
Unread 08/01/16, 01:25 PM  
Randactyl
 
Randactyl's Avatar
AddOn Author - Click to view AddOns

Forum posts: 251
File comments: 462
Uploads: 17
Stock Up is not ready for name changes! If you change a character's name, you will need to redo their shopping list. I'll update when I have time.
Report comment to moderator  
Reply With Quote
Unread 03/30/16, 06:23 PM  
Jhenox
 
Jhenox's Avatar
AddOn Author - Click to view AddOns

Forum posts: 42
File comments: 392
Uploads: 6
Originally Posted by Jhenox
This addon looks like something I would really like to use for siege weapons, etc. Can it differentiate between buying siege using gold and alliance points? For example, I can buy fire ballistas, repair kits, etc using gold or AP but i'd like to use gold until I buy all of the Akaviri motifs. It would be nice if I could choose which one to buy. Thank you!
I gave it a try and it works great! I noticed the "Prefer Alliance Points" option. I bought the siege using the currency I selected! Thank you!

One request; when it purchases the items could it give some additional information such as how much was spent, etc? Thank you again for this addon.
Report comment to moderator  
Reply With Quote
Unread 03/30/16, 01:29 PM  
Jhenox
 
Jhenox's Avatar
AddOn Author - Click to view AddOns

Forum posts: 42
File comments: 392
Uploads: 6
This addon looks like something I would really like to use for siege weapons, etc. Can it differentiate between buying siege using gold and alliance points? For example, I can buy fire ballistas, repair kits, etc using gold or AP but i'd like to use gold until I buy all of the Akaviri motifs. It would be nice if I could choose which one to buy. Thank you!
Last edited by Jhenox : 03/30/16 at 01:35 PM.
Report comment to moderator  
Reply With Quote
Unread 09/13/15, 10:56 AM  
merlight
AddOn Author - Click to view AddOns

Forum posts: 671
File comments: 213
Uploads: 12
GatherBackpackInfo isn't needed at all if you use GetItemLinkStacks (use link from the store).

GatherStoreInfo could return just the interesting items, the buying loop could then go over those instead of all wanted:

diff Code:
  1. diff -ru /tmp/esoui-unpacked/StockUp/StockUp.lua modified/StockUp/StockUp.lua
  2. --- /tmp/esoui-unpacked/StockUp/StockUp.lua 2015-08-30 12:10:02.000000000 +0200
  3. +++ modified/StockUp/StockUp.lua    2015-09-13 18:44:58.000000000 +0200
  4. @@ -13,34 +13,24 @@
  5.  
  6.     for i = 1, GetNumStoreItems() do
  7.         local _, _, s, p, _, _, _, _, _, t1, q1 = GetStoreEntryInfo(i)
  8. -       local storeItemId = select(4, ZO_LinkHandler_ParseLink(GetStoreItemLink(i)))
  9. +       local storeItemLink = GetStoreItemLink(i)
  10. +       local storeItemId = select(4, ZO_LinkHandler_ParseLink(storeItemLink))
  11.  
  12. +       if stock[storeItemId] and (
  13.         --if an item is found for the first time, enter it
  14. -       if storeTable[storeItemId] == nil then
  15. -           storeTable[storeItemId] = {
  16. -               index = i,
  17. -               stack = s,
  18. -               price = p,
  19. -               curType = t1,
  20. -               curQuantity = q1,
  21. -           }
  22. +           storeTable[storeItemId] == nil or
  23.         --if an item is found again, re-enter it if it costs AP and that is preferred to gold
  24. -       elseif preferAP == true and p == 0 then
  25. -           storeTable[storeItemId] = {
  26. -               index = i,
  27. -               stack = s,
  28. -               price = p,
  29. -               curType = t1,
  30. -               curQuantity = q1,
  31. -           }
  32. +           (preferAP == true and p == 0) or
  33.         --if an item is found again, re-enter it if it costs gold and that is preferred to AP
  34. -       elseif preferAP == false and q1 == 0 then
  35. +           (preferAP == false and q1 == 0)
  36. +       ) then
  37.             storeTable[storeItemId] = {
  38.                 index = i,
  39.                 stack = s,
  40.                 price = p,
  41.                 curType = t1,
  42.                 curQuantity = q1,
  43. +               itemLink = storeItemLink,
  44.             }
  45.         end
  46.     end
  47. @@ -68,19 +58,15 @@
  48.  end
  49.  
  50.  local function StockUp_StoreOpened()
  51. -   local backpackTable = GatherBackpackInfo()
  52.     local storeTable = GatherStoreInfo()
  53.  
  54. -   for itemId, _ in pairs(stock) do
  55. +   for itemId, storeItem in pairs(storeTable) do
  56.         local amountWanted = stock[itemId].amount
  57. -       local amountHave = 0
  58. -       if backpackTable[itemId] then
  59. -           amountHave = backpackTable[itemId].amountHave
  60. -       end
  61. +       local amountHave = GetItemLinkStacks(storeItem.itemLink)
  62.         local amountNeeded = amountWanted - amountHave
  63.         if dbg == true then d("Need " .. amountNeeded .. " " .. stock[itemId].itemName) end
  64.  
  65. -       if amountNeeded > 0 and storeTable[itemId] ~= nil then
  66. +       if amountNeeded > 0 then
  67.             local storeIndex = storeTable[itemId].index
  68.             local quantity = zo_min(amountNeeded, GetStoreEntryMaxBuyable(storeIndex))
  69.             local itemName = stock[itemId].itemName
Report comment to moderator  
Reply With Quote
Unread 09/13/15, 07:57 AM  
CaptainBlagbird
 
CaptainBlagbird's Avatar
AddOn Author - Click to view AddOns

Forum posts: 53
File comments: 177
Uploads: 23
I think this would do it, rewrote the function GatherBackpackInfo():

Lua Code:
  1. local function GatherBackpackInfo()
  2.     local backpackTable = {}
  3.  
  4.     for slotID=0, GetBagSize(BAG_BACKPACK), 1 do
  5.         local itemLink = GetItemLink(BAG_BACKPACK, slotID)
  6.         if itemLink ~= "" then
  7.             local itemId = select(4, ZO_LinkHandler_ParseLink(itemLink))
  8.             local itemName = GetItemLinkName(itemLink)
  9.             local bagStack, bankStack = GetItemLinkStacks(itemLink)
  10.  
  11.             if backpackTable[itemId] == nil then
  12.                 backpackTable[itemId] = {
  13.                     amountHave = 0,
  14.                 }
  15.             end
  16.            
  17.             backpackTable[itemId].amountHave = backpackTable[itemId].amountHave + bagStack
  18.             if dbg == true then d("have " .. backpackTable[itemId].amountHave .. " " .. itemName) end
  19.         end
  20.     end
  21.  
  22.     return backpackTable
  23. end

But I have only tested it quickly
Report comment to moderator  
Reply With Quote
Unread 09/13/15, 05:07 AM  
merlight
AddOn Author - Click to view AddOns

Forum posts: 671
File comments: 213
Uploads: 12
Ah, you've actually found the problem. Iterating list control data is not the correct way to scan backpack contents, it's never guaranteed to contain everything. The add-on should either scan SHARED_INVENTORY, or use GetItemLinkStacks (not sure the results would include repair kits from reward mails, but they're just a few and don't stack anyway).
Last edited by merlight : 09/13/15 at 05:08 AM.
Report comment to moderator  
Reply With Quote
Unread 09/13/15, 04:01 AM  
CaptainBlagbird
 
CaptainBlagbird's Avatar
AddOn Author - Click to view AddOns

Forum posts: 53
File comments: 177
Uploads: 23
So I played a bit around and I found something out that may be the problem.

(My inventory was 59/80 when testing this)

1. Reload UI
2. Type in chat "/script d(#ZO_PlayerInventoryBackpack.data)", for me it returns 0
3. Go to merchant store (stay in "Buy" menu), enter the code again, still returns 0 for me
4. Select "Sell" tab, enter the code again, it now displays 57
5. Leave store, open inventory, (close inventory optional)
6. Enter code again, it now correctly tells me 59

So for me the backpack table isn't set up completely until I open inventory. It is partially set up when I open the "Sell" tab of a merchant store (I guess the table only has the sellable items then).
If this happens for everyone, you could fix the problem by quickly switching to the "Sell" tab and back to the "Buy" tab when the player opens a merchant store. (The unsellable items don't matter anyways I guess, because these are quest Items that can't be bought anyway).



As a follow up test, I did the following:

(Destocked all item except one with a quantity of 1)

1. Reload UI
2. "/script d(#ZO_PlayerInventoryBackpack.data)" returns 0
3. Open merchant store

Result: "Bought 0 ..." (Because I don't have enough AP for this item)

4. Switch to "Sell" tab
5. "/script d(#ZO_PlayerInventoryBackpack.data)" returns 57
6. Leave and reopen merchant store

Result: No "Bought" message
Report comment to moderator  
Reply With Quote
Unread 09/12/15, 04:28 PM  
Randactyl
 
Randactyl's Avatar
AddOn Author - Click to view AddOns

Forum posts: 251
File comments: 462
Uploads: 17
Originally Posted by CaptainBlagbird
Every time I visit a quartermaster it buys the complete amount I specified (when I have enough AP). Is that how it is supposed to work, even when I already have some of the items?
Nope, definitely not. I'll look at it.
Report comment to moderator  
Reply With Quote
Unread 09/12/15, 04:09 PM  
CaptainBlagbird
 
CaptainBlagbird's Avatar
AddOn Author - Click to view AddOns

Forum posts: 53
File comments: 177
Uploads: 23
Every time I visit a quartermaster it buys the complete amount I specified (when I have enough AP). Is that how it is supposed to work, even when I already have some of the items?
Report comment to moderator  
Reply With Quote
Unread 06/06/15, 02:47 PM  
Randactyl
 
Randactyl's Avatar
AddOn Author - Click to view AddOns

Forum posts: 251
File comments: 462
Uploads: 17
Originally Posted by merlight
Today this add-on somehow bought more than I set it up for.

A) I set it to stock up 75 wall repair stones
B) Currently I have 2 stacks of stones in inventory (50 + 77)

1) Talk to siege merchant
2) Switch to Sell tab
3) Switch to Junk filter (or any other than All); I also use Advanced Filters, but don't touch them here
4) Leave merchant
5) Talk to merchant again
6) Add-on tries to buy 75 stones (despite me having stacks of 77 and 50 stones), and only fails because I have full inventory.

Step 3) is the breaking point. Without it everything's fine.
Thanks, merlight. I'll have a look at this soon.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump:

Support AddOn Development!

You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.