Advertisement
Guest User

Enchanted f2p Remover

a guest
Aug 17th, 2014
1,168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.    
  2.  
  3.     (function () {
  4.             var NUKE_REGEX = /\b(?:trailer|teaser|Free|Online|Peggle|Coil|Mightier|Cubic|PlanetSide|The Banner Saga|Trial|F2P|Moonbase Alpha|RIFT|Blacklight|The Cat and the Coup|Gear Up|Ragnarok|Smashmuck Champions|Age of Conan|Ascend|iPi Mocap Studio 2|RaiderZ|iPi Recorder 2|Renaissance Heroes|Bounty|Forge|Cry of Fear|Dragons Prophet|SolForge|Driver Fusion|Toribash|Marvel Puzzle Quest|Solstice Arena|Soldier Front 2|Elsword|Only if|Ohm Studio|8BitMMO|The Plan|Battle Nations|GunZ|Dragons Prophet|World of Guns|Fistful of Frags|Cannons Lasers Rockets|City of Steam|Dethroned|Subnautica Terrain Test|Conquest of Champions|Serena|You Have to Win the Game|Evolution RTS|HAWKEN|Rise of Incarnates Beta|Thinking with Time Machine|Marvel Heroes|March of War|CRYENGINE|Tom Clancys Ghost Recon Phantoms|World of Guns|Dragon Nest Europe|Dungeonland|Mabinogi|Loadout|RaceRoom Racing Experience|Rusty Hearts|Forsaken World|Dragon Nest|Stronghold Kingdoms|Bloodline Champions|Americas Army 3|Global Agenda|Tribes|CrimeCraft GangWars|Spiral Knights|Puzzle Pirates|Alliance of Valiant Arms|Super Monday Night Combat|Tactical Intervention|Battlezone|MicroVolts Surge|Neverwinter|APB Reloaded|Fallen Earth|Realm of the Mad God|EverQuest II|Americas Army|Archeblade|Moon Breakers|War of the Immortals|Star Conflict|Vindictus|Combat Arms|Atlantica|C9|Super Crate Box|Dungeon Party|Frontline Tactics|Football Superstars|Champions of Regnum|RIDGE RACER|Warframe|March of War|War Thunder|Shadow Warrior Classic|Pinball Arcade|Path of Exile|Panzar|Tom Clancys Ghost Recon Phantoms - NA|Dragons and Titans|Nosgoth Base Game Default Package|Pandora Saga|Brawl Busters|World of Battles|The Gathering|PoxNora|Bullet Run|Arctic Combat|District 187|ProtoGalaxy|Battle Islands|The Expendabros|GAR Default store package|Floating Point|La Tale|Dark Blood|Velvet Sundown|Grand Chase|Saints Row|The Forgotten Ones|Face of Mankind|Xam|Heroes|Robocraft|Sunrider|Unturned|NEOTOKYO|Aura Kingdom|Warface|Reversion|Cakewalk Loop Manager|EVGA Precision X|Amazing World|Saira|Royal Quest|Firefall|demo|cinematic|pegi|esrb)\b/i;
  5.      
  6.             var PACKAGE_ID_REGEX = /javascript:\s*RemoveFreeLicense\s*\(\s*(\d+)/;
  7.             var REMOVE_LICENSE_API = "/account/removelicense";
  8.             var RUN_ON_PAGE = "https://store.steampowered.com/account/";
  9.      
  10.             if (location.href !== RUN_ON_PAGE) {
  11.                     if (confirm("You're not on your licenses page, dummy. Go there now?")) {
  12.                             location.assign(RUN_ON_PAGE);
  13.                     }
  14.                     return;
  15.             }
  16.      
  17.             var idsToRemove = [];
  18.      
  19.             var rows;
  20.             var licensesTable = document.getElementById("licenses");
  21.             var packageId;
  22.      
  23.             if (licensesTable && window.g_sessionID) {
  24.                     licensesTable = licensesTable.getElementsByClassName("account_table")[0];
  25.                     rows = licensesTable.rows;
  26.      
  27.                     for (var i = 0, l = rows.length; i < l; i++) {
  28.                             if (NUKE_REGEX.test(rows[i].cells[0].textContent)) {
  29.                                     packageId = PACKAGE_ID_REGEX.exec(rows[i].cells[1].innerHTML);
  30.      
  31.                                     if (packageId !== null) {
  32.                                             idsToRemove.push(packageId[1]);
  33.                                     }
  34.                             }
  35.                     }
  36.      
  37.                     function removePackageAndQueueNext(packages, index) {
  38.                             if (index >= packages.length) {
  39.                                     console.log("Packages removed.");
  40.                                     return; // done
  41.                             }
  42.      
  43.                             var parameters = "?sessionid=" + encodeURIComponent(g_sessionID) + "&packageid=" + encodeURIComponent(packages[index]);
  44.      
  45.                             var xhr = new XMLHttpRequest();
  46.                             xhr.open("HEAD", REMOVE_LICENSE_API + parameters, true);
  47.                             xhr.onreadystatechange = function () {
  48.                                     if (this.readyState === 4) {
  49.                                             console.log("Removed package %d/%d", index + 1, packages.length);
  50.                                             removePackageAndQueueNext(packages, index + 1);
  51.                                     }
  52.                             };
  53.                             xhr.send();
  54.                     }
  55.      
  56.                     // Kick off the first request
  57.                     if (idsToRemove.length > 0) {
  58.                             removePackageAndQueueNext(idsToRemove, 0);
  59.                     }
  60.             }
  61.     })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement