Not signed in (Sign In)
    • CommentAuthorbunnyfufu
    • CommentTimeDec 3rd 2007 edited
     
    I can't get norganna.org/up to work. Did I miss the memo?
    Thanks, RockSlice, for making mention of the API call to query factions and realms other than the one currently being used. Thanks to MentalPower for coding the AucClassic/AucUtil and to Norganna for coding EvalResale I've so blatantly swiped and (in advance) to Dinesh for suggesting a Jira issue (please refer to my adv-114 comment for the low-down).

    I feel damn silly for posting this. My original code, aside from comments and eliding, amounts to all of one line:
    market, seen = AucAdvanced.API.GetMarketValue(item.link, opposingKey)
    And *poof* a new Evaluator. It's so easy to make a new evaluator, and yet I've seen hardly anything. Fine. I'll be the one-line fool who boldly steps out to say "Yes, norgs et al have done such an outstanding job that it really is this simple to extend Auctioneer." I'm hoping that many more will soon follow suit....

    About my one-line marvel: It needs much love in the way of usability, but (with repeated runs with tweaked settings), it really and truly shows auctions that provide tremendous opportunities for arbitrage. I'm up eleventy-two gold already. =)

    Because I can't figure out what I'm doing wrong with norgana.org/up or pastey.net, code snippage:
    -- If auctioneer is not loaded, then we cannot run.
    if not (AucAdvanced) then return end

    local libName = "Arbitrage"
    local lcName = libName:lower()
    local lib = { name = lcName, propername = libName }
    table.insert(BtmScan.evaluators, lcName)
    local define = BtmScan.Settings.SetDefault
    local get = BtmScan.Settings.GetSetting
    local set = BtmScan.Settings.SetSetting

    --{{
    -- Obtain the current faction's opposing faction's auction signature
    -- Copied from Auctioneer/AucUtil.lua -- junk this once the opposing
    -- faction functionality is implemented in Auc-Advanced/CoreUtil.lua
    local serverName = GetCVar("realmName");
    local factionGroup = UnitFactionGroup("player");
    if (factionGroup == "Alliance") then opposing="Horde"; else opposing="Alliance"; end
    local opposingKey = serverName.."-"..opposing
    --}}

    BtmScan.evaluators[lcName] = lib

    --{{ --yanked from EvalResale I belive--
    function lib:valuate(item, tooltip)
    local price = 0

    -- If we're not enabled, scadaddle!
    if (not get(lcName..".enable")) then return end

    -- If this item is not good enough, forget about it.
    if (get(lcName..".quality.check")) then
    if (item.qual < get(lcName..".quality.min")) then
    item:info("Abort: Quality < min")
    return
    end
    end

    -- Valuate this item
    if (AucAdvanced) then
    market, seen = AucAdvanced.API.GetMarketValue(item.link, opposingKey)
    end

    -- If we don't know what it's worth, then there's not much we can do
    if not market then return end

    market = market * item.count
    item:info("Market price", market)

    -- Check to see if it meets the min seen count (if applicable)
    if (get(lcName..".seen.check")) then
    if (not seen or seen < get(lcName..".seen.mincount")) then
    item:info("Abort: Seen < min")
    return
    end
    end

    -- Adjust for brokerage / deposit costs
    local adjusted = market
    local deposit = get(lcName..'.adjust.deposit')
    local brokerage = get(lcName..'.adjust.brokerage')

    if (deposit or brokerage) then
    local basis = get(lcName..'.adjust.basis')
    local brokerRate, depositRate = 0.05, 0.05
    if (basis == "neutral") then
    brokerRate, depositRate = 0.15, 0.25
    end
    if (deposit) then
    local relistings = get(lcName..'.adjust.listings')
    local amount = (BtmScan.GetDepositCost(item.id, item.count, depositRate) * relistings)
    adjusted = adjusted - amount
    item:info(" - "..relistings.." x deposit", amount)
    end
    if (brokerage) then
    local amount = (market * brokerRate)
    adjusted = adjusted - amount
    item:info(" - Brokerage", amount)
    end
    item:info(" = Adjusted amount", adjusted)
    end

    -- Valuate this item
    local pct = get(lcName..".profit.pct")
    local min = get(lcName..".profit.min")
    local value, mkdown = BtmScan.Markdown(adjusted, pct, min)
    item:info((" - %d%% / %s markdown"):format(pct,BtmScan.GSC(min, true)), mkdown)

    -- Check for tooltip evaluation
    if (tooltip) then
    item.what = self.name
    item.valuation = value
    if (item.bid == 0) then
    return
    end
    end

    -- If the current purchase price is more than our valuation,
    -- another module "wins" this purchase.
    if (value < item.purchase) then return end

    -- Check to see what the most we can pay for this item is.
    if (item.canbuy and get(lcName..".allow.buy") and item.buy < value) then
    price = item.buy
    elseif (item.canbid and get(lcName..".allow.bid") and item.bid < value) then
    price = item.bid
    end

    -- Check our projected profit level
    local profit = 0
    if price > 0 then profit = value - price end

    -- If what we are willing to pay for this item beats what
    -- other modules are willing to pay, and we can make more
    -- profit, then we "win".
    if (price >= item.purchase and profit > item.profit) then
    item.purchase = price
    item.reason = self.name
    item.what = self.name
    item.profit = profit
    item.valuation = market
    end
    end
    --}}

    local qualityTable = {
    {0, ITEM_QUALITY0_DESC},
    {1, ITEM_QUALITY1_DESC},
    {2, ITEM_QUALITY2_DESC},
    {3, ITEM_QUALITY3_DESC},
    {4, ITEM_QUALITY4_DESC},
    {5, ITEM_QUALITY5_DESC},
    {6, ITEM_QUALITY6_DESC},
    }
    local ahList = {
    {'faction', "Faction AH Fees"},
    {'neutral', "Neutral AH Fees"},
    }

    define(lcName..'.enable', true)
    define(lcName..'.profit.min', 3000)
    define(lcName..'.profit.pct', 30)
    define(lcName..'.auct.usehsp', false)
    define(lcName..'.quality.check', true)
    define(lcName..'.quality.min', 1)
    define(lcName..'.adjust.basis', "faction")
    define(lcName..'.adjust.brokerage', true)
    define(lcName..'.adjust.listings', 1)
    define(lcName..'.seen.check', false)
    define(lcName..'.seen.mincount', 10)
    define(lcName..'.allow.bid', true)
    define(lcName..'.allow.buy', true)
    --{{
    function lib:setup(gui)
    id = gui:AddTab(libName)
    gui:AddControl(id, "Subhead", 0, libName.." Settings")
    gui:AddControl(id, "Checkbox", 0, 1, lcName..".enable", "Enable purchasing for "..lcName)
    gui:AddControl(id, "Checkbox", 0, 2, lcName..".allow.buy", "Allow buyout on items")
    gui:AddControl(id, "Checkbox", 0, 2, lcName..".allow.bid", "Allow bid on items")
    gui:AddControl(id, "MoneyFramePinned", 0, 1, lcName..".profit.min", 1, 99999999, "Minimum Profit")
    gui:AddControl(id, "WideSlider", 0, 1, lcName..".profit.pct", 1, 100, 0.5, "Minimum Discount: %0.01f%%")
    gui:AddControl(id, "Checkbox", 0, 1, lcName..".quality.check", "Enable quality checking:")
    gui:AddControl(id, "Selectbox", 0, 2, qualityTable, lcName..".quality.min", "Minimum item quality")
    gui:AddControl(id, "Checkbox", 0, 1, lcName..".seen.check", "Enable checking \"seen\" count:")
    gui:AddControl(id, "WideSlider", 0, 2, lcName..".seen.mincount", 1, 100, 1, "Minimum seen count: %s")
    if Auctioneer and Auctioneer.Statistic and Auctioneer.Statistic.GetUsableMedian then
    if AucAdvanced then
    gui:AddControl(id, "Checkbox", 0, 1, lcName..".auct.usefour", "Prefer Auctioneer 4 prices when avaiable")
    else
    gui:AddControl(id, "Subhead", 0, "Auctioneer options")
    end
    if Auctioneer.Statistic.GetHSP then
    gui:AddControl(id, "Checkbox", 0, 2, lcName..".auct.usehsp", "Prefer HSP instead of Median")
    end
    end
    gui:AddControl(id, "Subhead", 0, "Fees adjustment")
    gui:AddControl(id, "Selectbox", 0, 1, ahList, lcName..".adjust.basis", "Deposit/fees basis")
    gui:AddControl(id, "Checkbox", 0, 1, lcName..".adjust.brokerage", "Subtract auction fees from projected profit")
    gui:AddControl(id, "Checkbox", 0, 1, lcName..".adjust.deposit", "Subtract deposit cost from projected profit")
    gui:AddControl(id, "WideSlider", 0, 2, lcName..".adjust.listings", 1, 10, 0.1, "Average relistings: %0.1fx")
    end
    --}}

    • CommentAuthorKinesia
    • CommentTimeDec 3rd 2007
     
    Nice work!

    I'll have a play when I get home hopefully. I don't have a 2nd account so have to do my Arbitrage directly through the Neutral AH, but it's still worth it in some cases...

    (You want to use the main auction houses solely because of the size of demand. Not many people look at the neutral AH unless they happen to be in one of the areas in the first place. So if you have to try and sell things in the Neutral AH you either want them to be stuff that people in STV level range will use, or you want to price them so they look like deals to _other_ people doing Arbitrage, who may well buy your stuff and take it to the other AH to resell for you. So you have to be a lot less greedy doing it this way, but if deals are good enough it's still worth it.)
    •  
      CommentAuthordinesh
    • CommentTimeDec 3rd 2007
     
    also, we know that norganna.org/up and pastey are broken. hopefully fixed sometime soon.
    • CommentAuthorbunnyfufu
    • CommentTimeDec 4th 2007
     
    Posted By: dineshalso, we know that norganna.org/up and pastey are broken. hopefully fixed sometime soon.

    Ah, thank you. I thought I was having some weird OpenDNS configuration issues (I was, but they weren't related).
    • CommentAuthorKinesia
    • CommentTimeDec 4th 2007
     
    Sorry, didn't get to play. My main computer died last night and the others won't run WoW...
    Ah well, hopefully I'll be able to fix it myself!
World of Warcraft™ and Blizzard Entertainment™ are trademarks or registered trademarks of Blizzard Entertainment, Inc. in the U.S. and/or other countries.