Skip to content

Commit

Permalink
Merge pull request #206 from xPaw/goo-value
Browse files Browse the repository at this point in the history
Fix getting goo value
  • Loading branch information
Nuklon authored Jul 15, 2024
2 parents c5b059b + 1ad5253 commit e7ce2b7
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions code.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -539,13 +539,30 @@

SteamMarket.prototype.getGooValue = function(item, callback) {
try {
var appid = item.market_fee_app;

for (const action of item.owner_actions) {
if (!action.link || !action.link.startsWith('javascript:GetGooValue')) {
continue;
}

var rgMatches = action.link.match( /GetGooValue\( *'%contextid%', *'%assetid%', *'?(?<appid>[0-9]+)'?/ );

if (!rgMatches) {
continue;
}

appid = rgMatches.groups.appid;
break;
}

var sessionId = readCookie('sessionid');
$.ajax({
type: "GET",
url: this.inventoryUrlBase + 'ajaxgetgoovalue/',
data: {
sessionid: sessionId,
appid: item.market_fee_app,
appid: appid,
assetid: item.assetid,
contextid: item.contextid
},
Expand Down Expand Up @@ -1398,7 +1415,7 @@
return callback(false);
}

item.goo_value_expected = parseInt(goo.goo_value);
item.goo_value_expected = parseInt(goo.goo_value, 10);

market.grindIntoGoo(item,
function(err, result) {
Expand Down

0 comments on commit e7ce2b7

Please sign in to comment.