view AuctionAddons/AuctionProfitMaster.lua @ 36:58fb38f0b447

The list of possible commands when you write /im without any arguement will now include commands inserted by modules with their own descriptions. Clicking a command in this list will now execute it. The slash command handler function is now a global so you can invoke these through other methods. Added an optional event function to registering auction pricing addons, when defined this will be executed when the pricing addon gets selected. Removed the unused ?Override local item data? option. Added ?AuctionProfitMaster? and ?ZeroAuctions? pricing support. The pricing info displayed in the summary window will be used for this. Trying to queue without any items in the summary should no longer give an error.
author Zerotorescue
date Sat, 20 Nov 2010 17:24:16 +0100
parents
children
line wrap: on
line source
do

	local APM;
	
	local function GetValue(link)
		return (APM and APM:GetModule("Scan"):GetLowestAuction(APM:GetSafeLink(link))) or -1;
	end
	
	local function IsEnabled()
		local isEnabled = (select(6, GetAddOnInfo("AuctionProfitMaster")) == nil);
		
		if isEnabled then
			APM = LibStub("AceAddon-3.0"):GetAddon("AuctionProfitMaster");
		end
		
		return isEnabled and APM;
	end
	
	local function OnSelect()
		local addonName = "|r|cfffed000AuctionProfitMaster|r|cffff6600";
		
		print("|cffff6600Using " .. addonName .. " as pricing addon is not recommended. Items at the auction house above the \"ignore stacks over\" will always be ignored (and thus not affect the displayed price) and if you are the only one posting, " .. addonName .. " will act as if there are no auctions up.|r");
	end
	
	IMRegisterPricingAddon("AuctionProfitMaster", GetValue, IsEnabled, OnSelect);
	
end