Script for adding free Steam content to your account - can it be reversed?

edited July 2016 in General Chat
On the SteamDB website, you'll find a script which you can inject in your browser using console (F12 for Firefox). That script will add almost everything free on Steam - all DLC's for the games you have, all free games, all demos, everything. It's legal, don't worry.

I tried it, and every single F2P game license is now on my account. However, I don't really like clutter, and although I got some random DLC's which I didn't know existed, I can't click "Remove" more than 2000 times... It would take a lot of time.

I was wondering if somebody could change the code a bit and reverse the effect: to remove every "removable game" from your account. It would be useful to everyone who tried a lot of free games but just wants them gone and clean up a bit. You can find it in the link above, but I'll paste it here too. The numbers 1947 and 80227 are the game ID's:

(function()
{
if( location.href.match( /^https:\/\/store\.steampowered\.com\/account\/licenses\/?$/ ) === null )
{
alert( 'Please run this on Steam\'s account page details: https://store.steampowered.com/account/licenses/' );

window.location = 'https://store.steampowered.com/account/licenses/';

return;
}

var freePackages =
[
<i>1947,
80227,</i>
];

var ownedPackages = {};

jQuery( '.account_table a' ).each( function( i, el )
{
var match = el.href.match( /javascript:RemoveFreeLicense\( ([0-9]+), '/ );

if( match !== null )
{
ownedPackages[ +match[ 1 ] ] = true;
}
} );

var i = 0,
loaded = 0,
package = 0,
total = freePackages.length,
modal = ShowBlockingWaitDialog( 'Executing...',
'Please wait until all requests finish. Ignore all the errors, let it finish.' );

var ExecuteRequest = function( )
{
while( i < total && ownedPackages[ ( package = freePackages[ i ] ) ] )
{
i++;
loaded++;
}

jQuery.ajax(
{
type: 'POST',
dataType: 'text',
url: '//store.steampowered.com/checkout/addfreelicense',
data:
{
action: 'add_to_cart',
sessionid: g_sessionID,
subid: package
}
}
).always( function( )
{
loaded++;

modal.Dismiss();

if( loaded >= total )
{
ShowAlertDialog( 'All done!', 'Enjoy.' );
}
else
{
modal = ShowBlockingWaitDialog( 'Executing...',
'Loaded ' + loaded + '/' + total + '. Ignore all the errors, let it finish.' );

i++;

ExecuteRequest();
}
}
);
};

setTimeout( ExecuteRequest, 1500 );
}());

Comments

Please Sign in to comment.