// ==UserScript== // @name Inventory Tabs Check // @icon https://store.steampowered.com/favicon.ico // @namespace SteamNerds // @version 2.3.1 // @description Highlights missing inventory tabs in Blueberry's guide and adds more stats to the inventory page // @author uniQ // @include /^https:\/\/steamcommunity\.com\/sharedfiles\/filedetails\/\?id\=873140323/ // @include /^https:\/\/steamcommunity\.com\/(id\/\w{1,64}|profiles\/\d{17})\/inventory/ // @updateURL https://raw.githubusercontent.com/steamnerds/userscripts/master/InventoryTabsCheck.user.js // @grant none // ==/UserScript== // https://github.com/steamnerds/userscripts /*jshint esversion: 6 */ function runInventoryTabCheck() { if (!g_steamID) { log('warning', "Inventory Tabs Check: Not logged into Steam"); return; } if ($J('#tabcheck').length > 0) { $J('#tabCheckRefresh').attr('src', 'https://community.akamai.steamstatic.com/public/images/login/throbber.gif'); $J('#tabCheckRefresh').attr('onClick', ''); } var t1 = Date.now(); jQuery.ajax({ type: 'GET', url: "https://steamcommunity.com/groups/InventoryItemCollectors/discussions", success: (r) => { if (r != "") { var r1 = {}; // create a value key pair of name and discussion userList r.replace(/((?!<\/a>).|\n|\t|\r)*<\/a>/gm, (a) => { r1[a.substring(a.indexOf('/">') + 3, a.indexOf('')).replace(/[\t\n\r]/g, '').toLowerCase()] = a.substring(a.indexOf('https://steamcommunity.com/groups/InventoryItemCollectors/discussions/') + 70, a.indexOf('/">')); }); getInventory(r1, t1); } else { log('warning', "There was an error while trying to load the Steam Inventory group"); getInventory({}, t1); } }, error: () => { log('warning', "There was an error while trying to load the Steam Inventory group"); getInventory({}, t1); } }); function getInventory(r1, t1) { jQuery.ajax({ type: 'GET', url: "https://steamcommunity.com/my/inventory/", success: (r) => { if (r != "") { handleResponse(r1, r, t1); } else { log('warning', "There was an error while trying to load your Steam inventory"); } }, error: () => { log('warning', "There was an error while trying to load your Steam inventory"); } }); } function handleResponse(r1, r2, t1) { try { if (r2.includes("g_rgAppContextData") && r2.includes('id="inventory_link_753"')) { var cache = r2.slice(r2.indexOf('g_rgAppContextData') + 21); cache = JSON.parse(cache.slice(0, cache.indexOf(';'))); //read g_rgAppContextData var [owned, av, ab, hid, nTotal, nVisible, nBroken] = [0, 0, 0, 0, 0, 0]; var [unknownApps, misspelledApps] = [ [], [] ]; var [cu, co, ca] = ['#3a3a3a', '#1d1d1d', '#0e141d']; var t2 = Date.now(); for (var i = 0; i < $J('.bb_table_tr').length; i++) { //add new column header if ($J('.bb_table_tr')[i].children[0].classList.contains('bb_table_th')) { if (!$J('.bb_table_tr')[i].children[4]) { //prevent duplication on refresh $J("