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,462
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 07-05-09, 08:38 AM  
tinyu
A Molten Giant
 
tinyu's Avatar
AddOn Author - Click to view AddOns

Forum posts: 837
File comments: 374
Uploads: 13
I just got this error when i set FDAS to buy always and i set Pungent Seal Whey to 60 and Sacred Candle to 60.

Error occurred when trying to buy the Pungent Seal Whey from Illusia Lane Innkeeper of the at Wintergarde Keep.

Date: 2009-07-06 00:04:23
ID: 1
Error occured in: Global
Count: 1
Message: ...tionDiscount_AutoStock\FactionDiscount_AutoStock.lua line 650:
attempt to perform arithmetic on a nil value
Debug:
[C]: ?
...tionDiscount_AutoStock\FactionDiscount_AutoStock.lua:650: PlayerWantsItemCount()
...tionDiscount_AutoStock\FactionDiscount_AutoStock.lua:615:
...tionDiscount_AutoStock\FactionDiscount_AutoStock.lua:606
(tail call): ?
...tionDiscount_AutoStock\FactionDiscount_AutoStock.lua:516: ScanAndBuy()
...tionDiscount_AutoStock\FactionDiscount_AutoStock.lua:338: ?()
...tionDiscount_AutoStock\FactionDiscount_AutoStock.lua:344: OnEvent()
[string "*:OnEvent"]:1:
[string "*:OnEvent"]:1
__________________
"There's no such thing as too many addons."
Lothaer
Titan Dev Team Member.
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.