Jump to content


Photo

loading someones inventory

node.js node-steam-tradeoffer-manager

Best Answer Dr. McKay , 16 April 2018 - 11:19 AM

You could always use node-steamcommunity's getUserInventoryContents, which is what steam-tradeoffer-manager calls anyway.

Go to the full post


  • Please log in to reply
3 replies to this topic

#1 Eradicate

Eradicate

    Member

  • Member
  • PipPip
  • 25 posts

Posted 15 April 2018 - 10:48 AM

Heyo,

I've been looking to load someones inventory, I'd like to get the contents and send them over to the server, would the following way be a good way to load someones inventory? Would I be needing to cache their inventories?

var request = require('request');

request('https://steamcommunity.com/inventory/x/578080/2', function(error, response, body) {
	if(error){
		console.log(error);
		return;
	}

	var inventory = JSON.parse(body);

	inventory.descriptions.forEach(function(data){
		console.log(data.market_name);
	});
});

Also, would I not just be able to load someones inventory using manager.getUserInventoryContents to load their inventories without having to cache anything?


Edited by Eradicate, 15 April 2018 - 10:48 AM.


#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 1,815 posts

Posted 15 April 2018 - 04:04 PM

I don't understand what you're trying to do here. Why manually make the request instead of using getUserInventoryContents? What do you mean by "not having to cache anything"?



#3 Eradicate

Eradicate

    Member

  • Member
  • PipPip
  • 25 posts

Posted 16 April 2018 - 08:49 AM

I don't understand what you're trying to do here. Why manually make the request instead of using getUserInventoryContents? What do you mean by "not having to cache anything"?

People going on my site should have got their inventory loaded, therefore I want to get the contents from his inventory, send it to the client, and load his inventory on there.

I believe getUserInventoryContents requires a manager to be used, and I'm using multiple bots, it would seem to me like a bad sport just to use a random bots his manager to load someones inventory.



#4 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 1,815 posts

Posted 16 April 2018 - 11:19 AM   Best Answer

You could always use node-steamcommunity's getUserInventoryContents, which is what steam-tradeoffer-manager calls anyway.


  • Eradicate likes this





Also tagged with one or more of these keywords: node.js, node-steam-tradeoffer-manager

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users