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


Forums

  • 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

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Skype


Location


Interests

  1. Help im not sure why the polling doesn't work. i tried setting a debug on manager but it does not display any messages i also tried turning firewall off also much help appreciated thanks this.client = new SteamUser(); this.community = new SteamCommunity(); this.manager = new TradeOfferManager({ steam: this.client, domain : 'domain', community: this.community, language: 'en', }); this.manager.on('newOffer', function(offer) { console.log("New offer #" + offer.id + " from " + offer.partner.getSteam3RenderedID()); offer.accept(function(err) { if (err) { console.log("Unable to accept offer: " + err.message); } else { community.checkConfirmations(); // Check for confirmations right after accepting the offer console.log("Offer accepted"); } }); }); this.manager.on('receivedOfferChanged', function(offer, oldState) { console.log(`Offer #${offer.id} changed: ${TradeOfferManager.ETradeOfferState[oldState]} -> ${TradeOfferManager.ETradeOfferState[offer.state]}`); if (offer.state == TradeOfferManager.ETradeOfferState.Accepted) { offer.getExchangeDetails((err, status, tradeInitTime, receivedItems, sentItems) => { if (err) { console.log(`Error ${err}`); return; } // Create arrays of just the new assetids using Array.prototype.map and arrow functions let newReceivedItems = receivedItems.map(item => item.new_assetid); let newSentItems = sentItems.map(item => item.new_assetid); console.log(`Received items ${newReceivedItems.join(',')} Sent Items ${newSentItems.join(',')} - status ${TradeOfferManager.ETradeStatus[status]}`) }) } });
  2. Hello I've been following the tutorial listed here. Its a great tutorial and everything works so far. However I am able to send a trade request, I am not however able to confirm mobile auth to actually send it. below is my code. please for the love of gaben help me. var SteamUser = require('steam-user');var client = new SteamUser();var SteamTotp = require('steam-totp'); var SteamCommunity = require('steamcommunity');var TradeOfferManager = require('steam-tradeoffer-manager');var community = new SteamCommunity();var manager = new TradeOfferManager({ steam: client, community: community, language: 'en'}); var logOnOptions = { accountName: 'sadface', password: 'sadface', twoFactorCode: SteamTotp.generateAuthCode('superTopSecretLoL')}; client.logOn(logOnOptions);client.on('loggedOn',function(){ console.log('Logged into Steam'); // online status client.setPersona(SteamUser.Steam.EPersonaState.Online); // set to appear to be playing tf2 client.gamesPlayed(440); }); client.on('webSession', function(sessionid, cookies){ console.log('websession being executed'); manager.setCookies(cookies); community.setCookies(cookies); community.startConfirmationChecker(10000, 'SuperTopSecretLoL'); sendOffer(); }); function sendOffer(){ var partner = '76561198049686559'; var appid = 440; var contextid = 2; var offer = manager.createOffer(partner); //load my inventory manager.loadInventory(appid, contextid, true, function(err, myInv){ if (err) { console.log(err); } else { var myItem = myInv[Math.floor(Math.random() * myInv.length - 1)]; offer.addMyItem(myItem); // loads partners inventory manager.loadUserInventory(partner, appid, contextid, true, function(err, theirInv){ //console.log(countCurrency(theirInv)); if (err) { console.log(err); } else { var theirItem = theirInv[Math.floor(Math.random() * theirInv.length - 1)]; // console.log(theirInv); offer.addTheirItem(theirItem); offer.setMessage(`Will you trade your ${theirItem.name} for my ${myItem.name}?`); offer.send(function(err, status){ if (err) { console.log(err); } else { console.log(`Sent offer. Status: ${status}.`); community.checkConfirmations(); } }); } }); } });} community.on('confKeyNeeded', function(tag, callback) { console.log('confKeyNeeded Called'); var time = Math.floor(Date.now() / 1000); callback(null, time, SteamTotp.getConfirmationKey('superTopSecretLoL', time, tag));});
  3. Hello there, I found a weird problem when checking if an item is marketable or not I'm running 1:1 Card Trade (same-set) bot, and additionaly also accept 1:1 from non-marketable cards. The code I use to check if an item is marketable or not is something like this offer.itemsToReceive.forEach(function(item) { if ((item.type.includes("Trading Card") == true) && (item.marketable == false)){ itemBotReceive.push("Non-Marketable Trading Cards"); //Non-marketable cards will be pushed to new array } }); The problem is, when using above code, sometimes marketable cards will goes to non-marketable cards This screenshot is perfect example for what I mean: As you can see above, one of them is accepted, while the other one is rejected. Both trades come from same person When I check the log it say: 21/05/17 - 05:18:07 - Accepting (1:1) Trade Offer #2227108866 : (SteamID) 21/05/17 - 05:18:15 - Confirmed Trade Offer #2227108866 21/05/17 - 05:22:28 - Rejecting Trade Offer from (SteamID) - Reason: Cross-Set 21/05/17 - 05:22:28 - [INFO] givenlength: (1) receivelength: (1) tagged: (0) nonmarketable1: (0) nonmarketable2: (1) Mysterious card "3" for some reason will got tagged as "Non-Marketable Cards", but it's clearly that the cards is marketable --- Is this a bug or something? I can't reproduce this issue It's been going on for pretty long time, but pretty rare (about 5% Trades will get rejected for same reason) Thanks
  4. What are the advantages of using real time trade vs making an offer with polling? Any disadvantages? Also, is there a way to create a real time trade with node-steam-tradeoffer-manager? I dont see anything in the docs about it.
  5. When I send an offer in response, I get a "Not Logged In". Tell me how to react properly in this situation or how to avoid it. Thank you.
  6. I found the opportunity to check the trade scums before accept deal, but for this I need to fire steam and parse the html. Perhaps there is another way? Thank you.
  7. 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?
  8. Hello, I was wondering if it's possible to cancel all outgoing offers at once? Thanks in advance.
  9. This is my code, how can know what will i be traded ? i want it to log it in the console manager.on('newOffer', (offer) =>{ console.log(magenta + ('Received 1 new offer') + white); console.log(magenta + offer.partner.toString() + white + ' offered their ' + magenta + offer.itemsToReceive + white + ' for our ' + magenta + offer.itemsToGive + white) }); with this code im receiving this in console
  10. Hi, I want to verify if a trade url belongs to an user, I have both the steamid64 and the trade url with access token. How would I do this without creating an offer and checking if the steamid64 I have matches offer.partner.getSteamId64();? Thanks
  11. Hello, I'm trying to use function getExchangeDetails, to get old asseit and new_assetid, but if I type offer.getExchangeDetails(function(err, receivedItems) { if(!err) { console.log("New items: " + receivedItems); console.log(receivedItems[0].new_assetid); console.log(receivedItems[0].assetid); } else { console.log("[ERROR] Loading offer items details."); } });the output is: 3 (But items count was 4, maybe 0 is number too) undefined or TypeError: Cannot read property '0' of undefined undefined or TypeError: Cannot read property '0' of undefined I don't know where is the mistake, somebody can explain to me, please? Thanks, Alex.
  12. its very simple, the event sentOfferChanged is instantly fired when the bot has received any item, but if wasnt, its fired only around 30 seconds later, so how can i make it faster when i wasnt received any item? if i have to wait always 30 seconds it may cause a bug in the future.. decrease the 30 seconds maybe a good idea, but may cause too many requests .. ?
  13. The bot do the logon() and webLogon() with sucess, and use methods like getUserInventoryContents() with no problems, but every time the bot try to accept a confirmation for a trade offer (acceptConfirmationForObject()), the event sessionExpired is fired, and the offer is not accepted, any idea of how can i fix and why is that happening? This is my code: var client = new SteamUser(); var community = new SteamCommunity(); var manager = new TradeOfferManager({ "steam": client, "language": "en", "community":community }); client.on('webSession', function(sessionID, newCookie) { log('Loading APIKey..'); community.setCookies(newCookie); manager.setCookies(newCookie, function(err){ if(err){ logError(err, "webSession"); return; } log('Got APIKey: '+manager.apiKey); }); }); community.on('sessionExpired', function(err) { log('sessionExpired!, WebRelogin..'); if(err){ logError(err, 'sessionExpired'); } client.webLogOn(); }); manager.on('newOffer', function(offer) { var partner=offer.partner.getSteamID64(); if(partner==admin){ log("New offer #" + offer.id + " from owner"); offer.accept(function(err, res) { if (err) { Message(admin, "Unable to accept offer: " + err.message); } else { if(res == "pending"){ community.acceptConfirmationForObject(identity, offer.id, function(err, responsecm){ if (err){ Message(admin, "" + err); return;} log("Offer accepeted!"); }); } else { log("Offer accepeted!"); } } }); } }); function makeOffer(target, itemsFromMe, itemsFromThem){ var offer = manager.createOffer(target); offer.addMyItems(itemsFromMe); offer.addTheirItems(itemsFromThem); offer.send(function(err, status) { if (err){ Message(target, ""+err); } if (status == 'pending') { community.acceptConfirmationForObject(identity, offer.id, function(err) { if (err) { logError(err, "acceptConfirmationForObject"); } else { Message(target, "Trade offer sent!!"); } }); } else { Message(target, "Trade offer sent!!"); } }); } the function Message, log, and logError is already defined and working fine, so i have no clue what is going on zZzZzZzz some help here
  14. Hi there, Is there a way to save sent offers to a file (save some needed information in it + the tradeoffer), that when this offer is accepted (or declined) that you run a block of code attached to this file ? As I see it now with the "receivedOfferChanged" you can only check if the offer is changed and do something with the steamid from the recipient. I want to run code which also use mySQL databases, so I need a way to save offers. If this is too much to ask it's alright. Thanks anyway ! Seeringfate
  15. Hello. How many times I can cancel offer? Is any limit? Steam doesn't ban my account? Thanks
  16. My donation functions were working without issue so I'm not sure what changed. That said here is my situation: * A user submits a trade offer (i.e. donation) - the trade WILL go through however the bot will then produce the following error (Illegal buffer). * Should the request not be a donation but an actual trade offer, the bot will correctly decline with no error. * Here is the pertinent portion of my code. I've commented out the 'offer.accept' at times just to verify that the error is produced at that point, it does. Any recommendations?
  17. This is my current project https://github.com/xLeeJYx/backpacktf-automatic-pro i plan to increase more functions on the bot My question is this : how do i make node-steamcommunity comment on profile's user when the trade succeded is there something like manager.on('succes'){ postUserComment(offer.partner.toString(), "Thanks for trading with me!") }
  18. steamUser.on('tradeOffers', function(c){ manager.getOffers(TradeOfferManager.EOfferFilter.ActiveOnly, function(err, sent, received){ if(err){ console.log(err); return; } received.forEach(function(offer){ console.log(offer.isGlitched()); var money_give = 0; if(!offer.itemsToGive){ offer.decline(); return; } console.log(offer.itemsToGive); offer.itemsToGive.forEach(function(item){ console.log(item.market_hash_name); market.getItemPrice(730, item.market_hash_name, function(err, data){ if(err){ console.log(err); return; } money_give += data.lowest_price; console.log(money_give); },9); }); }); }); }); What is wrong with this snippet? The item object's market_hash_name is returning undefinded. Any reason for why that might be? - https://github.com/DoctorMcKay/node-steamcommunity/wiki/CEconItem#market_hash_name
  19. function compareItems(offer){ var myItems=0; var yoItems=0; //need to get items "specialty" value and multiply by percent for (var index = 0; index < offer.itemsToGive.length; ++index) { var x= offer.itemsToGive[index].market_hash_name; var price=list[x].safe_price; console.log(x); console.log(price); if(price!=0){ myItems+=price; logger.info("Used v2 pricing"); } else{ // myItems+=list[x].7_days.average_price; steamlytics.csgo.prices(x, function(err, data){ if(err) logger.error(err); else{ myItems+=data.median_price; logger.info("Used regular price function"); console.log(data.median_price); } }); } } for (var index = 0; index < offer.itemsToRecieve.length; ++index) { var x= offer.itemsToRecieve[index].market_hash_name; var price=list[x].safe_price; console.log(x); console.log(price); if(price!=0){ yoItems+=price; logger.info("Used v2 pricing"); } else{ // myItems+=list[x].7_days.average_price; steamlytics.csgo.prices(x, function(err, data){ if(err) logger.error(err); else{ yoItems+=data.median_price; logger.info("Used regular price function"); console.log(data.median_price); } }); } } return myItems < yoItems; } I tried using the above code to run through an offer and compare the prices of each side. I get an error with the length property of the array itemsToGive/Recieve although in the API it is stated that they are arrays. I received the following error. I will attempt to do the same thing using a for-of or forEach loop. I will post again shortly with whatever happens. Thanks for reading EDIT: When I did a for-of loop it didn't give me errors, but nothing ever printed out, meaning the loop never ran. I'll look through the rest of my code to try and find why. This is my code
  20. Can I push item from bot inventory to Steam trade platform?
  21. Hello, I have been working on a trade bot. I set it up so that it will accept any trade from me(admin) or a donation(not giving items). So far it accepts all donations but is having issues accepting trades from me. I have made sure my SteamID in my config is SteamID64. According to the console output, it says the trade should have been accepted although it hasn't. Here's the console output and heres my code. Feel free to add me on steam if you think you can help. http://steamcommunity.com/id/swagattack835/ // Accept any trade offer from the bot administrator, or where we're getting free stuff. if (offer.partner.getSteamID64() === Config.admin || offer.itemsToGive.length === 0) { logger.info("User "+ offer.partner.getSteam3RenderedID() +" offered a valid trade. Trying to accept offer."); offer.accept(function (err) { if (err) { logger.error("Unable to accept offer "+ offer.id +": " + err.message); } else { logger.info("Offer accepted"); } }); Thanks, African
  22. Hello! Today I'm getting this error while accepting offers (incoming ones or the ones I create): Offer #XXXXXXXXX is not active, so it may not be accepted. Then, the only way I have to confirm the trade is using the mobile App and then stop the bot few hours to avoid this problem... but it persists. Waht does it mean is "not active"? How can I avoid it? Thanks for reading me!
  23. Can someone please send me a coding to a fully functional trade bot?
  24. Hello. Can you help me please? I have a problem with checking tradeoffer state This is what i use var tid = req.query['tid']; offers.getOffer({ tradeofferid: tid }, function(err, trade) { if(err) { logger.error('Error checking trade'); logger.debug(err); res.json({ success: false, error: err.toString() }); } else { if(trade.response.offer.trade_offer_state == 3) { res.json({ success: true, action: 'accept', result: 'Success' }); } else if(trade.response.offer.trade_offer_state == 7) { res.json({ success: true, result: 'Declined', action: 'cross' }); } else { res.json({ success: false, error: 'Not Accepted Yet' }); } } }); And it always gives me error: TypeError: Cannot read property 'trade_offer_state' of undefined but it is defined in your documentation. Thanks.
×
×
  • Create New...