BeanCounter

From Norganna's AddOns

Jump to: navigation, search


Contents

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

BeanCounterSidebar.jpg

To open BeanCounter, left-click on the Bean icon on the Sidebar (see image at right - if the Sidebar does not contain the Bean icon, log off and make sure BeanCounter is enabled in your AddOns.)

To make changes to the default settings, right-click on the Bean icon on the Sidebar, or click on the Configure button in the BeanCounter tab of the Auction House (if the BeanCounter tab does not appear (and BeanCounter is enabled - see above), backup and reinstall the latest Auctioneer).

Configuration Windows

BeanCounter Config Config.jpg BeanCounter Config Debug.jpg BeanCounter Config DataMantenaince.jpg

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 are easier to access.
  • Return a RAW set of tables containing each database search matches. Faster than formatted, but data are packed into ";" separated strings.

"item" The item's name, itemID, itemlink, or itemKey.

"settings" A table containing info specifying 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 it.

"dataStyle" This controls what is done with the results: display, return RAW, or return formatted.

  • nil = Display in BeanCounter
  • "none" = Returns RAW data.
  • true or any other value will return formatted table.

"count" This determines how many results from each toon per database will be returned.

  • nil = all matching results
  • number = All results greater than the number will not be returned. Data will be returned sorted 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 sufficiently large range to cover the entire BeanCounter History will be used.

BeanCounter.API.getBidReason(itemLink, quantity)

This API will return the reason, time, and price paid for an item bought via SearchUI or BTM Scanner.

  • If no data are found, nil is returned.

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,
	Purchase Reason,
	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(),Purchase reason", -- [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), Purchase reason", -- [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

  • the name of the server the item was recorded. eg: Blackrock

"player name" string

  • the name of the player the item was recorded. eg: Mywarlock

"postedBids" string

  • a list of all bids made at the Auction House

"postedAuctions" string

  • a list of all items player has posted at the Auction House

"completedBids/Buyouts" string

  • a list of all bids/buyout invoices received in the mail

"completedAuctions" string

  • a list of all SOLD Auction invoices received in the mail

"failedAuctions" string

  • a list of all Un-SOLD Auction invoices received in the mail

"failedBids" string

  • a list of all Failed Bid invoices received in the mail

"itemID" string

  • the global server ID of the item recorded. eg: 'Malachite = 774'

"itemLink" string

  • 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

  • the string from the itemLink. eg: '|cff1eff00|H item:774:0:0:0:0:0:0:0 |h[Malachite]|h|r'

"Purchase reason" string

  • the reason provided by SearchUI for this transaction.

"seller" string

  • the character you purchased the item from

"buyer" string

  • the character you sold the item to

"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 BeanCounter'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

  • the name of the server on which the item was recorded. eg: Blackrock

"purchases" string

  • a list of all successful purchases recorded

"item name" string

  • the name of the item recorded, e.g., 'Copper Ore' or 'Linen Cloth'

"time" int

  • server time

"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 than 30 min.)
  • 2 medium time (between 30 min. and 2 hours)
  • 3 long time (between 2 and 12 hours)
  • 4 very long time (more than 12 hours)

"price" int

  • auction result

"netPrice" int

  • auction-result - consignment


Personal tools