Advertisement
Guest User

steam free license adder looper

a guest
Aug 16th, 2014
1,927
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function(){
  2.     if( location.hostname !== 'store.steampowered.com' ){
  3.         alert( 'Run this code on the Steam Store!' );
  4.         return;
  5.     }else if( typeof jQuery !== 'function' ){
  6.         ShowAlertDialog( 'Fail', 'This page has no jQuery, try homepage.' );
  7.         return;
  8.     }else if( document.getElementById( 'header_notification_area' ) === null ){
  9.         ShowAlertDialog( 'Fail', 'You have to be logged in.' );
  10.         return;
  11.     }
  12.    
  13.     var pkgstart = 0,
  14.         pkgend = 5000,
  15.         loaded = 0,
  16.         total = pkgend - pkgstart,
  17.         modal = ShowBlockingWaitDialog( 'Executing...', 'Please wait until all requests finish.' );
  18.    
  19.     for( var i = pkgstart; i <= pkgend; i++ ){
  20.         jQuery.post(
  21.             '//store.steampowered.com/checkout/addfreelicense',
  22.             {
  23.                 action: 'add_to_cart',
  24.                 sessionid: g_sessionID,
  25.                 subid: i
  26.             },
  27.             function( data )
  28.             {
  29.                 loaded++;
  30.                 modal.Dismiss();
  31.                 if( loaded === total ){
  32.                     ShowAlertDialog( 'All done!', 'Enjoy.' );
  33.                 }else{
  34.                     modal = ShowBlockingWaitDialog( 'Executing...', 'Added license ' + loaded + pkgstart + '/' + pkgend );
  35.                 }
  36.             }
  37.         );
  38.     }
  39. }());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement