BottomScanner/BaseRule/BaseRule Scratch
Z Norganna's AddOns
Obsah |
BaseRule Scratch page
The meaning of this page is that you, the user, can share your particular base-rule(-snippet) with other users (if you want). Or discuss some nifty thing you are using.
Some Rules/Guidelines
The things I put here are not strict rules, but see them as guideline to keep the page from clogging up
- When you post a BaseRule below the next section use the following construction:
| ===<YourName>'s BaseRule [example]=== ====BaseRule==== |
In text this shows up as:
<YourName>'s BaseRule [example]BaseRule"In this section goes your base-rule" Explanation"And here goes the explanation for your base-rule" |
- Below this last line enter 4x a "~" (thus ~~~~) this will make sure that the wiki-software automatically adds your name and the date you've added.
- If you want to comment on a base-rule, please use the BaseRule Scratch Discussion page
- Have Fun Nemelis 18:47, 3 March 2007 (EST)
BaseRule Scratch
Bishop's BaseRule
BaseRule
local _,_, quality, _, _, class, _,_,_ = GetItemInfo(itemID) if (quality==2 and (class =="Weapon" or class == "Armor")) then basePrice = 0 end
Explanation
I never want to see equipable greens pop up for resale -- their exposure is too low and the deposits too high. However, "equip" seems to evaluate to true even for some items that are not equipable, so this doesn't actually function 100% as expected. It tends to also filter out resale of green trade goods.
(please read up on the GetItemInfo API, that return value actually refers to this: itemEquipLoc, String - Where the item may be equipped, if it can. The string returned is also the name of a global string variable, i.e. for "INVTYPE_HEAD" there is a INVTYPE_HEAD variable containing a localized, displayable name of the location. --dinesh 14:21, 7 March 2007 (EST))
- Thanks Dinesh. I figured that if the item could be equipped somewhere, equip would evaluate to true (because it would contain a string), and otherwise to false (because it would be NULL). I suppose I figured wrong. I've updated to a version that should work better. --Bishop 17:49, 7 March 2007 (EST)
Chardonnay's Anti-Scammer BaseRule
BaseRule
-- anti-scammer baserule
-- costing scammers money is nearly as much fun as making your own!
local getAuctionValue = function(itemID, itemCount)
local value = nil
local _, link = GetItemInfo(itemID)
if link then
local key = Auctioneer.ItemDB.CreateItemKeyFromLink(link)
if key then
local median = Auctioneer.Statistic.GetUsableMedian(key)
if median then
value = median * itemCount
end
end
end
return value
end
if bidPrice ~= 0 and buyPrice ~= 0 then
local trueValue = getAuctionValue(itemID, itemCount)
if trueValue then
if bidPrice < 10000 and buyPrice >= trueValue * 10 then
-- low bid, extortionate buyout. scam!
-- bid close to true value to maximise scammer losses
local myBidPrice = trueValue * 0.90
if myBidPrice >= bidPrice then
action = "bid"
reason = "Scam (" .. buyPrice .. ")"
-- adjust bidPrice (you'll need to modify your copy of Btm for
-- this to feed through properly; the default bid will be used
-- otherwise)
bidPrice = myBidPrice
end
end
end
end
Explanation
Ever seen those scammers who post items worth a few gold for 50s bid/99g buyout? This baserule is aimed at them. Every day the scammers log in, cancel all their auctions and put them up again. If there's a bid on the auction they lose not only their deposit but also 5% of the amount bidded.
So, if this baserule sees an auction with a reasonable bid but an extortionate buyout, it will suggest a bid. Either you win the auction and make a profit, or the scammer cancels the auction and makes a loss. Either way, you win! Chardonnay 01:12 2007年Mar24日 (EDT)
Iain's BaseRule for disenchanting
BaseRule
local name,link,quality,itemlevel,level, class, _,_, equip = GetItemInfo(itemID)
local base
local defor=0
local ench = WOWEcon_GetDisenchant_ByLink(link)
if (ench) then
local total = 0;
for idx, row in pairs(ench) do
total = total + row[3];
end
if (total >0) then
local expected_copper = 0;
for idx,row in pairs(ench) do
local prob = row[3] / total;
local price=Auctioneer.Statistic.GetSuggestedResale(Auctioneer.ItemDB.CreateItemKeyFromLink(row[1]),Auctioneer.Util.GetAuctionKey(),1)
if (price) then
expected_copper = expected_copper + prob * price * row[2];
end
end
--ChatFrame1:AddMessage("("..name..") Q: "..quality.." L:"..level.." C:"..class.." EDE:"..expected_copper);
defor=0.85 * expected_copper;
end
end
-- if auctioneer doesn't know the price or has seen it less than twice
if (auctPrice == 0 or auctSeen < 2) then
-- make base = 3/4 conservative price
base = consPrice * 0.75
-- else if auctioneer is more than 3 time the conservative
elseif (auctPrice > 3 * consPrice) then
-- make base = 3:1 weighted average of prices in favor of conservative
base = (3 * consPrice + auctPrice) / 4
-- else if auctioneer price is less than 1.2 times the conservative
elseif (auctPrice < consPrice * 1.2) then
-- just use auctioneer's price
base = auctPrice
-- otherwise, auctioneer's more than 1.2 and less than 3 times the conservative
else
-- make base = 3:1 weighted average of prices in favor of auctioneer
base = (consPrice + 3 * auctPrice) / 4
end
-- set the auctionFee, so that the tooltip knows it's been accounted for
auctionFee = cutRate * base
-- value the item at base - 3* deposit - the auction fee
basePrice = base - 3*depositCost - auctionFee
-- special disenchanter! itemlevel > 65 for BC only
if (defor>bidPrice and level>50) then
action="bid"
reason="WOWEcon_DE_Bid"
basePrice=defor
depositCost=0
end
if (defor>buyPrice and level>50) then
action="buy"
reason="WOWEcon_DE_BO"
basePrice=defor
depositCost=0
end
Explanation
I cobbled this baserule together becase I felt I was missing out on a lot of Disenchant possibilities with Enchantrix not presently being up to the task.
It uses the WOWEcon mod from www.wowecon.com, which comes with a pretty complete (and occasionally wrong) disenchant database for items, the code calculates the probability of the various disenchants, looks up the resale price for the dusts/essences/shards from Auctioneer and produces an expected resale cost for the disenchant, it then multiplies this by 0.85 so we're looking for a 15% profit on disenchants minimum and then decides to buyout the item if possible (i'm not the only person doing this on my realm, so buyout before someone else does), or bid if the item is within that range.
Coupled with the standard baserule from the main baserules page this should provide a reasonable resale/disenchant model (hopefully! my first base rule, and first piece of LUA code for that matter).
Modify the "defor=0.85*...." if you want to change the minimum profit cap.
Also in the two IF blocks at the end I have a 'level' constraint to avoid me ending up with a bag full of level 10 essences, I will occasionally manually change this to 'restock' lower level enchant reagents but am presently using "level>50" to pick up the old "end game" disenchants as well as the TBC ones. If you want TBC ones only use "itemlevel>65" instead of "level>50", as obviously there is some overlap between disenchanting based on 'requires level' around the 58-60 mark.
Hope this is some use, auctioneer is an awesome mod and I felt I should contribute a little something back, enjoy!
REMEMBER: You will need the WOWEcon Mod for this to work, and you will have to set it to download the disenchant database too!
WARNING: The major flaws in the disenchant database are the usual kind - look out for items that have very few disenchants listed as they are probably wrong data, for example disenchant data exists for the Lesser Magic Wand (and other enchanter made wands), Twilight Cultist suits, etc, none of which can be disenchanted. Maybe I could put a line in that says "only if number of disenchants seen is > xx" but i've done more than enough hacking to get this to work as well as it does, and i'm happy enough with it, I just stuck Twilight sets, and Enchanter Wands on bottomscanner's ignore list, not even worth looking for vendor profits on these items, and certainly not worth resale risk in my opinion. Tweak the code if you like (And recontribute it here!?)
Iprice 11:04, 7 May 2007 (EDT)