@Exselex

Где ошибка в коде? Почему не удаляет бесплатную лицензию в Steam?

(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 freePackages =
[
20075
];

var loaded = 0,
total = freePackages.length,
modal = ShowBlockingWaitDialog( 'Executing...', 'Please wait until all requests finish.' );

for( var i = 0; i < total; i++ )
{
jQuery.post(
'//store.steampowered.com/account/removelicense',
{
action: 'RemoveFreeLicense',
sessionid: g_sessionID,
subid: freePackages[ i ]
},
function( data )
{
loaded++;

modal.Dismiss();

if( loaded === total )
{
ShowAlertDialog( 'All done!', 'Enjoy.' );
}
else
{
modal = ShowBlockingWaitDialog( 'Executing...', 'Loaded ' + loaded + '/' + total );
}
}
).fail(function(){
loaded++;

modal.Dismiss();

if( loaded === total )
{
ShowAlertDialog( 'All done!', 'Enjoy.' );
}
else
{
modal = ShowBlockingWaitDialog( 'Executing...', 'Loaded ' + loaded + '/' + total );
}
});
}
}());
  • Вопрос задан
  • 335 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы