Last active
July 3, 2018 03:35
-
-
Save infowolfe/2bc54f2236dd5c7312aac0f7c53cb2af to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Steam Booster Pack Creator | |
// @namespace infowolfe | |
// @include https://steamcommunity.com/tradingcards/boostercreator/* | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
$("body").on('DOMSubtreeModified', ".booster_creator_left", function() { | |
checkRadio(); | |
}); | |
$("body").one('DOMSubtreeModified', ".newmodal", function() { | |
setTimeout(function() { unpackNow(); }, 1000); | |
setTimeout(function() { closeModal(); }, 1500); | |
}); | |
function checkRadio() { | |
var myRadio = $("input[class=booster_tradability_preference_nottradable]").first(); | |
var makePack = $(".btn_makepack"); | |
var makePackGreen = $(".btn_green_white_innerfade.btn_medium") | |
if (myRadio.is(":visible")) { | |
if (myRadio.is(":checked")) { | |
console.log("already checked") | |
} else { | |
myRadio.prop("checked", true).change(); | |
if (makePack.hasClass(".btn_disabled")) { | |
console.log("something broke") | |
} else { | |
makePack.click(); | |
var unpackClicked = false; | |
} | |
} | |
} | |
if (makePackGreen.is(":visible")) { | |
makePackGreen.click(); | |
} | |
} | |
function unpackNow() { | |
var unpackItNow = $("div.btn_grey_grey.btn_small") | |
unpackItNow.click() | |
console.log("sent click to unpackItNow") | |
} | |
function closeModal() { | |
var modalClose = $("div.newmodal_close") | |
modalClose.click() | |
console.log("closed modal") | |
} | |
// Hide ".unavailable" | |
$("body").ready( function() { | |
$("#booster_game_selector option[class='unavailable']").remove(); | |
console.log("removed unavailable") | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment