Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
⚠ This script has been integrated into SteamDB browser extension!
// ==UserScript==
// @name Steam Queue Auto Discoverer
// @description Discover the Steam queue three times to get the sale cards
// @version 2.3.0
// @namespace https://gist.github.com/xPaw/73f8ae2031b4e528abf7
// @updateURL https://gist.github.com/xPaw/73f8ae2031b4e528abf7/raw/steam_quick_queue.user.js
// @icon https://store.steampowered.com/favicon.ico
// @match https://store.steampowered.com/explore*
// @grant none
// ==/UserScript==
var DiscoveryQueueModal, GenerateQueue = function( queueNumber )
{
if( DiscoveryQueueModal )
{
DiscoveryQueueModal.Dismiss();
}
DiscoveryQueueModal = ShowBlockingWaitDialog( 'Generating the queue...', 'Generating new discovery queue #' + ++queueNumber );
jQuery.post( 'https://store.steampowered.com/explore/generatenewdiscoveryqueue', { sessionid: g_sessionID, queuetype: 0 } ).done( function( data )
{
var requests = [], done = 0, errorShown;
for( var i = 0; i < data.queue.length; i++ )
{
var request = jQuery.post( 'https://store.steampowered.com/app/10', { appid_to_clear_from_queue: data.queue[ i ], sessionid: g_sessionID } );
request.done( function()
{
if( errorShown )
{
return;
}
DiscoveryQueueModal.Dismiss();
DiscoveryQueueModal = ShowBlockingWaitDialog( 'Exploring the queue...', 'Request ' + ++done + ' of ' + data.queue.length );
} );
request.fail( function()
{
if( errorShown )
{
return;
}
errorShown = true;
DiscoveryQueueModal.Dismiss();
DiscoveryQueueModal = ShowBlockingWaitDialog( 'Error', 'Failed to clear queue item #' + ++done + '. Will try again soon.' );
} );
requests.push( request );
}
var callback = function()
{
DiscoveryQueueModal.Dismiss();
if( queueNumber < 3 )
{
GenerateQueue( queueNumber );
}
else
{
DiscoveryQueueModal = ShowConfirmDialog( 'Done', 'Queue has been explored ' + queueNumber + ' times', 'Reload the page' ).done( function() {
ShowBlockingWaitDialog( 'Reloading the page' );
window.location.reload();
});
}
};
jQuery.when.apply( jQuery, requests ).then( callback, callback );
} ).fail( function()
{
setTimeout( () => GenerateQueue( queueNumber - 1 ), 1000 );
DiscoveryQueueModal.Dismiss();
DiscoveryQueueModal = ShowBlockingWaitDialog( 'Error', 'Failed to generate new queue #' + queueNumber + '. Trying again in a second.' );
} );
};
var buttonContainer = document.createElement( 'div' );
buttonContainer.className = 'discovery_queue_customize_ctn';
buttonContainer.innerHTML = '<div class="btnv6_blue_hoverfade btn_medium" id="js-cheat-queue"><span>Cheat the queue</span></div><span>Discover the queue three times to get the sale cards</span>';
var container = document.querySelector( '.discovery_queue_customize_ctn' );
container.parentNode.insertBefore( buttonContainer, container );
var button = document.getElementById( 'js-cheat-queue' );
button.addEventListener( 'click', function( )
{
GenerateQueue( 0 );
container.parentNode.removeChild( buttonContainer );
}, false );
@RichusX

This comment has been minimized.

Copy link

commented Dec 25, 2015

Awesome, cheers!

@ghost

This comment has been minimized.

Copy link

commented Dec 28, 2015

I don't know Jquery yet, but this code is just so clean.

@ghost

This comment has been minimized.

Copy link

commented Dec 28, 2015

@routemasters There's nothing wrong with using this, Steam cannot really differentiate between this and a real user doing it.

@AlejandroC90

This comment has been minimized.

Copy link

commented Dec 29, 2015

Thank you so much, it works perfectly, thank you.

@Pilaba

This comment has been minimized.

Copy link

commented Dec 29, 2015

nice work!!!

@Exodus5467

This comment has been minimized.

Copy link

commented Dec 30, 2015

@AlejandroC90 Mirá donde te vengo a encontrar linceso
Neat Script!

@AlejandroC90

This comment has been minimized.

Copy link

commented Dec 31, 2015

@Exodus5467 jaja, estamos por todo lado

@amberhwang

This comment has been minimized.

Copy link

commented Jan 1, 2016

thanks mate!

@Hlidskialf7

This comment has been minimized.

Copy link

commented Jan 2, 2016

Awesome

@quahansudung

This comment has been minimized.

Copy link

commented Jun 24, 2016

It's working

@hxgdzyuyi

This comment has been minimized.

Copy link

commented Jun 24, 2016

cool 👍

@alpasy

This comment has been minimized.

Copy link

commented Jun 26, 2016

VM1026:5 Uncaught ReferenceError: ShowBlockingWaitDialog is not defined(…)
in Chrome for me :-\

upd. my bad, should've run the script on top of all the browser extensions. working fine now, thanks!

@Kovah

This comment has been minimized.

Copy link

commented Jun 26, 2016

Thanks @alpasy for the tip! 👍

@aveao

This comment has been minimized.

Copy link

commented Jun 26, 2016

Nice edit @xPaw!

@nunocunha

This comment has been minimized.

Copy link

commented Jun 28, 2016

I've created a UserScript wrapper for this script. It automagically updates whenever @xPaw updates this gist.

@Pilaba

This comment has been minimized.

Copy link

commented Jun 30, 2016

you are awesome m8

@alpasy

This comment has been minimized.

Copy link

commented Dec 23, 2016

doesn't work this time?

Uncaught TypeError: Cannot read property 'parentNode' of null
at :76:10

@longlyduc

This comment has been minimized.

Copy link

commented Jun 23, 2017

still work like a charm, thankyou :)

@mig0sd

This comment has been minimized.

Copy link

commented Jun 23, 2017

Is there a way to install into tampermonkey without manually inserting (pasting) the JS into TM? Usually going to the raw link works.

@aveao

This comment has been minimized.

Copy link

commented Jun 24, 2017

@mig0sd (and @xPaw) it'd automatically install if the extension was .user.js and not .js

@user

This comment has been minimized.

Copy link

commented Dec 21, 2017

Thanks! 👍

@Enissay

This comment has been minimized.

Copy link

commented Dec 21, 2017

Seems not to work in FF. Clicking on the button does nothing.
It works fine in chrome though :-/

@chucky515

This comment has been minimized.

Copy link

commented Dec 23, 2017

nice.... thx!!!

@MatyiFKBT

This comment has been minimized.

Copy link

commented Dec 24, 2017

thanks a lot! works perfectly

@errorproxy

This comment has been minimized.

Copy link

commented Dec 31, 2017

How do I make this run on a page automatically?

@testman42

This comment has been minimized.

Copy link

commented Jun 21, 2018

Doesn't seem to be working any more.

@fuomag9

This comment has been minimized.

Copy link

commented Jun 21, 2018

For me it doesn't work, even tried with a clean browser (Chrome and Firefox)

@BrunoKrugel

This comment has been minimized.

Copy link

commented Jun 22, 2018

still working for me

@wankio

This comment has been minimized.

Copy link

commented Jun 22, 2018

not working :((((((((((((((( tampermonkey/greasemonkey

@wankio

This comment has been minimized.

Copy link

commented Jun 22, 2018

@paolareyes

This comment has been minimized.

Copy link

commented Jun 29, 2018

Still working for me, gg

@hill123455

This comment has been minimized.

Copy link

commented Dec 21, 2018

Ya still working, <3

@defaltadmin

This comment has been minimized.

Copy link

commented Dec 23, 2018

Great code! Is it possible to include a line at the top that shows instructions? I'm not familiar with coding so it took me a while to piece together the information from comments from here and reddit. Just 3 lines of instructions such as

  1. Be on the Explore page in browser
  2. Press Ctrl + Shift + J
  3. Paste this code and hit enter
  4. The button "Start queue" will change to "Cheat queue". Click it.

That's all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.