Download
(8Kb)
Download
Updated: 06-26-10 02:52 AM
Pictures
File Info
Updated:06-26-10 02:52 AM
Created:06-23-09 10:57 AM
Downloads:2,456
Favorites:20
MD5:

FactionDiscount AutoStock

Version: 1.3
by: Nafe [More]

If you're like me, you like to avoid paying unnecessary fees at vendors.
FactionDiscount AutoStock is an addon that automatically stocks up on specified items (usually reagents/poisons) when you visit a vendor providing a specified reputation level (and hence, a specified Faction Discount). I always avoided autobuy addons because they would blatantly buy at any merchant, and I'd lose my 20% exalted discount just by visiting a non-factioned vendor. Hence, I decided to write an addon that can be set to buy only when I receive a specified faction discount.
FactionDiscount AutoStock is a sister addon to FactionDiscount AutoRepair!


How is FactionDiscount AutoStock different from other autobuy addons?
As mentioned above, FactionDiscount AutoStock lets you choose what discount is required before it automatically buys for you. Don't lose pocket change by buying at a non-factioned vendor when you didn't want to!
In addition, FactionDiscount AutoStock offers a number of easy-to-use features that make configuration a breeze and highly flexible.


Features

  • autobuy at vendors only when you receive a certain faction discount
  • Useable and configurable for any vendor-bought item
  • Comes pre-packaged with class defaults (reagents/poisons) for level 80, enabled by a simple slash command. This also checks both of your specs to see if you have a glyph that removes the reagent cost!
  • Overbuyer Protection! This only queues one set of purchases in a 5-second window, lowing the chance that you'll overbuy the items by attempting to buy another set of items before your inventory records receiving them. This reduces the chance that latency will make you spend too much.
  • Only buy up to the amount you enter. In the case of items that are bought in a stack (example: Symbol of Kings, sold in 20s), it will buy as many as it can without going over your preference. (If you have 81 Symbols and a preference of 100, for instance, it won't buy any)
  • Extremely flexible and quickly configurable using a set of slash commands


What configuration is possible?
I stumbled upon the API function that allows checking of rep levels of merchants, but it is unfortunately unable to differentiate between a Friendly rep, and any NPC that is "Green named."
Therefore there are 4 threshold settings possible:
  • Always Buy (i.e. neutral and above)
  • Buy w/ Honored (and above) discounts
  • Buy w/ Revered (and above) discounts
  • Buy w/ Exalted discounts only
In addition to setting the discount required to autobuy, you can set the Enable/Disable state.
Each character will have an independent setting.
Each character defaults to the Enabled state, and the Buy w/ Exalted discount threshold. However, unless you enter in a set of items to buy, FactionDiscount AutoStock won't buy anything.


Configuring FactionDiscount AutoStock
Since I've never been very good at GUIs (and in many simple cases, prefer slash-command configuration), configuration is done entirely through slash commands. See below for a list.
What slash commands are available?
Code:
/fdas                                        -   Lists available commands
/fdas enable | disable                       -   Enables/Disables autobuying for the current character
/fdas status                                 -   Disables the enable state and discount threshold
/fdas class                                  -   Sets the class defaults for the current character (1 stack per item).  Only usable at level 80.
/fdas list                                   -   Lists all items your current character is set to autobuy at a vendor w/ the appropriate discount
/fdas clear                                  -   Clears all stock preferences for the current character
/fdas always | honored | revered | exalted   -   Sets the faction discount threshold required to autobuy
/fdas # [ItemLink]                           -   Sets the autobuy preferences for the Item, # quantity.  Quantities and Links can come in any logical order.
   /fdas #1 #2 #3 [Item1] [Item2] [Item3]    -   An example of the flexibility of this command
   /fdas [Item1] #1 [Item2] #2               -   Another example
(See the available slash commands screenshot)

Example: Enables FDAS, sets the threshold to Revered, and adds some reagent preferences.
/fdas enable
/fdas revered
/fdas 20 [Rune of Portals] [Rune of Teleportation]20 100 [Arcane Powder]
Please see the slash commands demo screenshot.


I like this addon. Do you have a similar one that autorepairs?
Yep, please take a look at FactionDiscount AutoRepair.


Known Quirks/Issues
  • The addon doesn't calculate free inventory slots properly if you have a special bag (e.g. Inscription Bag) and are trying to buy an item that can fit in that bag. In most cases this won't be noticeable, but sometimes it may be.
  • After a patch, or if you recently cleared your cache, FactionDiscount AutoStock may not be able to generate item links. As soon as you see the item, however, it can.
  • If you visit a vendor that has items that aren't in your cache, FactionDiscount AutoStock has to scan the merchant's items before it can decide if it has items which it has been told to buy. This process typically takes 1-5 sec.
  • Latency can cause the purchase not to be processed if the player does not wait at the merchant long enough. (Unfixable, sorry!)
  • Friendly discount threshold is not a selectable configuration.
    (I chose to forego this because the API does not support it conveniently; instead I'd have to use Tooltip Scanning - a higher memory footprint and a workaround that sometimes fails. I figured most people interested in this mod would want an Honored or above discount anyways.)
  • Some messages indicate you received a Honored/Exalted discount instead of an Honored/Exalted discount. This is just a linguistic defect that I consider low-priority.


Possible Future Features
  • Extend the class defaults feature to function for all levels
  • Extend the preferences slash command so that ItemLinks aren't necessary if you enter an item name and have the item with you. (possibly set off by brackets)
  • Implement checking special BagTypes when calculating free inventory slots
  • Improve the overbuyer protection feature to be more configurable and check for inventory updates instead of a 5-second window.
  • Automatically load items into your cache if they're on your preference list but not on your cache (to fix the issue mentioned above). (I'm not even sure if this is possible automatically - we'll see)
  • Slash command to set the threshold to the highest reputation level you have on that character
  • Lower the memory footprint when this and FactionDiscount AutoRepair are used together.


Want to help?
I'm always interested in Bug Reports and Feature Requests. I try to keep this addon lightweight and simple, so in some cases I may turn down extensive requests.
I'm also a recent college graduate paying off my loans from undergraduate+graduate school. Any donations you feel like sending my way would be gratefully appreciated and allow me more time to work on addons

Version 1.3 released

In this version:
  • New features:
    • Now outputs the vendor cost when AutoBuying at a vendor.
      Format: [FactionDiscount AutoStock] Bought items at NPCNAME for COST with a REPLEVEL discount.
      Thank you speak and trclocke for the feature suggestion. Sorry it took so long.
  • Patch-compatibility Fixes:
    • Updated TOC file to work with patch 3.3.*

-----------------------------

Version 1.2 released

In this version:
  • Bug Fixes:
    • No longer sometimes fills your entire inventory with an item when you set it to buy more than one stack
This was a huge bug that I didn't notice during my testing, because it only would happen in certain scenarios. I deeply apologize to those whom it has affected. Sorry =\
Thanks Taksi and Zidomo for the bug reports.

-----------------------------

Version 1.1 released

In this version:
  • Bug Fixes:
    • Now properly checks to make sure your inventory is not full.
      Still sometimes will report your inventory to be full if you are buying an item that fits into a special-purpose bag, and only have slots open in that bag.
    • Now properly buys more than one stack of an item
Optional Files (0)


Post A Reply Comment Options
Unread 06-11-11, 04:46 PM  
Nafe
A Deviate Faerie Dragon
AddOn Author - Click to view AddOns

Forum posts: 17
File comments: 35
Uploads: 12
Originally posted by speak
this seems to have stopped working in 4.1. i get some message about having high latency and the mod not being able to scan the npc. my latency is not high though
Sorry for such a slow response.
I actually don't have an active account anymore, as "real life" has been keeping me quite busy.

Judging by your comment, they've changed the way the UI works. The check with the latency in there was "error-checking" from looong ago when I postulated what may happen if the addon is unable to obtain data.

I'll be willing to put in some time to update this if someone is willing to test the updates for me. Please contact me via here or IM (if you prefer).
Report comment to moderator  
Reply With Quote
Unread 04-26-11, 06:09 PM  
speak
A Wyrmkin Dreamwalker
 
speak's Avatar

Forum posts: 57
File comments: 186
Uploads: 0
this seems to have stopped working in 4.1. i get some message about having high latency and the mod not being able to scan the npc. my latency is not high though
Report comment to moderator  
Reply With Quote
Unread 06-26-10, 02:52 AM  
Nafe
A Deviate Faerie Dragon
AddOn Author - Click to view AddOns

Forum posts: 17
File comments: 35
Uploads: 12
Thumbs up Version 1.3 released

Version 1.3 released

In this version:
  • New features:
    • Now outputs the vendor cost when AutoBuying at a vendor.
      Format: [FactionDiscount AutoStock] Bought items at NPCNAME for COST with a REPLEVEL discount.
      Thank you speak and trclocke for the feature suggestion. Sorry it took so long.
  • Patch-compatibility Fixes:
    • Updated TOC file to work with patch 3.3.*
Report comment to moderator  
Reply With Quote
Unread 07-23-09, 11:06 AM  
Chisato
A Defias Bandit
 
Chisato's Avatar

Forum posts: 2
File comments: 4
Uploads: 0
Thanks for putting so much effort into both Faction Discount Auto Stock and Repair! I love these addons! Anything that saves me another click or another thing to worry about is great.
Report comment to moderator  
Reply With Quote
Unread 07-16-09, 06:38 AM  
Gonbrok
A Defias Bandit

Forum posts: 2
File comments: 13
Uploads: 0
Nafe: Very cool, and I think the idea is fine
Report comment to moderator  
Reply With Quote
Unread 07-12-09, 07:37 PM  
Nafe
A Deviate Faerie Dragon
AddOn Author - Click to view AddOns

Forum posts: 17
File comments: 35
Uploads: 12
Originally Posted by Gonbrok
My problem is that certain items, is only available at vendors, which is not factioned (Nixi Fireclaw which sells pvp water). I've set my filter to exalted, but that doesn't help much when the vendor isn't factioned

Is there any plans of some sort of exclusive list, which allows me to autostock these types of item, while maintaining exalted filter?
I did come up with the thought of doing this, but hadn't found a very common example of where someone would want to do it. Thanks for pointing out the example of the PvP water. As a mage, I didn't even know this stuff existed.

The PvP water in particular will take a bit more time to get added properly. The addon currently doesn't support checking for "extendedcost" prices, so I'll have to work on that. The check isn't entirely necessary, but I put it in there to make sure that players actually have money/items to purchase what they want.

I will be adding in an ability to specify a list of items to purchase anytime; I'm not quite sure the format of this... I may use the same slash command, and modify it like: /fdas [ItemLink] !200
! here would be an indicator to buy no matter what the NPC discount is.
What do you think of this method of configuration?

P.S. thanks for the positive feedback; it's good to hear that you like the addon. =)
Report comment to moderator  
Reply With Quote
Unread 07-10-09, 04:35 AM  
Gonbrok
A Defias Bandit

Forum posts: 2
File comments: 13
Uploads: 0
I am a multiboxer, which means I autostock alot of things, I like the general idea behind this addon. My problem is that certain items, is only available at vendors, which is not factioned (Nixi Fireclaw which sells pvp water). I've set my filter to exalted, but that doesn't help much when the vendor isn't factioned

Is there any plans of some sort of exclusive list, which allows me to autostock these types of item, while maintaining exalted filter?

Neat addon, thanks for the work
Report comment to moderator  
Reply With Quote
Unread 07-07-09, 05:16 PM  
Nafe
A Deviate Faerie Dragon
AddOn Author - Click to view AddOns

Forum posts: 17
File comments: 35
Uploads: 12
Thumbs up Version 1.2 released

Version 1.2 released

In this version:
  • Bug Fixes:
    • No longer sometimes fills your entire inventory with an item when you set it to buy more than one stack
This was a huge bug that I didn't notice during my testing, because it only would happen in certain scenarios. I deeply apologize to those whom it has affected. Sorry =\
Thanks Taksi and Zidomo for the bug reports.
Report comment to moderator  
Reply With Quote
Unread 07-07-09, 05:16 PM  
Taksi
A Kobold Labourer

Forum posts: 0
File comments: 3
Uploads: 0
Thumbs up Re: Re: same issue

Originally posted by Nafe
Thanks again!
Nafe
No no, thank you. I'll happily give productive bug reports to avoid having to write some of these addons myself.

edit: New version appears to work fine.
Last edited by Taksi : 07-07-09 at 05:33 PM.
Report comment to moderator  
Reply With Quote
Unread 07-07-09, 03:20 PM  
Nafe
A Deviate Faerie Dragon
AddOn Author - Click to view AddOns

Forum posts: 17
File comments: 35
Uploads: 12
Re: same issue

Taksi, thank you very much for describing the whole process. It let me narrow down on the bug quite quickly.
Turns out I was missing a very important if statement; I had a comment there indicating "if this, do this" but didn't write the actual if. Doh!

I've pushed a new version. I'll write a changelog after I see it accepted.

Originally Posted by Taksi
I'd recommend creating a boolean safeguard "hasBought". Set it to false on leaving the vendor, and set it to true when you fire the buying command.
The method you described is essentially already implemented. The addon doesn't autobuy unless you open the vendor window fresh.

What I need to do is check for inventory updates, but I haven't polished that method up quite yet.

Thanks again!
Nafe
Report comment to moderator  
Reply With Quote
Unread 07-07-09, 01:59 PM  
Taksi
A Kobold Labourer

Forum posts: 0
File comments: 3
Uploads: 0
same issue

Process to reproduce:

1) Install AutoStock

2) Load WoW

3) Use the following settings:

/fdas enable
/fdas exalted
/fdas [Devout Candle] 100

4) Use Hearthstone

5) Run to reagent vendor

6) Watch it buy 5 to finish off the stack (I had 15). Wait as instructed (I think I read 5 second loop)

7) WoW "blinks" (quick FPS drop), bags are now full of Candles (540 to be exact).

I'd recommend creating a boolean safeguard "hasBought". Set it to false on leaving the vendor, and set it to true when you fire the buying command. I'll debug some tonight if you don't get to it this afternoon. In the meantime I'll be afraid to touch a vendor with candles
Report comment to moderator  
Reply With Quote
Unread 07-07-09, 08:11 AM  
Nafe
A Deviate Faerie Dragon
AddOn Author - Click to view AddOns

Forum posts: 17
File comments: 35
Uploads: 12
Originally Posted by Zidomo
v1.0 worked well. Then I upgraded early on July 6 to v1.1 from v1.0. Went to an Exalted vendor on an 80 Priest and...my bags automatically filled up with 125g worth of Devout Candles (820 total) instead of the 80 I had set v1.0 to refill. GRRRR .
I've checked over the code. All that changed was the ability to buy more than one stack of items. I've tested to code to make sure it doesn't overbuy, and currently the only time this does happen is in a period of extreme latency. Even in that case, it shouldn't overbuy at such an extreme amount.
I'm curious as to what exactly happened in your case. The code change allowed for buying of more than one stack, as was the original intent, but there was nothing that should've modified your buying preferences, and those who set to buy for 1 stack or less shouldn't have seen any difference.
I would be more than grateful if you would post (/PM/send) your SavedVariables file, as that would help me narrow down the issue.

Originally Posted by Zidomo
I see that the July 6th release of v1.1 had a FactionDiscount_AutoStock.lua file that is dated "July 6/09, 1:14PM". But the currently available v1.1's FactionDiscount_AutoStock.lua is dated "July 7/09 12:26AM". Seems you did an unannounced, no change-log update. To fix that jolly fun bug?
Quite honestly, there's a two-line difference that I felt didn't require an announcement because there were very few downloads: I simply removed a debug printout.

Originally Posted by Zidomo
If not, no matter. That's the sort of bug that causes me to stop using a mod . GL with it.
I'm sorry that such a bug occured for you. I'd like to investigate it as mentioned above, if you'd be willing to help.
Report comment to moderator  
Reply With Quote
Unread 07-06-09, 11:11 PM  
Zidomo
A Cliff Giant
 
Zidomo's Avatar

Forum posts: 76
File comments: 1046
Uploads: 0
Tried this out last week. Seemed an ideal alternative to the now-discontinued BuyDropper for my level 80s.

v1.0 worked well. Then I upgraded early on July 6 to v1.1 from v1.0. Went to an Exalted vendor on an 80 Priest and...my bags automatically filled up with 125g worth of Devout Candles (820 total) instead of the 80 I had set v1.0 to refill. GRRRR .

I see that the July 6th release of v1.1 had a FactionDiscount_AutoStock.lua file that is dated "July 6/09, 1:14PM". But the currently available v1.1's FactionDiscount_AutoStock.lua is dated "July 7/09 12:26AM". Seems you did an unannounced, no change-log update. To fix that jolly fun bug?

If not, no matter. That's the sort of bug that causes me to stop using a mod . GL with it.
Report comment to moderator  
Reply With Quote
Unread 07-06-09, 11:29 AM  
Nafe
A Deviate Faerie Dragon
AddOn Author - Click to view AddOns

Forum posts: 17
File comments: 35
Uploads: 12
Thumbs up Version 1.1 released

Version 1.1 released

In this version:
  • Bug Fixes:
    • Now properly checks to make sure your inventory is not full.
      Still sometimes will report your inventory to be full if you are buying an item that fits into a special-purpose bag, and only have slots open in that bag.
    • Now properly buys more than one stack of an item
Report comment to moderator  
Reply With Quote
Unread 07-05-09, 08:19 PM  
Nafe
A Deviate Faerie Dragon
AddOn Author - Click to view AddOns

Forum posts: 17
File comments: 35
Uploads: 12
Hi tinyu,

Thanks for the bug report. I actually just noticed the error this past Saturday, but have been away for the weekend so I haven't had a chance to fix it.

I'll get it updated asap. (likely will be tomorrow)

Thanks again,
Nafe
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.