Jump to content
McKay Development

loading someones inventory


Recommended Posts

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...