Jump to content
McKay Development

Search the Community

Showing results for tags 'node-steam-tradeoffer-manager'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • News & Announcements
    • Releases & Updates
  • Help & Support
    • General
    • Guides
    • node-steam-user
    • node-steamcommunity
    • node-steam-tradeoffer-manager
    • node-steam-session

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL




  1. Hi, im sorry to bother you but i need a litte bit of help. I need to find, how to get my sended offers and to be honest, I dont even know where to start, what function use and even if its possible or if i will need o save every trade i send. Thank you
  2. I'm running a bot and the majority of trade offers are not going through. The bot logs in and handles expired sessions like this: let client = new SteamUser(); let community = new SteamCommunity(); let manager = new TradeOfferManager({ community: community, steam: client, domain: "example.com", language: "en", pollInterval: 2000 }); let logOnOptions = { "accountName": data.username, "password": data.password, "twoFactorCode": SteamTotp.getAuthCode(data.shared_secret) }; client.logOn(logOnOptions); client.on('loggedOn', function() { console.log("Logged into Steam"); client.setPersona(SteamUser.EPersonaState.Online); }); client.on('webSession', function(sessionID, cookies) { manager.setCookies(cookies); community.setCookies(cookies); console.log("weblogon") }); community.on("sessionExpired", function(err) { console.log("## Session Expired"); client.webLogOn(); }); The bot gets new offers with manager.on('newOffer', function(offer) { , makes a simple request using https://www.npmjs.com/package/request and calls offer.getUserDetails. An offer is accepted like this: offer.accept(accept(offer, 1)); These are the two functions that handle accepting and confirming trades: function confirm(offer, count) { return function(err) { if (err) { if (count < 20) { console.log(err); setTimeout(community.acceptConfirmationForObject, 10000, data.identity_secret, offer.id, confirm(offer, count + 1)); } else { console.error("CONFIRM FUNCTION: "); console.error(err); } } } } function accept(offer, count) { return function(err, status) { if (err) { if (count < 20) { console.log(err); setTimeout(offer.accept, 10000, accept(offer, count + 1)); } else { console.error("ACCEPT FUNCTION: "); console.error(err); } } else { if (status === "pending") { community.acceptConfirmationForObject(data.identity_secret, offer.id, confirm(offer, 1)); } } } } Whenever I run the code it works for a few hours accepting offers and confirming them. Then offer comes in and the sessionExpired and webSession events are emitted twice. Error: Cannot accept an unsent offer happens every time it tries to accept the offer. This from stdout (it also logs the timestamp): 16:31:23 Error: Not Logged In at SteamCommunity._checkCommunityError (/home/user/bot/node_modules/steamcommunity/components/http.js:128:9) at Request._callback (/home/user/bot/node_modules/steamcommunity/components/http.js:51:88) at Request.self.callback (/home/user/bot/node_modules/request/request.js:185:22) at emitTwo (events.js:126:13) at Request.emit (events.js:214:7) at Request.<anonymous> (/home/user/bot/node_modules/request/request.js:1161:10) at emitOne (events.js:116:13) at Request.emit (events.js:211:7) at Gunzip.<anonymous> (/home/user/bot/node_modules/request/request.js:1083:12) at Object.onceWrapper (events.js:313:30) 16:31:23 ## Session Expired 16:31:23 ## Session Expired 16:31:23 Error: Not Logged In at SteamCommunity.manager._community.httpRequestPost (/home/user/bot/node_modules/steam-tradeoffer-manager/lib/classes/TradeOffer.js:483:25) at Request._callback (/home/user/bot/node_modules/steamcommunity/components/http.js:67:15) at Request.self.callback (/home/user/bot/node_modules/request/request.js:185:22) at emitTwo (events.js:126:13) at Request.emit (events.js:214:7) at Request.<anonymous> (/home/user/bot/node_modules/request/request.js:1161:10) at emitOne (events.js:116:13) at Request.emit (events.js:211:7) at IncomingMessage.<anonymous> (/home/user/bot/node_modules/request/request.js:1083:12) at Object.onceWrapper (events.js:313:30) 16:31:23 weblogon 16:31:24 weblogon 16:31:33 Error: Cannot accept an unsent offer at Timeout.TradeOffer.accept [as _onTimeout] (/home/user/bot/node_modules/steam-tradeoffer-manager/lib/classes/TradeOffer.js:451:23) at ontimeout (timers.js:502:15) at tryOnTimeout (timers.js:323:5) at Timer.listOnTimeout (timers.js:290:5) 16:31:43 Error: Cannot accept an unsent offer at Timeout.TradeOffer.accept [as _onTimeout] (/home/user/bot/node_modules/steam-tradeoffer-manager/lib/classes/TradeOffer.js:451:23) at ontimeout (timers.js:502:15) at tryOnTimeout (timers.js:323:5) at Timer.listOnTimeout (timers.js:290:5) ... etc What am I doing wrong?
  3. So, i would like to search for specific items (keys). Code: community.getUserInventoryContents(steamid, 730, 2, true, (err, inventory) => {if (err) {throw err;}else{for(var i = 0, len = inventory.length; i < len; i++){var itemnames = inventory.market_hash_name;}var found = itemnames.search("R8 Revolver | Bone Mask (Well-Worn)");if(found != -1) {console.log();}console.log(itemnames);console.log (found); } I would like to write a code which is search for a specific item, then check this item's amount and then do something, but i'm new at nodeJS so i don't know so many things.Please Help, or give me some docs. Tnanks
  4. community.getUserInventoryContents(partner, 753, 6, true, (error, items) => { if(error) { users.removeReservation(partner, true, removeFunc); return callback(error); } let count = 0; for(let i = 0; i < items.length; i++) { let item = items[i]; if(item.type.toLowerCase() != "Trading Card") continue; count += item.amount; if(count > price) { item.amount -= (count - price); count -= (count - price); } offer.addTheirItem(item); if(count == price) break; } if(count < price) { users.removeReservation(partner, true, removeFunc); return callback("You do not have enough gems to purchase random games."); } if(count > price) { users.removeReservation(partner, true, removeFunc); return callback("An unexpected error occurred, please try again."); } offer.send((error, status) => { if(error) { users.removeReservation(partner, true, removeFunc); return callback(error); } if(status == "pending") { community.acceptConfirmationForObject(files.getConfig().identity, offer.id, error => { if(error) { users.removeReservation(partner, true, removeFunc); return callback(error); } callback(null, "https://steamcommunity.com/tradeoffer/" + offer.id); }); } else if(status == "sent") callback(null, "https://steamcommunity.com/tradeoffer/" + offer.id); }); }); break; default: users.removeReservation(partner, true, (error) => { if(error) return callback(error); return callback("Invalid payment method"); }); } }); }); } Where is my fault?
  5. Hello. I'm new to all this stuff, so just a generic question before I dig further in. Can I create a bot which only accepts donations (i.e. no item loss from bot side) if the associated steam account doesn't use Mobile 2FA but is not a limited account (using email auth)? I'm asking because trying this code... client.on('webSession', (sessionid, cookies) => { manager.setCookies(cookies); community.setCookies(cookies); community.startConfirmationChecker(10000, 'my_identity_secret'); }); ...I'm not sure how to avoid that "identity_secret" argument. Thanks
  6. I want take random 5 trading cards how can i do ? i use this; community.getUserInventory(partner, 753, 6, true, (error, items) => {if(error) {users.removeReservation(partner, true, removeFunc);return callback(error);} let count = 0; for(let i = 0; i < items.length; i++) {let item = items; if(item.type.toLowerCase() != "Steam Trading Cards")continue; count += item.amount; if(count > price) {item.amount -= (count - price);count -= (count - price);} offer.addTheirItem(item); if(count == price)break;} But dont working help me please
  7. Hello there, I am very new to node.js and learning step by step, I had a look at many topics in this forum to learn some basics of trading codes, I need little help here, I want to connect to database, retrieve steam trading card names from database (like Alpaca Mage, Mysterious Card 4 etc.) and send a trade offer containing only those trading cards. I also want my bot to check my database like every 10 seconds and if a value i want is found, it will create a trade offer. Is something like this possible ? Thanks in advance
  8. http://prntscr.com/lv0q6u my developer is busy for few days. can anyone give me any idea why this happens so i could fix it? it happens after 24 hrs etc when bot is working
  9. Is there any way to learn if an offer between 2 different steam accounts (that are not mine) got accepted or declined ? I would like to create a website in which people advertise their cs go skins and others buy it, the skins are traded via their own steam accounts but i need to learn if the skin gets to buyer or not ? Is there any way to do that ? Thanks in advance
  10. Hy, i'm new in node js, my english is not that good. First, i wanna make a script which is load the player's inventory, accept all keys expect low price keys (like hydra case key or CSGO capsulekey),t hen select ? keys (depends on what command he uses in the chat (!buyadmin->3keys, !buyvip->2keys)). After the select, the bot will send an offer for the keys and he gets his rank (I can make this part). I have a starter script (I tried to learn and code something). Code: const SteamUser = require('steam-user'); const SteamTotp = require('steam-totp');const SteamID = require('steamid');const SteamCommunity = require('steamcommunity');const TradeOfferManager = require('steam-tradeoffer-manager');const config = require('./config.json'); const client = new SteamUser();const community = new SteamCommunity();const manager = new TradeOfferManager({ steam: client, community: community, language: 'en'}); const logOnOptions = { accountName: config.username, password: config.password, twoFactorCode: SteamTotp.generateAuthCode(config.sharedSecret)}; client.logOn(logOnOptions); client.on('loggedOn', () => { console.log('[Vortex] Sikeres bejelentkezés a steam-be!'); client.setPersona(SteamUser.Steam.EPersonaState.Online); client.gamesPlayed(730);}); client.on('webSession', (sessionid, cookies) => { manager.setCookies(cookies); community.setCookies(cookies); community.startConfirmationChecker(10000, config.identitySecret);}); manager.on('newOffer', offer => { if (offer.partner.getSteamID64() === 'config.owenerID') { offer.accept((err, status) => { if (err) { console.log(err); } else { console.log(`[Vortex] Owner csereajánlat elfogadva. Státusz: ${status}.`); } }); } }); client.on("friendMessage", function(steamID, message) { if (message == "!help") { client.chatMessage(steamID, "[Vortex] Parancsok: !weboldal, !szerverek, !rangok, !adminok, !buyadmin, !buyvip+, !buyvip, !buypskin");console.log(steamID.getSteam2RenderedID()); } if (message == "!weboldal") { client.chatMessage(steamID, "[Vortex] Weboldalunk: ");console.log(steamID.getSteam2RenderedID()); } if (message == "!szerverek") { client.chatMessage(steamID, "[Vortex] Szervereink: ");console.log(steamID.getSteam2RenderedID()); } if (message == "!rangok") { client.chatMessage(steamID, "[Vortex] Rangok: ");console.log(steamID.getSteam2RenderedID()); } if (message == "!adminok") { client.chatMessage(steamID, "[Vortex] Adminok: ");console.log(steamID.getSteam2RenderedID()); } if (message == "!buyadmin") { client.chatMessage(steamID, "[Vortex]");const steam2id = (steamID.getSteam2RenderedID());const steamid = (steamID.getSteamID64());const offer = manager.createOffer(steamid); community.getUserInventory(steamid, 730, 2, false, function(err, inventory) {console.log(inventory[0].amount);}); } if (message == "!buyvip+") { client.chatMessage(steamID, "[Vortex]"); } if (message == "!buyvip") { client.chatMessage(steamID, "[Vortex]");console.log(steamID.getSteam2RenderedID()); } if (message == "!buypskin") { client.chatMessage(steamID, "[Vortex]");console.log(steamID.getSteam2RenderedID()); } if (message != "!help" && message != "!weboldal" && message != "!rangok" && message != "!adminok" && message != "!buyadmin" && message != "!buyvip+" && message != "!buyvip" && message != "!buypskin"){client.chatMessage(steamID, "[Vortex] Nincs ilyen parancs, segítségért írd be: !help");}}); manager.on('newOffer', offer => { if (offer.itemsToGive.length === 0) { offer.accept((err, status) => { if (err) { console.log(err); } else { console.log('[Vortex] Támogatás elfogadva. Státusz: ${status}.'); } }); } else { offer.decline(err => { if (err) { console.log(err); } else { console.log('[Vortex] Támogatás elutasítva. (Tárgyat akart kérni a bot-tól!)'); } }); }}); (steamID.getSteam2RenderedID()); -> I need this for sourcemod admin setup.
  11. I am trying to only get defined number of keys in a trade, but instead it adds all the items as they share the same id (item is a TF2 Mann co. key) here is my current code for the trade offer, (the steam id in create offer is a mates steamid as I can't test with my own account due to vac) function buy(steamID, amount){ if(isNaN(amount) || amount === undefined){ client.chatMessage(steamID, "Please enter a valid number"); } else{ var count = 0; var i = 0; client.chatMessage(steamID, "Creating Offer, please wait!"); //Check Players inventory for the keys, and make sure we have enough sets to supply var offer = manager.createOffer('76561198008100070'); offer.setMessage("Price: " + amount + " Keys. Sets: " + amount * config.buyRate); offer.getPartnerInventoryContents(440, 2, function(err, inventory, currencies){ if(err){ console.log(err); } /*for (var j = 0; j < amount; ++j){ if(inventory[i].market_hash_name == config.keysAccepted){ ++count; console.log("Adding Item"); offer.addTheirItem({id: inventory[i].id, appid: 440, contextid: 2}); } }*/ inventory.forEach(function(val){ if(val.market_hash_name == config.keysAccepted){ console.log("Adding Item"); offer.addTheirItem({id: val.instanceid, appid: 440, contextid: 2}); ++count; } }); if(count < amount){ console.log("count: "+count); client.chatMessage(steamID, "You don't have enough keys for me to send this trade."); } else{ offer.send(function(err, status){ if(err){ console.log(err); client.chatMessage(steamID, "An Error has Occured while sending offer."); } if(status == "pending"){ client.chatMessage(steamID, "Confirming Offer!"); } if(status == "sent"){ client.chatMessage(steamID, "Offer Sent!"); } }); } }); } }
  12. Hello, I'm currently stuck with something that I assume is very simple, but I can't find any tutorial or help about it anywhere on the internet... I'm currently trying to create a bot that trades random Steam game codes for random steam cards, but my problem right now is that I don't know how to check if all items that the bot will receive are trading cards. I'm aware that this probably is a really easy thing, but I really have no idea where to find my answers :/ Thanks a lot for reading this, hopefully you can me with that This is what I have done so far : //This is where the pain begins. function processOffer(offer) { if (offer.partner.getSteamID64() === config.ownerID) { acceptOffer(offer); } else if (offer.isGlitched() || offer.state === 11) { console.log("Offer was glitched, declining."); declineOffer(offer); } else { var theirItems = offer.itemsToReceive var ourItems = offer.itemsToGive }} manager.on('newOffer', (offer) => { console.log("Offer received, processing"); processOffer(offer); })}
  13. I am trying to get the tf2 quantities, but how am I supposed to get it. I saw on the post that you need an item tag, but how do I get it?\ LINK: https://dev.doctormckay.com/topic/1863-how-do-i-identify-tf2-qualities/
  14. How to fix it i try all webLogOn script but dont working ı use this commands; const async = require('async'); const TradeOfferManager = require('steam-tradeoffer-manager');var manager = null; const SteamCommunity = require('steamcommunity');var community = null;const WebAPI = require('@doctormckay/steam-webapi');var api = null;const SteamID = require('steamid'); const steam = require('./steam');const users = require('./users');const files = require('./files'); var first = true;var ongoing = false; exports.setup = (client, cookies, callback) => {manager = new TradeOfferManager({steam: client,domain: "example.net"});community = new SteamCommunity(); manager.setCookies(cookies);community.setCookies(cookies);api = new WebAPI(files.getConfig().apikey);if(first) {callback();first = false;}registerEvents(); community.on("sessionExpired",function(err) {client.webLogOn();});
  15. Can you help me i dont know how to create this function with command !all take all partner cupons to offer. client.on("friendMessage", (partner, message) => { if(message === "!all"){ const offer = manager.createOffer(partner); manager.loadUserInventory(partner, 753, 3, true, (err, theirInv) => { if (err) { console.log(err); } else { const theirItem = theirInv[Math.floor(Math.random() * theirInv.length - 1)]; offer.addTheirItems(theirItem); offer.setMessage( `U cuppon` ); offer.send((err, status) => { if (err) { console.log(err); } else { console.log(`Sent offer. Status: ${status}.`); } }); } } ); } });
  16. I want to confirm offer from server app but i am also using SteamDesktopAuth and while i am trying to confirm it there is a error: Error: It looks like your Steam Guard Mobile Authenticator is providing incorrect Steam Guard codes. This could be caused by an inaccurate clock or bad timezone settings on your device. If your time settings are correct, it could be that a different device has been set up to provide the Steam Guard codes for your account, which means the authenticator on this device is no longer valid. at /usr/home/MMMM/domains/XXX/public_trade2/node_modules/steamcommunity/components/confirmations.js:33:14 at SteamCommunity.<anonymous> (/usr/home/MMMM/domains/XXX/public_trade2/node_modules/steamcommunity/components/confirmations.js:276:3) at Request._callback (/usr/home/MMMM/domains/XXX/public_trade2/node_modules/steamcommunity/components/http.js:67:15) at Request.self.callback (/usr/home/MMMM/domains/XXX/public_trade2/node_modules/request/request.js:185:22) at emitTwo (events.js:126:13) at Request.emit (events.js:214:7) at Request.<anonymous> (/usr/home/MMMM/domains/XXX/public_trade2/node_modules/request/request.js:1161:10) at emitOne (events.js:116:13) at Request.emit (events.js:211:7) at Gunzip.<anonymous> (/usr/home/MMMM/domains/XXX/public_trade2/node_modules/request/request.js:1083:12)So it is possible to confirm it from server?
  17. Hello I guess i can`t manage to setup sentOfferChanged event. This is my code: const SteamUser = require('steam-user'); const TradeOfferManager = require('steam-tradeoffer-manager'); const fs = require('fs') // steam 2fa. generate steam guard code for login. const SteamTotp = require('steam-totp'); const bot = new SteamUser(); const manager = new TradeOfferManager({ steam: bot, language: 'en' }); if (fs.existsSync('polldata.json')) { manager.pollData = JSON.parse(fs.readFileSync('polldata.json').toString('utf8')); } bot.logOn({ accountName: 'user', password: 'password', twoFactorCode: SteamTotp.generateAuthCode('secret') }); bot.on('webSession', (sessionid, cookies) => { manager.setCookies(cookies); sendRandomItem(); }); function sendRandomItem() { console.log('Sending the offer') const partner = 'trade_url'; const offer = manager.createOffer(partner); offer.addTheirItem({ assetid: "id", appid: 730, contextid: 2 }); offer.setMessage( `HIIII` ); offer.send((err, status) => { if (err) { console.log({err}); } else { console.log(`Sent offer. Status: ${status}.`); } }); }; manager.on('sentOfferChanged', function (offer, oldState) { console.log(`Offer #${offer.id} changed: ${TradeOfferManager.ETradeOfferState[oldState]} -> ${TradeOfferManager.ETradeOfferState[offer.state]}`); }); manager.on('pollFailure', function (err) { console.log({err}) }) manager.on('pollData', function (pollData) { fs.writeFileSync('polldata.json', JSON.stringify(pollData)); }); This is polldata.json {"sent":{"3358172656":2}} Console log $ node ./modules/bot Sending the offer Sent offer. Status: sent. But when i accept or decline the offer sentOfferChanged doesnt fire up.
  18. I know that we can set a message to trade offers that we send. I'm wondering how to get/extract the message in incoming trade offers.
  19. newOffer event is not called sometimes... Even after restart of bot, event is still not fired. After I send second offer, newOffer triggers for both trades Not fired if i send 2 or more offers at the same time. Called only for one offer. Second offer calling newOfferafter sentOfferChanged or recievedOfferChanged triggers. Its seems like bug How could I fix this problem...I had lose many offers because this problem..
  20. I am not new to the steam bots but i am new to making it send steam offers and dont know how to do that with my bots
  21. So I'm creating a tf2 bot named Wolfy. I got the trade confirmations, steam login, and such, but the only problem is that how do I identify a tf2 item qualities(Unique, Genuine, Unusuals). Like what am I suppose to do exactly?
  22. Hello, I used some open source bots, and configured it as I like it. Currently I want to add !buygems [n] option. I looked at many discussions, mostly on this site. My problem is I filter the gems, and type theirGems.amount = n * CONFIG.BUYINGGEMS(never mind what I put here). I tried to console.log theirGems and theirGems.amount and it says the same number as it should be n * CONFING.BUYINGGEMS but in the trade offer it adds whole sack of gems. https://pastebin.com/p70bwckf http://prntscr.com/kod0gg
  23. Hello, i'm newbie in creating bots and i don't know how to make trade sending system properly(It doesn't add items). I provide code below: var incomeMessage = message; var splittedMsg = incomeMessage.split(" "); if(splittedMsg[0] == "!buy") { splittedMsg = incomeMessage.slice(5); client.chatMessage(steamID, "Sellin' item named " + splittedMsg); manager.getUserInventoryContents(steamID, 440, 2, true, (err, inv) => { if (err) { throw err; } else { const offer = manager.createOffer(steamID); let item = inv.filter(item => item.market_name == splittedMsg); let itemsToTrade = item[0]; offer.addMyItem(itemsToTrade); offer.setMessage('You recieved a Refined Metal!'); offer.send((err, status) => { if (err) { console.log(err); } else { console.log('trade sent'); console.log(status); } }); } }); } I send message to bot like !buy Refined Metal and it has to put 1 Refined Metal to trade and then send it to me. But i has error 26. I know it means that i don't have such items in my inventory. So can you help me with that?
  24. TypeError: Cannot read property 'getSteamID64' of undefined at SteamCommunity.getUserInventory (/root/bot/node_modules/steamcommunity/components/users.js:287:39) at TradeOfferManager.loadUserInventory (/root/bot/node_modules/steam-tradeoffer-manager/lib/index.js:331:18) at Object.GetInventory (/root/bot/Code/BotsManager.js:143:17) at Server.<anonymous> (/root/bot/Code/RemoteAccess.js:48:11) at next (/root/bot/node_modules/restify/lib/server.js:1125:29) at f (/root/bot/node_modules/once/once.js:36:25) at Server.<anonymous> (/root/bot/node_modules/express-ipfilter/lib/ipfilter.js:205:14) at next (/root/bot/node_modules/restify/lib/server.js:1125:29) at f (/root/bot/node_modules/once/once.js:36:25) at Server.parseBody (/root/bot/node_modules/restify/lib/plugins/bodyParser.js:152:17) Please help. What could be causing these errors?
  25. I have this line for the intention of selling my card sets for his gems. instead it gets the other users whole inventory.
  • Create New...