Thanks for the reply. I don't really understand what you said there... I'm not really a programmer so I don't really know the terminology. How do I 'iterate' the array? And how do I add gems from each stack? Thanks. --- EDIT So I've googled this a bit and found some codes and I tried to use those examples but its TOO CONFUSING, I don't understand how to do it...
manager.getUserInventoryContents(steamID, 753, 6, true, function(err, inv) {
if (err) {
bot.chatMessage(steamID, "An error occurred while loading your inventory. Please try later");
}else{
if (ERR) {
client.chatMessage(steamID, "An error occurred while loading your inventory. Please try later");
} else {
var gemsAmount = 0;
var botGems = [];
for (var i = 0; i < inv.length; i++) {
if (CONFIG.STEAMGEMS.indexOf(inv[i].market_hash_name) >= 0) { //Don't know what to put in 'CONFIG.STEAMGEMS', I just copy/pasted
botgems = inv[i].amount;
gemsAmount = INV[i].amount;
inv[i].amount = itemAmount
botGems.push(inv[i]);
break;
}
}
if (botgems < itemAmount) {
client.chatMessage(steamID, "You don't have enough gems to send. (You have " + botgems + " gems)");
} else {
t.addTheirItems(botgems);
t.send();
client.chatMessage(steamID, "You sent me " + itemAmount + " gems.");
}