Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function()
- {
- if( location.href.match( /^https:\/\/store\.steampowered\.com\/account\/?$/ ) === null )
- {
- alert( 'Please run this on Steam\'s account page details: https://store.steampowered.com/account/''.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. Original snippet from http://steamdb.info/freepackages/<br /><br />Modified by /id/NCPereira' );
- }
- else
- {
- modal = ShowBlockingWaitDialog( 'Executing...', 'Loaded ' + loaded + '/' + total + '. Ignore all the errors, let it finish.' );
- i++;
- ExecuteRequest();
- }
- }
- );
- };
- setTimeout( ExecuteRequest, 1500 );
- }());
Add Comment
Please, Sign In to add comment