Advertisement
talgaby

SteamQueueManager by mcbyte-it

May 3rd, 2016
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.13 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Steam Auto Clicker
  3. // @version 0.3
  4. // @description Click 'Not Interested' automatically for games in specified user tags.
  5. // @author tech_engineer / maestro_it
  6. // @match *://store.steampowered.com/app/*
  7. // @match *://store.steampowered.com/explore/
  8. // @grant GM_getValue
  9. // @grant GM_setValue
  10. // ==/UserScript==
  11. /* jshint -W097 */
  12.  
  13. (function(){
  14. "use strict";
  15.  
  16. // HEY, YOU.... YES YOU.... You NEED to personalize the list of 'unwantedGames', otherwise I will follow what my master have decided...
  17. var unwantedGames = ['Game Development', 'Survival', 'Sports', 'Tower Defense', 'Dating Sim', 'Otome', 'FPS', 'LEGO', 'Software', 'Utilities', 'Dungeon Crawler', 'Hacking', 'Platformer', 'Twin Stick Shooter', '3D Platformer', 'MOBA', 'Simulation', 'Warhammer 40K', 'Choose Your Own Adventure', 'Warhammer 40k', 'Warhammer', 'Flight', 'Rogue-lite', 'Documentary', 'Rogue-like', '4X', 'Racing', 'Massively Multiplayer', 'Zombies', 'Sandbox', 'Bullet Hell', 'Online Co-Op', 'Movie'];
  18.  
  19. var autoSubmit = false; // automatically submit the form after the timeout (next var)
  20. var timeoutToSubmit = 20; // if autosubmit is enabled wait this amount in seconds before clicking next
  21. var showReasons = true; // show the tags next to the not interested button
  22. var showDonate = false; // show donation button on the Explore page
  23.  
  24. /*
  25. // this is coming soon
  26. try {
  27. GM_setValue('GM_UnwantedList', unwantedGames);
  28.  
  29. var retVar = GM_getValue('GM_UnwantedList');
  30. console.log('Returned list size is: ' + retVar.length);
  31. } catch (e) {
  32. console.log('ERROR in GM functions: ' + e);
  33. }
  34. */
  35.  
  36. try {
  37. if ($J("#next_in_queue_form") !== null) {
  38.  
  39. var needToClick = false;
  40. var clickReasons = [];
  41.  
  42. if ($J("div#add_to_wishlist_area_success").is(":hidden")) { // fix the blacklisting of games on wishlist
  43. $J("a.app_tag").each(function () {
  44. var appTag = $J(this).text().trim();
  45. if ($J.inArray(appTag, unwantedGames) > -1) {
  46. //console.log("Game will be marked because of: " + appTag);
  47. clickReasons.push(appTag);
  48. needToClick = true;
  49. }
  50. });
  51.  
  52. if (needToClick) {
  53. console.log("Clicking on the 'Not Interested' Button...");
  54. $J('.queue_control_button.queue_btn_ignore .queue_btn_inactive').click();
  55. if (showReasons) {
  56. $J('.queue_control_button.queue_btn_ignore .queue_btn_inactive').parent().append('<span> ' + clickReasons.join(", ") + "</span>");
  57. }
  58. }
  59. }
  60.  
  61. if (autoSubmit && ($J("div.btn_next_in_queue").length)){
  62. console.log('Adding a timer and setting the interval');
  63. $J('<div id="GM_cancelInterval" class="btn_next_in_queue right" style="width: 25px;margin-right: 0px;background-size: 200% 200%;" title="Click to stop the timer"><div class="next_in_queue_content"><span id="GM_timeoutSubmit" style="position: relative;top: 8px;left: 6px; cursor: hand;" onclick="clearInterval(GM_interval);">' + timeoutToSubmit + '</span></div></div>').insertAfter($J("div.btn_next_in_queue"));
  64. var GM_interval = setInterval(function(){
  65. timeoutToSubmit--;
  66. $J("span#GM_timeoutSubmit").text(timeoutToSubmit);
  67.  
  68. if (timeoutToSubmit == 0) {
  69. clearInterval(GM_interval);
  70. $J('#next_in_queue_form').submit();
  71. }
  72. }, 1000);
  73. $J('div#GM_cancelInterval').on('click', function() {
  74. console.log('Cancelling timer.');
  75. clearInterval(GM_interval);
  76. });
  77. }
  78.  
  79. var allTags = [];
  80. $J("a.app_tag").each(function () {
  81. allTags.push($J(this).text().trim());
  82. });
  83. console.log("List of all tags: " + allTags.join(", "));
  84. };
  85.  
  86. // this part is from https://github.com/mig4ng/SteamQueueBotChristmas2015
  87. if ($J('div.discover_queue_empty_refresh_btn').length) {
  88. if(showDonate){
  89. $J( "<br><div style='border: 3px dashed red; padding: 15px;background: linear-gradient(to bottom right, rgba(255,0,0,0.3), rgba(85,0,0,0.4));'><h3>If you find this script useful, consider sending me a gift (cards, games, items)</h3>"
  90. + "<br><div class='btnv6_lightblue_blue btn_medium'><span onclick='window.open(\"https://steamcommunity.com/tradeoffer/new/?partner=29920075&token=LDURJTLZ\")'>Click to open my 'Trade Offer' page</span></div>"
  91. + "<br><br><h3>Wishing you all a Merry Christmas and a Happy New Year</h3></div>" ).insertAfter( ".discover_queue_empty_refresh_btn" );
  92. }
  93. }
  94.  
  95. } catch(e) {
  96. console.log("Error: " + e);
  97. }
  98. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement