Steam, Badge Creator Automate

This script automatically craft badge if you have enough cards

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         Steam, Badge Creator Automate
// @namespace    http://tampermonkey.net/
// @version      0.21
// @description  This script automatically craft badge if you have enough cards
// @author       You
// @match        https://steamcommunity.com/id/*/badges/*
// @match        https://steamcommunity.com/id/*/gamecards/*/
// @grant        none
// @runat        document-end
// @nowrap
// ==/UserScript==

(function() {
    'use strict';
    var blacklist = [1343890];
    var craftTimeout = 1500;
    var searchTimeout = 1500;

    jQuery(function () {
        setTimeout(function () {
            var $craft = jQuery(".badge_craft_button").filter(function (index, element) {
                for (var i = 0; i < blacklist.length; i++) {
                    if ((element.href || element.onclick || "").toString().indexOf(blacklist[i]) >= 0) return false;
                }
                return true;
            });

            if ($craft.length > 0) {
                var button = Array.prototype.pop.call($craft).click();

                if (location.pathname.indexOf("/gamecards/") >= 0) {
                    setTimeout(function () {
                        jQuery(".profile_small_header_location").first().click();
                    }, craftTimeout);
                }
            }

        }, searchTimeout);
    });
})();