arkayenro / arkinventory

A World of Warcraft Inventory mod for Retail, Burning Crusade, and Classic
107 stars 14 forks source link

Suggestion: Auctioneer Advanced Appraiser Rule functions #286

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I would like to have my bank toons (guild and personal) have their bags
sort into the different Auctioneer appraiser suggestions.  For instance:
Vendor, Convert, Disenchant/Mill/Prospect, Auction, and then I would like
to set up a custom rule for things to keep entirely.  

Original issue reported on code.google.com by Darwinia...@gmail.com on 2 Nov 2009 at 10:10

GoogleCodeExporter commented 9 years ago
Couldn't find a way to set this as not a "defect".  It's an "enhancement"

Original comment by Darwinia...@gmail.com on 2 Nov 2009 at 10:11

GoogleCodeExporter commented 9 years ago

Original comment by arkaye...@gmail.com on 3 Nov 2009 at 1:37

GoogleCodeExporter commented 9 years ago
I would also like this functionality added.

Original comment by slickwal...@gmail.com on 4 Jun 2010 at 4:31

GoogleCodeExporter commented 9 years ago
I have this in my local copy.

Add the following to Rule.Environment in ArkInventoryRules.lua:
    suggest = Rule.Execute.itemsuggest,

And add the following function:
function Rule.Execute.itemsuggest( ... )

    if not Rule.Item.h or Rule.Item.class ~= "item" then
        return false
    end

    if not IsAddOnLoaded( "Auc-Advanced" ) or not (AucAdvanced and AucAdvanced.Modules and AucAdvanced.Modules.Util and AucAdvanced.Modules.Util.ItemSuggest) then
        return false
    end

    local fn = "itemsuggest"

    local ac = select( '#', ... )

    if ac == 0 then
        error( string.format( ArkInventory.Localise["RULE_FAILED_ARGUMENT_NONE_SPECIFIED"], fn ), 0 )
    end

    local e = string.lower( AucAdvanced.Modules.Util.ItemSuggest.itemsuggest( Rule.Item.h ) or "" )

    if e ~= "" then

        for ax = 1, ac do

            local arg = select( ax, ... )

            if not arg then
                error( string.format( ArkInventory.Localise["RULE_FAILED_ARGUMENT_IS_NIL"], fn, ax ), 0 )
            end

            if type( arg ) ~= "string" then
                error( string.format( ArkInventory.Localise["RULE_FAILED_ARGUMENT_IS_INVALID"], fn, ax, ArkInventory.Localise["STRING"] ), 0 )
            end

            if e == string.lower ( strtrim( arg ) ) then
                return true
            end
        end

    end

end

Original comment by pzbo...@gmail.com on 29 Jun 2010 at 1:05

GoogleCodeExporter commented 9 years ago
currently ripping the rules out to a separate mod so that you can 
create/share/add your own rule functions whenever you want.  seems to be 
working ok so far.

Original comment by arkaye...@gmail.com on 7 Jul 2010 at 2:20

GoogleCodeExporter commented 9 years ago
Did this ever go through?

Original comment by volectri...@gmail.com on 9 Feb 2013 at 9:48