Steam, Badge Creator Automate

This script automatically craft badge if you have enough cards

  1. // ==UserScript==
  2. // @name Steam, Badge Creator Automate
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.21
  5. // @description This script automatically craft badge if you have enough cards
  6. // @author You
  7. // @match https://steamcommunity.com/id/*/badges/*
  8. // @match https://steamcommunity.com/id/*/gamecards/*/
  9. // @grant none
  10. // @runat document-end
  11. // @nowrap
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16. var blacklist = [1343890];
  17. var craftTimeout = 1500;
  18. var searchTimeout = 1500;
  19.  
  20. jQuery(function () {
  21. setTimeout(function () {
  22. var $craft = jQuery(".badge_craft_button").filter(function (index, element) {
  23. for (var i = 0; i < blacklist.length; i++) {
  24. if ((element.href || element.onclick || "").toString().indexOf(blacklist[i]) >= 0) return false;
  25. }
  26. return true;
  27. });
  28.  
  29. if ($craft.length > 0) {
  30. var button = Array.prototype.pop.call($craft).click();
  31.  
  32. if (location.pathname.indexOf("/gamecards/") >= 0) {
  33. setTimeout(function () {
  34. jQuery(".profile_small_header_location").first().click();
  35. }, craftTimeout);
  36. }
  37. }
  38.  
  39. }, searchTimeout);
  40. });
  41. })();