Closed chrom007 closed 8 years ago
Perhaps you could add the following above this line: https://github.com/seishun/node-steam-trade/blob/master/index.js#L185
console.log(body);
console.log(inventory);
body return this:
{ trade_status: 0,
success: true,
version: 3,
newversion: true,
me:
{ ready: 0,
confirmed: 0,
sec_since_touch: 0,
assets: '',
currency: '' },
them:
{ ready: 0,
confirmed: 0,
sec_since_touch: 0,
assets: [ [Object], [Object] ],
currency: '' },
events:
{ '1':
{ steamid: '76561198058939986',
action: '0',
timestamp: 1466610338,
appid: 730,
contextid: '2',
assetid: '6440710501' } } }
inventory return this: {}
Does this happen every time? Does it happen with all trade partners or just specific users? Does it happen just with CS:GO items or all items? Does it happen on just one account or on all your accounts?
All time... All users (testing with friend). All games (CSGO, Dota, SteamGifts). And in you work?
Its bug in inventory... In event comes this:
EVENT====
{ steamid: '76561198055243493',
action: '1',
timestamp: 1466611648,
appid: 730,
contextid: '2',
assetid: '6366333245' }
But this code inventory[event.assetid]
(https://github.com/seishun/node-steam-trade/blob/master/index.js#L185) - don't work :(
Inventory is Empty...
What happens if you log into the bot's account and trade manually with the same user?
Have you tried running the bot on another account?
Yep, same :(
Could you provide your code?
Yes, no problem
var Steam = require("steam");
var SteamUser = require("steam-user");
var SteamTrade = require("steam-trade");
var SteamCommunity = require("steamcommunity");
var client = new SteamUser();
var friends = new Steam.SteamFriends(client.client);
var trade = new SteamTrade();
var community = new SteamCommunity();
var fs = require("fs");
var config = {
"login": "LOGIN",
"password": "PASSWORD"
};
client.logOn({
"accountName": config.login,
"password": config.password
});
client.on("loggedOn", function(info) {
console.log("Logged on Steam [ice_chrom]");
client.setPersona(SteamUser.Steam.EPersonaState.Online);
console.log("Set Status: Online\n");
});
friends.on("friendMsg", function(user, msg, type){
if (type == 1) {
console.log(user + ": " + msg);
}
});
client.on("webSession", function(steamID, cookies){
community.setCookies(cookies);
trade.sessionID = cookies[0].split("=")[1];
cookies.forEach(function(cookie){
trade.setCookie(cookie);
});
});
/* ============== TRADE ============== */
var traderID = null;
client.on("tradeRequest", function(steamID, respond){
console.log("New TradeRequest with " + steamID);
traderID = steamID;
respond(true);
});
client.on("tradeStarted", function(steamID){
trade.open(steamID);
});
trade.on('end', function(status, getItems) {
if (status == 'complete') {
console.log(status);
getItems(function(items) {
console.log(items);
});
}
});
trade.on('offerChanged', function(added, item) {
console.log('they ' + (added ? 'added ' : 'removed '));
console.log(item);
console.log(trade.themAssets);
//console.log(inventory);
});
trade.on('ready', function() {
console.log("READY");
trade.ready(function(){
trade.confirm();
})
});
trade.on('chatMsg', function(msg) {
console.log(msg);
});
trade.on("debug", function(msg){
console.log("DEBUG: " + msg);
});
trade.open
must be called with a SteamID string, but steam-user's "tradeStarted" event passes some kind of a SteamID object.
Thanks <3
offerChanged and themAssets return [ undefined ] all time... what is it ? :cry:
Code:
In console: