BeanCounter
From Norganna's AddOns
Introduction
BeanCounter is a mod which works with Auctioneer to track the items you purchase and list for sale. The information it collects can be viewed on the BeanCounter tab of the Auction House interface.
Interface
To open BeanCounter left click on the Bean icon on the Sidebar.
To make changes to the default settings right click on the bean icon on the side bar
API's
BeanCounter.API.search(item, settings ,dataStyle , count)
This api allows 3 possible actions
- Display a search for the item in BeanCounter's Window.
- Return a formatted Table containing the reconciled data as BeanCounter's window would have shown it. Slower than RAW, but data is easier to access.
- Return a Raw set of tables containing each Database search matches. Faster than formatted but data is packed into ";" separated strings.
"item" The items name, itemID, itemlink, or itemKey
"settings" A table containing info deciding what filtering you want the api to use.
- settings = {["selectbox"] = {"1","server"},["bid"] = true, ["outbid"] = false, ["auction"] = true, ["failedauction"] = false}
- "server" will search all toons on the server, you can replace "server" with a specific Character's name to only return results from them.
"dataStyle" This controls what is done with the results, Display, return RAW or return formatted
- nil = Display in BeanCounter
- "none" = return RAW data
- true or any other value will return formated table.
"count" How many results from each toon per database should be returned
- nil = all matching results
- number = All results greater than the number will not be returned, data will be returned starting from newest entries to oldest
BeanCounter.API.getAHProfit(player, item, lowDate, highDate)
This API returns the +-profit(sold - bought), Starting Date and Ending Date. All supplied variables are optional, to get a simple total profit for all transactions on a server simply call BeanCounter.API.GetAHProfit()
- if no player name is supplied then the entire server profit will be totaled
- if no item name is provided then all items will be returned
- if no date range is supplied then a sufficently large range to cover the entire BeanCounter History will be used.
Technical information
Structure of the External search return tables
This is an example of the structure for the BeanCounter.externalSearch "RAW" returned table.
DATA = {
["completedAuctions"] = { [1] = { [1] = playername , [2] = itemID, [3] = textstringwithdata, [4] = auction TYPE, [5]= timestamp }
},
["completedBids/Buyouts"] = { [1] = { [1] = playername , [2] = itemID, [3] = textstringwithdata , [4] = auction TYPE, [5]= timestamp}
},
["failedAuctions"] = { [1] = { [1] = playername , [2] = itemID, [3] = textstringwithdata, [4] = auction TYPE, [5]= timestamp }
},
["failedBids"] = { [1] = { [1] = playername , [2] = itemID, [3] = textstringwithdata , [4] = auction TYPE, [5]= timestamp}
},
}
This is an example of the structure for the BeanCounter.externalSearch "ScrollFrame Formated" returned table.
{
itemname,
auctionType/status,
bid,
buyout,
Profit,
stacksize,
Profit/per,
seller/seller,
deposit,
fee,
current wealth,
time,
}--[1]
Structure of saved variables file
This is a simple example of the current structure of the Bean Counter's saved variables file:
BeanCounterDB = {
["settings"] = {
},
["mailbox"] = {
},
["server name"] = {
["player name"] = {
["wealth"] = 478915,
["version"] = 2.0,
--POSTING DATABASES -- These record Auction house activities
["postedBids"] = {
["itemID"] = {
["item string"] = {
"count, bid, seller, isBuyout, timeLeft, time(),current wealth", -- [tableIndex]
},
},
["24776"] = {
["item:24776:0:0:0:0:0:-16:1135673383"] = {
"1;27072;Darklycan;boolean false;3;1207259118;16393681", -- [1]
"1;29772;Darklycan;boolean false;3;1207269123;15287079", -- [2]
},
["item:24776:0:0:0:0:0:-21:1443758119"] = {
"1;27072;Bogey;boolean false;3;1207087564;12196306", -- [1]
},
},
},
["postedAuctions"] = {
["itemLink"] = {
["item string"] = {
"post.count, post.minBid, post.buyoutPrice, post.runTime, post.deposit, time(), current wealth", -- [1]
},
},
["30809"] = {
["item:30809:0:0:0:0:0:0:1882357030"] = {
"1;11199;22500;1440;60;1208908862;44018597", -- [1]
},
["item:30809:0:0:0:0:0:0:-1614321236"] = {
"1;16399;17272;1440;60;1209328336;49485181", -- [1]
},
["item:30809:0:0:0:0:0:0:444214606"] = {
"5;59900;113220;1440;300;1208621598;40968407", -- [1]
"5;59900;113220;1440;300;1208621598;40968407", -- [2]
},
},
},
--MAIL DATABASE --These record mail received from the Auction House
--after 31 days the data under each uniqueID key is moved into a standard key
["completedAuctions"] = {
["itemID"] = {
["item string"] = {
"stack, money, deposit , fee, buyout , bid, buyer, (time the mail arrived in our mailbox), current wealth", -- [1]
},
},
["23424"] = {
--standard
["item:23424:0:0:0:0:0:0:0"] = {
"4;33310;1200;1690;33800;30999;;1208329651;35509599", -- [1]
"5;41638;1500;2112;42250;38699;;1208420671;36937060", -- [2]
},
--uniqueID's
["item:23424:0:0:0:0:0:0:313916965"] = {
"4;33310;1200;1690;33800;30999;;1208329651;35509599", -- [1]
"5;41638;1500;2112;42250;38699;;1208420671;36937060", -- [2]
},
["item:23424:0:0:0:0:0:0:1955392588"] = {
"10;50025;3000;2475;49500;44099;Momopeach;1206848393;8917890", -- [1]
"3;15008;900;742;14850;13299;Momopeach;1206848414;8917890", -- [2]
},
},
},
["completedBids/Buyouts"] = {
["itemID"] = {
["item string"] = {
"stack, money, deposit , fee, buyout , bid, seller, (time the mail arrived in our mailbox), current wealth", -- [tableIndex]
},
},
["9828"] = {
--standard
["item:9828:0:0:0:0:0:0:0"] = {
"1;0;0;12100;12100;Faroo;1198270386;169868", -- [1]
},
--uniqueID's
["item:9828:0:0:0:0:0:0:1234568"] = {
"1;0;0;7000;7000;Nlcco;1198270369;169868", -- [1]
},
},
},
["failedBids"] = {
["itemID"] = {
["item string"] = {
"money, (time the mail arrived in our mailbox), current wealth", -- [tableIndex]
},
},
["24776"] = {
--standard
["item:24776:0:0:0:0:0:-16:0"] = {
"27072;1207264974;14414548", -- [1]
},
--standard
["item:24776:0:0:0:0:0:-21:0"] = {
"27072;1207092890;12544126", -- [1]
},
--uniqueID
["item:24776:0:0:0:0:0:-20:154815"] = {
"32672;1199669531;10315340", -- [1]
},
},
},
["failedAuctions"] = {
["itemID"] = {
["item string"] = {
"stack, buyout, bid, deposit, (time the mail arrived in our mailbox), current wealth", -- [tableIndex]
},
},
["11135"] = {
--standard
["item:11135:0:0:0:0:0:0:0"] = {
"1;8000;7699;0;1207323703;17381480", -- [1]
"1;8000;7699;0;1207323703;17381480", -- [2]
"1;6930;6599;0;1207456656;19488092", -- [3]
"1;6930;6599;0;1207456661;19488092", -- [4]
},
--uniqueID's
["item:11135:0:0:0:0:0:0:1990370642"] = {
"1;14285;13599;0;1208367061;37452797", -- [1]
"1;16666;15899;0;1208462859;36965614", -- [2]
"1;15000;14299;0;1208550211;40646399", -- [3]
},
},
},
},
},
}
Glossary
"server name" string
- Is the name of the server the item was recorded. eg: Blackrock
"player name" string
- Is the name of the player the item was recorded. eg: Mywarlock
"postedBids" string
- Is a list of all bids made at the Auction House
"postedAuctions" string
- Is a list of all items player has posted at the Auction House
"completedBids/Buyouts" string
- Is a list of all bids/buyout invoices received in the mail
"completedAuctions" string
- Is a list of all SOLD Auction invoices received in the mail
"failedAuctions" string
- Is a list of all Un-SOLD Auction invoices received in the mail
"failedBids" string
- Is a list of all Failed Bid invoices received in the mail
"itemID" string
- Is the global server ID of the item recorded. eg: 'Malachite = 774'
"itemLink" string
- Is the server link of the item recorded. eg: '|cff1eff00|Hitem:774:0:0:0:0:0:0:0|h[Malachite]|h|r'
"item string" string
- Is the string from the itemLink. eg: '|cff1eff00|H item:774:0:0:0:0:0:0:0 |h[Malachite]|h|r'
"current wealth" string
- Is the amount of gold for the toon at the time of the transaction.
"seller" string
- The character you purchased the item from
"buyer" string
- The character you the item too
"isBuyout" boolean
- true if Item was bought, false if item was obtained by bid
Structure of the Classic BeanCounter variables file
This is a simple example of the classic structure of the Bean Counter's saved variables file:
BeanCounterAccountDB = {
["server name"] = {
["purchases"] = {
["item name"] = {
"time;quantity;value;seller;isBuyout;buyerId", -- [tableIndex]
},
["Mageweave Bag"] = {
"1163113251;1;7500;Phobosme;1;1", -- [1]
"1163113243;1;7500;Phobosme;1;1", -- [2]
},
},
["completedAuctions"] = {
["item name"] = {
"time;result;quantity;proceeds;price;isBuyout;deposit;consignment;buyerName;sellerId", -- [tableIndex]
},
["Formula: Enchant Gloves - Mining"] = {
"variable1;0;<nil>;9522;9555;1;444;477;Armandeo;1", -- [tableIndex]
},
},
["version"] = 30002,
["pendingBids"] = {
["item name"] = {
"time;quantity;bidValue;seller;isBuyout;timeLeft;buyerId", -- [tableIndex]
},
["Golden Sansam"] = {
"1191424332;17;3390;Cranus;0;4;1", -- [1]
},
},
["completedBids"] = {
["item name"] = {
"time;quantity;value;seller;isBuyout;isSuccessful;isPurchaseRecorded;buyerId", -- [tableIndex]
},
["Lesser Planar Essence"] = {
"1191425224;1;15000;Absi;1;1;1;1", -- [1]
},
},
["sales"] = {
["item name"] = {
"time;saleResult;quantity;bid;buyout;netPrice;price;isBuyout;buyerName;sellerId", -- [tableIndex]
},
["Dwarven Mild"] = {
"variable1;0;2;160;200;190;200;1;Antisleep;1", -- [variable6]
"1163497093;1;3;240;300;-36;<nil>;<nil>;<nil>;1", -- [2]
"1164113968;1;1;20;250;-12;<nil>;<nil>;<nil>;1", -- [3]
},
},
["players"] = {
"characterNname", -- [1]
},
["pendingAuctions"] = {
["item name"] = {
"time;quantity;bid;buyout;runTime;deposit;consignmentPercent;sellerId", -- [tableIndex]
},
["Primal Life"] = {
"1191414377;1;70000;80000;1440;2400;0.05;1", -- [1]
},
},
},
}
Glossary
"server name" string
- Is the name of the server the item was recorded. eg: Blackrock
"purchases" string
- Is a list of all successful purchases recorded
"item name" string
- Is the name of the item recorded. eg: 'copper ore' or 'linen cloth'
"time" int
- Servertime
"quantity" int
- item quantity
"value" int
- total Value of Stack
"seller" string
- The character you purchased the item from
"isBuyout" boolean
- true if Item was bought, false if item was obtained by bid
"isBuyout" boolean
- unknown
"isPurchaseRecorded" boolean
- unknown
"buyerId" int
- own character involved in the transaction, index of [players]
"tableIndex" int
- lua-organized table-Index
"timeLeft" int
- 1 short time (less then 30 min.)
- 2 medium time (30 min. till 2 hours)
- 3 long time (2 till 8 hours)
- 4 very long time (more then 8 hours)
"price" int
- auction result
"netPrice" int
- auction-result - consignment

