Skip to content

Instantly share code, notes, and snippets.

@retvil
Created August 16, 2014 08:08
Show Gist options
  • Save retvil/11cb9fd557cca9ba9aa2 to your computer and use it in GitHub Desktop.
Save retvil/11cb9fd557cca9ba9aa2 to your computer and use it in GitHub Desktop.
[IOC] Free Steam (Add Script)
(function()
{
if( location.hostname !== 'store.steampowered.com' )
{
alert( 'Run this code on the Steam Store!' );
return;
}
else if( typeof jQuery !== 'function' )
{
ShowAlertDialog( '[IOC] Fail', 'This page has no jQuery, try homepage.' );
return;
}
else if( document.getElementById( 'header_notification_area' ) === null )
{
ShowAlertDialog( '[IOC] Fail', 'You have to be logged in.' );
return;
}
var freePackages = [];
var i = 0,
loaded = 0,
total = freePackages.length,
modal = ShowBlockingWaitDialog( '[IOC] Executing...', 'Please wait until all requests finish.' );
function addfreelicense()
{
jQuery.post(
'//store.steampowered.com/checkout/addfreelicense',
{
action: 'add_to_cart',
sessionid: g_sessionID,
subid: freePackages[ i ]
},
function( data )
{
}
).always(function ()
{
i++;
loaded++;
modal.Dismiss();
if( loaded === total )
{
ShowAlertDialog( 'GMF User All Done!', 'Nod33Eset for ..::GAMEINATOR::..' );
}
else
{
modal = ShowBlockingWaitDialog( '[IOC] Executing...', 'Loaded ' + loaded + '/' + total );
}
if (i < total)
addfreelicense();
});
}
addfreelicense();
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment