Go to Norway and see the snow / We are so random, we submit our lives / Who lives at Oxford Street, and shops at H&M
5
   
奖励
收藏
已收藏
取消收藏
下载
"// get userdata from the store
var applist = [];
run_wishlist_redeemer = (account, limit = 1) => {
account.http_request('https://psteamproxy.yuanyoumao.com/dynamicstore/userdata/', {}, (body, response, err) => {
if (!body.rgWishlist.length) {
return account.log('FAILURE | dynamicstore/userdata: ' + 'GET=empty data'.yellow);
}
account.userdata = body;

// add enough items to return to the desired maxium
add_to_wishlist = (i, callback = () => { ; }) => {
if (i == 0) {
return callback();
} else if (applist.length == 0) {
return account.http_request('https://psteamapi.yuanyoumao.com/ISteamApps/GetAppList/v2', {}, (body, response, err) => {
applist = body.applist.apps;
add_to_wishlist(i, callback);
});
}
var app = applist.splice(Math.floor(Math.random()*applist.length), 1)[0];
if (account.userdata.rgWishlist.indexOf(app.appid) > -1
|| account.userdata.rgOwnedApps.indexOf(app.appid) > -1) {
return add_to_wishlist(i, callback);
}
account.http_request('https://psteamproxy.yuanyoumao.com/app/' + app.appid, {}, (body, response, err) => {
if (!Cheerio.load(body)('img.game_header_image_full').length) {
return add_to_wishlist(i, callback);
}
account.http_request('https://psteamproxy.yuanyoumao.com/api/addtowishlist', { appid: app.appid }, (body, response, err) => {
account.userdata.rgWishlist.push(app.appid);
add_to_wishlist(i-1, callback);
});
});
};
var diff = account.userdata.rgWishlist.length-(34666-1);
if (diff < 1) {
return add_to_wishlist(Math.min(limit, Math.abs(diff)+1));
}

// or one item to the feed then remove down to the maximum
add_to_wishlist(1, () => {
(remove_from_wishlist = (i) => {
if (i != 0) {
var app_index = Math.floor(Math.random()*account.userdata.rgWishlist.length);
account.http_request('https://psteamproxy.yuanyoumao.com/api/removefromwishlist', { appid: account.userdata.rgWishlist[app_index] }, (body, response, err) => {
account.userdata.rgWishlist.splice(app_index, 1);
remove_from_wishlist(i-1);
});
}
})(diff);
});
});
};"