Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] Black list of items - exchange lock #159

Open
jojoPL1987 opened this issue Jul 21, 2021 · 1 comment
Open

[Suggestion] Black list of items - exchange lock #159

jojoPL1987 opened this issue Jul 21, 2021 · 1 comment

Comments

@jojoPL1987
Copy link

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.

@disanyixing
Copy link

(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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants