Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function(){
- if( location.hostname !== 'store.steampowered.com' ){
- alert( 'Run this code on the Steam Store!' );
- return;
- }else if( typeof jQuery !== 'function' ){
- ShowAlertDialog( 'Fail', 'This page has no jQuery, try homepage.' );
- return;
- }else if( document.getElementById( 'header_notification_area' ) === null ){
- ShowAlertDialog( 'Fail', 'You have to be logged in.' );
- return;
- }
- var pkgstart = 0,
- pkgend = 5000,
- loaded = 0,
- total = pkgend - pkgstart,
- modal = ShowBlockingWaitDialog( 'Executing...', 'Please wait until all requests finish.' );
- for( var i = pkgstart; i <= pkgend; i++ ){
- jQuery.post(
- '//store.steampowered.com/checkout/addfreelicense',
- {
- action: 'add_to_cart',
- sessionid: g_sessionID,
- subid: i
- },
- function( data )
- {
- loaded++;
- modal.Dismiss();
- if( loaded === total ){
- ShowAlertDialog( 'All done!', 'Enjoy.' );
- }else{
- modal = ShowBlockingWaitDialog( 'Executing...', 'Added license ' + loaded + pkgstart + '/' + pkgend );
- }
- }
- );
- }
- }());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement