-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauto-steam-discovery-queue.user.js
More file actions
42 lines (32 loc) · 1.23 KB
/
Copy pathauto-steam-discovery-queue.user.js
File metadata and controls
42 lines (32 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// ==UserScript==
// @name Auto Discovery Queue
// @namespace https://github.com/denniskupec
// @version 0.1
// @description Auto run through the discovery queue for Steam Summer Sale 2016 trading cards
// @author Dennis Kupec
// @match *://store.steampowered.com/app/*
// @match *://store.steampowered.com/explore/*
// @run-at document-end
// @grant document.querySelector
// @grant location.reload
// ==/UserScript==
(function() {
'use strict';
// TODO: bypass age verification screens
var error = document.querySelector('body > div:nth-child(2) > p:nth-child(10)');
var btn_next = document.querySelector('div.btn_next_in_queue');
var btn_newqueue = document.querySelector('#refresh_queue_btn');
if(btn_newqueue !== null) {
if(document.querySelector('div.discovery_queue_winter_sale_cards_header > div.subtext').innerText == 'Come back tomorrow to earn more cards by browsing your Discovery Queue!') {
return;
}
btn_newqueue.click();
}
if(error !== null) {
console.log('Steam returned an error: ' + error.innerText + ' - retrying in 30 seconds.');
setTimeout(location.reload, 30*1000);
}
if(btn_next !== null) {
btn_next.click();
}
})();