Last active
June 28, 2022 07:08
-
-
Save L3n1n/3248f42b6e4fd4500c26f0311443300d to your computer and use it in GitHub Desktop.
Steam Summer Sale Cheat Event Badge 2022
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 Summer Sale Cheat Event Badge 2022 | |
// @namespace https://gist.github.com/L3n1n | |
// @version 0.61 | |
// @description Automatic finding | |
// @author L3n1n | |
// @match *://store.steampowered.com/sale/clorthax_quest* | |
// @updateURL https://gist.githubusercontent.com/L3n1n/3248f42b6e4fd4500c26f0311443300d/raw/SteamSummerSaleCheatEventBadge2022.user.js | |
// @downloadURL https://gist.githubusercontent.com/L3n1n/3248f42b6e4fd4500c26f0311443300d/raw/SteamSummerSaleCheatEventBadge2022.user.js | |
// ==/UserScript== | |
var cfg = document.getElementById("application_config"); | |
var userinfo = JSON.parse(cfg.getAttribute("data-userinfo")); | |
var arr = JSON.parse(cfg.getAttribute("data-doorinfo")); | |
var clan_accountid = 41316928; | |
if ( ! userinfo.logged_in ) return false; | |
var opened = 0; | |
arr.forEach((el) => { | |
if ( el.opened == 1 ) opened++; | |
}); | |
if ( opened == arr.length ) { | |
console.log('Badge already claimed'); | |
return false; | |
} | |
var modal = ShowBlockingWaitDialog("Finding...", "Please wait"); | |
var links = [ | |
"/category/arcade_rhythm/?snr=1_614_615_clorthaxquest_1601", | |
"/category/strategy_cities_settlements/?snr=1_614_615_clorthaxquest_1601", | |
"/category/sports/?snr=1_614_615_clorthaxquest_1601", | |
"/category/simulation/?snr=1_614_615_clorthaxquest_1601", | |
"/category/multiplayer_coop/?snr=1_614_615_clorthaxquest_1601", | |
"/category/casual/?snr=1_614_615_clorthaxquest_1601", | |
"/category/rpg/?snr=1_614_615_clorthaxquest_1601", | |
"/category/horror/?snr=1_614_615_clorthaxquest_1601", | |
"/vr/?snr=1_614_615_clorthaxquest_1601", | |
"/category/strategy/?snr=1_614_615_clorthaxquest_1601", | |
]; | |
doCall(0); | |
function doCall(i){ | |
var exit = false; | |
var max = arr.length - 1; | |
modal.Dismiss(); | |
modal = ShowBlockingWaitDialog("Finding " + i + "/" + max, "Please wait"); | |
if ( arr[i].opened == 1 ) { | |
console.log("door_index " + i + ": already opened"); | |
i++; | |
if ( arr[i] ) { | |
doCall(i); | |
return false; | |
} | |
if ( i == max ) { | |
doExit(modal); | |
return false; | |
} | |
} else { | |
if ( i == 0 || i == max ) { | |
$J.post("/saleaction/ajaxopendoor", { | |
sessionid: g_sessionID, | |
authwgtoken: userinfo.authwgtoken, | |
door_index: i, | |
clan_accountid: clan_accountid | |
}, (res) => { | |
console.log("door_index " + i + ":", res); | |
i++; | |
if ( arr[i] ) { | |
doCall(i); | |
return false; | |
} else { | |
doExit(modal); | |
return false; | |
} | |
}).fail(function() { | |
steamBusy(modal); | |
return false; | |
}); | |
} else { | |
$J.get(links[i-1], function(html){ | |
var capsuleinsert = $J("#application_config", html).data("capsuleinsert"); | |
if ( capsuleinsert ) { | |
$J.post("/saleaction/ajaxopendoor", { | |
"sessionid": g_sessionID, | |
"authwgtoken": userinfo.authwgtoken, | |
"door_index": capsuleinsert.payload, | |
"clan_accountid": clan_accountid, | |
"datarecord": capsuleinsert.datarecord, | |
}, (res) => { | |
console.log("door_index " + i + ":", res); | |
i++; | |
if ( arr[i] ) { | |
doCall(i); | |
return false; | |
} else { | |
doExit(modal); | |
return false; | |
} | |
}).fail(function() { | |
steamBusy(modal); | |
return false; | |
}); | |
} else { | |
steamBusy(modal); | |
return false; | |
} | |
}); | |
} | |
} | |
return false; | |
} | |
function steamBusy(modal){ | |
modal.Dismiss(); | |
ShowAlertDialog("Steam servers are busy", "Try again later"); | |
} | |
function doExit(modal){ | |
modal.Dismiss(); | |
ShowAlertDialog("All done! Reloading page...", "Enjoy."); | |
setTimeout(function(){ | |
window.location.reload(); | |
}, 500); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you!