Nuklon / Steam-Economy-Enhancer

Enhances the Steam Inventory and Steam Market.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Suggestion] Black list of items - exchange lock

jojoPL1987 opened this issue · comments

You can add a filter:
ID and/or game title + item type (normal card, foil, emoticon, background, etc.)
which would block the addition of such items to the swap window by the "Select all from page" function.

I have several Steam accounts for which I earn badges thanks to free cards. From many games, I already have the maximum badge level on my main account, so I earn them badges on other accounts.
If my bots drop cards from new games, I have to manually select the titles from which I can send the cards to my main account (in order not to accidentally send cards from a game for which I already have a level 5 badge). With this new feature, I would point out that regular cards from selected games will not be added to the swap window.

(function ($, async) {
    $.noConflict(true);

    var NotTradeRegularCard  = {
        1: {//account1
            218410: true,
            619390: true,
            1186460: true,
            399120: true,
        },
        2: {//account2
            766280: true,
            548840: true,
        },
    }
    ……
})(jQuery, async);
$('.select_all').on('click', '*', function () {
    $('.inventory_ctn:visible > .inventory_page:visible > .itemHolder:visible').delayedEach(25, function (i, it) {
        var item = it.rgItem;
        if (item.is_stackable) return;

        if (!item.tradable) return;

        let str = item.market_hash_name;
        let index = str.indexOf('-');
        let gameid = str.slice(0, index);
        let result = {};
        let flag = 0;
        for (let key in NotTradeRegularCard) {
            result[key] = {};
            for (let subKey in NotTradeRegularCard[key]) {
                if (subKey == gameid) {
                    flag = 1;
                }
            }
        }
        if (flag == 1&&getIsTradingCard(item)&&!getIsFoilTradingCard(item)) {
            console.log('Do not trade ' + gameid + ' regular card.');
            return;
        }else{
            unsafeWindow.MoveItemToTrade(it);
        }
    });
});

The above code will not trade regular cards with game ID 218410,619390,1186460,399120,766280,548840, but the foil cards will be traded.