chnel Posted October 26, 2016 Report Posted October 26, 2016 hi, im getting not logged in error and i could not find why here is my code : var SteamUser = require("steam-user"); var client = new SteamUser; var TradeOfferManager = require('steam-tradeoffer-manager'); var manager = new TradeOfferManager({ steam: client, domain: "localhost", language: "en", pollInterval: 10000, cancelTime: 300000 }); client.logOn({ "accountName":"steamid", "password":"steampw", }); client.on('loggedOn', function(details){ console.log("["+client.steamID.getSteam3RenderedID()+"]Logged on"); client.setPersona(SteamUser.EPersonaState.Online); client.gamesPlayed(440); }); client.on('error',function(e){console.log(e)}); client.on('webSession',function(sessionID,cookies){console.log("++WebSession++")}); client.on('newItems',function(count){console.console.log(count+" yeni eÅŸya.");}) client.on('accountLimitations', function(limited, communityBanned, locked, canInviteFriends) { var limitations = []; if(limited) { limitations.push('LIMITED'); } if(communityBanned) { limitations.push('COMMUNITY BANNED'); } if(locked) { limitations.push('LOCKED'); } if(limitations.length === 0) { console.log("Our account has no limitations."); } else { console.log("Our account is " + limitations.join(', ') + "."); } if(canInviteFriends) { console.log("Our account can invite friends."); } }); var offer = manager.createOffer("https://steamcommunity.com/tradeoffer/new/?partner=11111&token=22222") offer.addMyItems([ { "appid": 730, "contextid": 2, "assetid": "7883664867" } ]); offer.addTheirItems([ { "appid": 730, "contextid": 2, "assetid": "7679971620" } ]); offer.send(function(err, status) { if (err) { throw err; } console.log("Offer #" + offer.id + " is now " + status); }); Quote
Dr. McKay Posted October 26, 2016 Report Posted October 26, 2016 You can't try to send the offer until the callback of webSession. Please read up on asynchronous JavaScript and callbacks. Quote
chnel Posted October 26, 2016 Author Report Posted October 26, 2016 You can't try to send the offer until the callback of webSession. Please read up on asynchronous JavaScript and callbacks. thanks for your time. Quote
Recommended Posts
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.