Advertisement
TUSK3N

Untitled

Jun 26th, 2017
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Auto Steam Discovery Queue
  3. // @namespace http://steamcommunity.com/id/zetx/
  4. // @description Go to next game queued as soon as page is done loading.
  5. // @include http://store.steampowered.com/app/*
  6. // @include http://store.steampowered.com/explore/*
  7. // @include http://store.steampowered.com/agecheck/app/*
  8. // @run-at document-end
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. // I basically pulled this from http://stackoverflow.com/a/13734859
  13.  
  14. function GM_main() {
  15. window.onload = function () {
  16. if ($J('#next_in_queue_form')) {
  17. $J('.queue_sub_text').text("Loading next in queue");
  18. $J('#next_in_queue_form').submit();
  19. }
  20.  
  21. if ($J('#refresh_queue_btn')) {
  22. $("span:contains('Start another queue >>')");
  23.  
  24. $J.post( 'http://store.steampowered.com/explore/generatenewdiscoveryqueue', {
  25. sessionid: g_sessionID,
  26. queuetype: this.m_eQueueType,
  27. }).done( function ( data ) {
  28. window.location = 'http://store.steampowered.com/explore/next';
  29. }).fail( function() {
  30. ShowAlertDialog( 'Start another queue >>', 'There was a problem saving your preferences. Please try again later.' );
  31. } );
  32. }
  33. if($J('#btnv6_blue_hoverfade btn_small')) {
  34. $("span:contains('Enter')");
  35. jQuery('#ageYear').val (1915).trigger ('change');
  36. DoAgeGateSubmit();
  37. }
  38.  
  39. }
  40. }
  41.  
  42. addJS_Node(null, null, GM_main);
  43.  
  44. //-- This is a standard-ish utility function:
  45. function addJS_Node(text, s_URL, funcToRun, runOnLoad) {
  46. var D = document;
  47. var scriptNode = D.createElement ('script');
  48. if (runOnLoad) {
  49. scriptNode.addEventListener ("load", runOnLoad, false);
  50. }
  51. scriptNode.type = "text/javascript";
  52. if (text) scriptNode.textContent = text;
  53. if (s_URL) scriptNode.src = s_URL;
  54. if (funcToRun) scriptNode.textContent = '(' + funcToRun.toString() + ')()';
  55.  
  56. var targ = D.getElementsByTagName ('head')[0] || D.body || D.documentElement;
  57. targ.appendChild (scriptNode);
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement