Thanks for the quick response, but it is not what I am looking for, I think. Whenever it is busy 'getting' a user's inventory, it should freeze a code block (like a normal callback function could do). But I have no clue on how to run a callback on the "getUserInventoryContents" functoin. EDIT:
var j = 10;
for(var i=0;i<j;i++) {
console.log("testing... " + i)
manager.getUserInventoryContents(config.accounts.steamid64[i],753, 6, true, (err, inventory) => {
if (err) {
console.log(err);
return;
} else if (err == null ) {
console.log("Inventory length bot " +inventory.length+" | steamID "+ config.accounts.steamid64[i]);
//etc. etc.
This will output:
testing... 0
testing... 1
testing... 2
etc.
testing... 9
Inventory length bot 100 | steamID 12345678901234567890 //random ID
Inventory length bot 100 | steamID 12345678901234567890 //random ID
Inventory length bot 100 | steamID 12345678901234567890 //random ID
etc.
Inventory length bot 100 | steamID 12345678901234567890 //random ID
Inventory length bot 100 | steamID 12345678901234567890 //random IDNow, how can I make it output this:
testing... 0
Inventory length bot 100 | steamID 12345678901234567890 //random ID
testing... 1
Inventory length bot 100 | steamID 12345678901234567890 //random ID
testing... 2
Inventory length bot 100 | steamID 12345678901234567890 //random ID
etc.
Thanks in advance