Cubson Posted June 12, 2017 Report Share Posted June 12, 2017 (edited) const SteamUser = require('steam-user'); const SteamTotp = require('steam-totp'); const SteamCommunity = require('steamcommunity'); const TradeOfferManager = require('steam-tradeoffer-manager'); const client = new SteamUser(); const community = new SteamCommunity(); const manager = new TradeOfferManager({ steam: client, community: community, language: 'en' }); const logOnOptions = { accountName: 'hereismylogin', password: 'hereismypassword', twoFactorCode: SteamTotp.generateAuthCode('hereismysharedsecret') }; client.logOn(logOnOptions); client.on('loggedOn', () => { console.log(' > Logged into Steam'); client.setPersona(SteamUser.Steam.EPersonaState.Online); client.gamesPlayed("Steam Test Bot by Cubson [Not Busy]"); }); client.on('webSession', (sessionid, cookies) => { manager.setCookies(cookies, function(err) { if (err) return console.log(err); console.log(" > Got API key!"); }); community.setCookies(cookies); community.startConfirmationChecker(6000, 'hereismyidentitysecret'); }); manager.on('newOffer', (offer) => { client.gamesPlayed("Steam Test Bot by Cubson [Busy]"); if (offer.partner.getSteamID64() === 'firsttrustedguysteamid' || 'secondtrustedguysteamid') { offer.accept((err, status) => { if (err) { console.log(err); client.gamesPlayed("Steam Test Bot by Cubson [Not Busy]"); } else { community.checkConfirmations(); console.log(`Accepted offer. Status: ${status}.`); client.gamesPlayed("Steam Test Bot by Cubson [Not Busy]"); } }); } }); What's wrong? And I'm a very big noob in JavaScript and Node.JS and because of it I beg you to explain everything step-by-step. P.S. Maybe update to IPB 4? Edited June 12, 2017 by Cubson Quote Link to comment Share on other sites More sharing options...
jafix Posted June 12, 2017 Report Share Posted June 12, 2017 Why do you use client.gamesPlayed("Steam Test Bot by Cubson [Not Busy]"); 3 times? You only need to call it once.For the rest your script should work. Are sure you tested with a "non-trusted" steamid? Quote Link to comment Share on other sites More sharing options...
Cubson Posted June 12, 2017 Author Report Share Posted June 12, 2017 (edited) I experienced this when I withdrawed some things from the site, then I checked status and it told me that everything is fine, items are in steam inventory. I didn't accept the trade by myself and even tried to send it from another account. And it successfully accepted all trades. Edited June 12, 2017 by Cubson Quote Link to comment Share on other sites More sharing options...
TomYoki Posted June 13, 2017 Report Share Posted June 13, 2017 if (offer.partner.getSteamID64() === 'firsttrustedguysteamid' || 'secondtrustedguysteamid') { is not a valid syntax.If you wish to compare multiple IDs at once you can always put them in array and use indexOf(); Quote Link to comment Share on other sites More sharing options...
Cubson Posted June 13, 2017 Author Report Share Posted June 13, 2017 if (offer.partner.getSteamID64() === 'firsttrustedguysteamid' || 'secondtrustedguysteamid') { is not a valid syntax.If you wish to compare multiple IDs at once you can always put them in array and use indexOf(); Please, give me an example. What does mean "use indexOf()"? Where do I have to use it? Quote Link to comment Share on other sites More sharing options...
TomYoki Posted June 13, 2017 Report Share Posted June 13, 2017 Please, give me an example. What does mean "use indexOf()"? Where do I have to use it?https://www.w3schools.com/jsref/jsref_indexof_array.asp Quote Link to comment Share on other sites More sharing options...
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.