Skip to content

Instantly share code, notes, and snippets.

@liuguangw
Created June 11, 2018 02:47
Show Gist options
  • Save liuguangw/e7a54afdb8d710c21191e15f45710142 to your computer and use it in GitHub Desktop.
Save liuguangw/e7a54afdb8d710c21191e15f45710142 to your computer and use it in GitHub Desktop.
steam领取锁区游戏代码
(function()
{
if( location.href.match( /^https:\/\/store\.steampowered\.com\/account\/licenses\/?$/ ) === null )
{
alert( '请在Steam帐号明细页面运行这些代码: https://store.steampowered.com/account/licenses/' );
window.location = 'https://store.steampowered.com/account/licenses/';
return;
}
var freePackages =
[
/*游戏id*/
276911,
];
var ownedPackages = {};
jQuery( '.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( '努力执行中...',
'请耐心等待,如果有错误请无视,请耐心等待脚本加载完毕' );
for( ; i < total; i++ )
{
package = freePackages[ i ];
if( ownedPackages[ package ] )
{
loaded++;
continue;
}
jQuery.post(
'//store.steampowered.com/checkout/addfreelicense',
{
action: 'add_to_cart',
sessionid: g_sessionID,
subid: package
}
).always( function( )
{
loaded++;
modal.Dismiss();
if( loaded >= total )
{
location.reload();
}
else
{
modal = ShowBlockingWaitDialog( '执行中...',
'加载至 <b>' + loaded + '</b>/' + total + '.' );
}
}
);
}
}());
@Mobiacikaka
Copy link

这东西应该用不了了吧

@liuguangw
Copy link
Author

是的,已经失效了。

@Mobiacikaka
Copy link

还有其它办法吗,搜了几个脚本都用不了了,在linux上也没办法用加速器

@liuguangw
Copy link
Author

很久没研究这个了,我也不清楚,也许 keylol 上面有办法吧。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment