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. Hello, I'm need cancel offer from offerID, this is my code: manager.getOffer(row.offer_id, function(offer, err) { console.log(offer + ", " + row.offer_id); if(!err) { offer.cancel(); console.log("[ERROR] Offer canceled"); //Delete record from MySQL } else { console.log("[ERROR] With cancel offer" + err); } }); The output: null, 1717716013 [ERROR] With cancel offer [object Object] Where I do mistake ? Because I'm getting error.
  2. Hey, i got this error "Malformed response" when tryed to accept items. What does that mean and how prevent it? Thank you for any reply
  3. hi, I am getting this error when i send offer via bot with items from bot inventory- There was an error sending your trade offer. Please try again later. (26) But when i send offer again via bot with item from other's inventory- it works perfectly fine. Please help me here as way of sending offer is same in both case except itemstogive and itemstoreceive value in offer.
  4. Hi, after 5 minutes when bots logged in then get error when trying to send offer Error: HTTP error 401. self.steamCommunity.on('sessionExpired', function() { self.steamClient.webLogOn(); }); setInterval(function() { self.steamClient.webLogOn(); }, 1800000); I have this to make sure that bot didint logged out. When i restart bots and they logged in its works again for another 5 minutes and http error 401. Whats wrong?
  5. Alright so the title says it all, i'm fairly new to Steam bots. I'm trying to make it so it only accepts CSGO keys i know the code below is horrible, but if someone could point me in the right direction it would help a lot. offers.on('newOffer', function (offer) { console.log("New offer #"+ offer.id +" from "+ offer.partner.getSteam3RenderedID()); // Accept any trade offer from Admin. if (offer.partner.getSteamID64() === config.admin && appid === appid.CSGO){ console.log("ADMIN offered a trade. Trying to accept offer."); offer.accept(function (err) { if (err) { console.log("Unable to accept offer "+ offer.id +": " + err.message); } else { console.log("Offer accepted because ADMIN sent the offer"); } }); } else { //Otherwise deny it and message the user console.log("User "+ offer.partner.getSteam3RenderedID() +" offered an invalid trade. Declining offer."); offer.decline(function (err) { if (err) { console.log("Unable to decline offer "+ offer.id +": " + err.message); } else { console.log("Offer declined"); // Message the user client.chatMessage(offer.partner.getSteamID64(), "Invalid offer."); } }); } }); I know it also only accepts if its the admin, that's just for testing.
  6. Hi, after a time, i get Errors like the Bot is not logged in. data: bot.js:10784 - Error: Not Logged In from offer.getUserDetails or that data: bot.js:10784 - Unable to accept offer: Malformed JSON response data: bot.js:10784 - Unable to accept offer in retry: Malformed JSON response when he will accept the offer... What can i do there? i tried to make this again, but dont work client.on('webSession', function(sessionID, cookies) { manager.setCookies(cookies, function(err) { if (err) { console.log(err); process.exit(1); return; } console.log("Got API key: " + manager.apiKey); }); community.setCookies(cookies); community.startConfirmationChecker(30000, "SECRET"); });
  7. Im getting this error "ReferenceError: manager is not defined" when I try to start a trade. This is where its saying the error is, not sure if I used this properly. Also below is my code so far some of its hard coded for testing. Im using socket.io to send trades from client to server side. var offer = manager.createOffer('https://steamcommunity.com/tradeoffer/new/?partner=113526536&token=xxxxxxxx'); /* Socket Setup Start -creating vars -creating server */ var http = require("http"); var fs = require("fs"); var io = require('socket.io').listen(8000); function genericRspnd(request, response){ response.writeHead(200, {'Content-Type':'text/html'}); response.end(fs.readFileSync('inv.php')); //place user on socket } /* Socket Setup End */ //actual steam-sided bot var SteamUser = require("steam-user"); var SteamTotp = require("steam-totp"); var TradeOfferManager = require("steam-tradeoffer-manager"); var SteamCommunity = require("steamcommunity"); //general npms var manager = new TradeOfferManager({ "language": "en", "domain": "http://94.23.58.154/", "pollInterval": "10000" }); var community = new SteamCommunity(); var client = new SteamUser(); client.logOn({ accountName: CONFIG.USERNAME, password: CONFIG.PASSWORD, twoFactorCode: SteamTotp.getAuthCode(CONFIG.SHAREDSECRET) }); client.on("loggedOn", (details, parental) => { client.getPersonas([client.steamID], (personas) => { console.log("## Logged in as #" + client.steamID + " (" + personas[client.steamID]["player_name"] + ")"); }); client.setPersona(1); }); client.on("webSession", (sessionID, cookies) => { manager.setCookies(cookies, (err) => { if (err) { console.log("## An error occured while setting cookies."); } else { console.log("## Websession created and cookies set."); } }); community.setCookies(cookies); community.startConfirmationChecker(10000, CONFIG.IDENTITYSECRET); }); //create cookies community.on("sessionExpired", (err) => { community.stopConfirmationChecker(); console.log("## Session Expired, relogging."); client.webLogOn(); }); }); /* How this bot will work : 1) recieves all the information via sockets 2) creates offer with tradeurl 3) adds the persons' items via the assetid 4) adds our items via the assetid 5) sets trade offer message 6) sends trade offer, if everything goes well it will log the trade offer id and the status */ io.sockets.on('connection', function (client){ console.log("A user connected to the website"); client.on('tradeOffer', function (steamid, assetid) { console.log("Recieved a trade request from : " + steamid + "." ); var offer = manager.createOffer('https://steamcommunity.com/tradeoffer/new/?partner=113526536&token=qx0l3qae'); offer.addTheirItem({"appid": 730, "contextid": 2, "assetid": 8251852579}); //offer.addMyItem({"appid:730", "contextid": 2, "assetid": myId}); offer.setMessage("Thank you for trading with us!"); offer.send(function (err, status){ if (err) { console.log(err); return; } else { console.log("Trade offer #" + offer.id + " "+ status ); } }); });
  8. Hello. What I Sholud do when I have this error : Couldn't get received items: Error: ETIMEDOUT I have big problem with this error because I can't ADD recived items to database. Error happens sometimes, not every time. Could someone have any ideas.
  9. Maybe I'm doing something wrong but I am trying to use friends.sendMessage(offer.partner, "message"); to send a message to the person who sent a trade offer and let them know it was accepted or why it was declined. If I use friends.sendMessage("mysteamID", "message"); and replace mysteamID with my actual steamID the message gets sent to me correctly. However with offer.partner they never receive a chat message.
  10. Hello I'm trying to make some kind of withdrawing system. And i want to send a single specific item but I don't get how I'm just able to add all items like in the example pls can you explain it to me /** * OFFLOADER * * Once logged in, sends a trade offer containing this account's entire tradable CS:GO inventory. */ var SteamUser = require('steam-user'); var SteamCommunity = require('steamcommunity'); var SteamTotp = require('steam-totp'); var TradeOfferManager = require('steam-tradeoffer-manager'); // use require('steam-tradeoffer-manager') in production var fs = require('fs'); var client = new SteamUser(); var manager = new TradeOfferManager({ "steam": client, // Polling every 30 seconds is fine since we get notifications from Steam "domain": "example.com", // Our domain is example.com "language": "en" // We want English item descriptions }); var community = new SteamCommunity(); // Steam logon options var logOnOptions = { "accountName": "----", "password": "---", "twoFactorCode": SteamTotp.getAuthCode("----") }; if (fs.existsSync('polldata.json')) { manager.pollData = JSON.parse(fs.readFileSync('polldata.json')); } client.logOn(logOnOptions); client.on('loggedOn', function() { console.log("Logged into Steam"); client.setPersona(SteamUser.Steam.EPersonaState.Online); }); client.on('webSession', function(sessionID, cookies) { manager.setCookies(cookies, function(err) { if (err) { console.log(err); process.exit(1); // Fatal error since we couldn't get our API key return; } console.log("Got API key: " + manager.apiKey); // Get our inventory manager.loadInventory(730, 2, true, function(err, inventory) { if (err) { console.log(err); return; } if (inventory.length == 0) { // Inventory empty console.log("CS:GO inventory is empty"); return; } console.log("Found " + inventory.length + " CS:GO items" + inventory); // Create and send the offer var offer = manager.createOffer("------"); offer.addMyItem(inventory); offer.setMessage("You opened you advent calendar, here is your item!"); offer.send(function(err, status) { if (err) { console.log(err); return; } if (status == 'pending') { // We need to confirm it console.log(`Offer #${offer.id} sent, but requires confirmation`); community.acceptConfirmationForObject("-------", offer.id, function(err) { if (err) { console.log(err); } else { console.log("Offer confirmed"); } }); } else { console.log(`Offer #${offer.id} sent successfully`); } }); }); }); community.setCookies(cookies); }); manager.on('sentOfferChanged', function(offer, oldState) { console.log(`Offer #${offer.id} changed: ${TradeOfferManager.ETradeOfferState[oldState]} -> ${TradeOfferManager.ETradeOfferState[offer.state]}`); }); manager.on('pollData', function(pollData) { fs.writeFile('polldata.json', JSON.stringify(pollData)); }); /* * Example output: * * Logged into Steam * Got API key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx * Found 117 CS:GO items * Offer #1601569319 sent, but requires confirmation * Offer confirmed */Thx for your help
  11. I set everything up and it all seemed to be working great but then I decided I would like to make my script accept any trade offers that come from my own personal steam account (SteamID) this is so I can send a request for an item and move it from my bot accounts inventory to my other accounts inventory. While accepting normal trades work fine, accepting a trade witch only sends items and does not receive items returns a status of pending and the offer is never accepted. Is this normal? How would I go about accepting any offers send from my own SteamID no matter what items the trade is for.
  12. Hello. Why I get two diffrent assetid from getReceivedItems and LoadInventory? here is my code sample: manager.on('sentOfferChanged', function(offer, oldState) { if(offer.state == TradeOfferManager.ETradeOfferState.Accepted) { offer.getReceivedItems(function(err, items) { items.some(function(item) { //here save item.assetid to database. } } } }); Next I do: manager.loadInventory(730, 2, true, function(err, inventory, currencies) { //here I get saved asseid from database and loadInventory //item.asset_id is row from database inventory.forEach(function(gun) { gun.id, item.asset_id // all elements in inventory are always different but should be this same. if(gun.assetid == item.asset_id) }); Could someone tell me any tip?
  13. offers.getOffers(1, null, function (err, sent){ if(err) throw err; console.log(sent); console.log(sent.partner) console.log(offers.id) console.log(offers.partner) }); Can you help me i want the partner of the offer.
  14. Hello everyone! This might have been answered before, but I tried to find it everywhere, but I'm still not 100% sure. I'd like to use my bot with trade offers, however when I try to set the cookies for the tradeoffer-manager, it fails. I'm pretty sure this has to do with my limited account, since it is unable to fetch an API Key. So I'd like to be 100% sure, before I put some money into Steam: Do I need to get rid of the limited status of my account before I can fully use the trade offers? (and is this because we can't fetch the API Key and therefore we can't set the cookies?) Thanks for your help and I hope that this question will help some other people out as well who were just curious or had the same question.
  15. createNewOffer(data.tab_skins, data.tradelink, data.token, function(offer, tk) { offer.send('New Offer', 'RafVO0qA', function(error, csgo) { if (error) { console.log(error); } else { console.log(csgo); } }); }); callback(error); ^ TypeError: callback is not a function offer return object with all data. But I can't send an offer.
  16. Hi there. I found a code from gihub and idk if it is working... because it doesnt do anything. user.on('inventory', function (backpack, craft, err) { var inventory = backpackLoaded var random_refined = getRandomRefinedID(inventory); tf2.craftItems([random_refined]); // will smelt first refined found in the inventory setTimeout(function() { steamTrade.loadInventory(440, 2, function(inventory1) { // reload inventory console.log("loaded new inventory 1"); if (JSON.stringify(inventory1) !== JSON.stringify(inventory)) { // if inventory has changed console.log("got the new backpack!"); var random_reclaimed = getReclaimedIDs(inventory1, inventory); //get the id of a reclaimed smelted before tf2.craftItems([random_reclaimed]); // smelt it to a scrap setTimeout(function() { steamTrade.loadInventory(440, 2, function(inventory2) { // reload inventory console.log("loaded new inventory 2"); if (JSON.stringify(inventory2) !== JSON.stringify(inventory1)) { // if inventory has changed console.log("Yes, new backpack!"); inventory = inventory2; } else { console.log("oh no , still the old one"); } }); }, 10000); } else { console.log("still as the old one :("); } }); }, 10000); })
  17. Hi. I was able to send trade offers just fine a while ago, I keep getting errors that this json is malformed. The only malformed parts I find are quotes and commas. What is wrong with this? TradeOffer { partner: SteamID { universe: 1, type: 1, instance: 1, accountid: 306671577 }, id: null, message: 'Trade Offer WITH Trade Bot', state: 1, itemsToGive: [ { assetid: '7806227681', appid: 730, contextid: '2', amount: 1 } ], itemsToReceive: [ { assetid: '2624718494', appid: 753, contextid: '6', amount: 1 } ], isOurOffer: true, created: null, updated: null, expires: null, tradeID: null, fromRealTimeTrade: false, confirmationMethod: null, escrowEnds: null, rawJson: '' }
  18. Hi guys, my bot is accepting a Trade, but says Error Unable to accept offer: Cannot load new trade data: Data temporarily unavailable After accepting, receivedOfferChanged dont run and check if accepted. But the tradeoffer was accepted... What is this? :/
  19. Is there a way to kick off auto confirmations with the node steam tradeoffer manager instead of creating another steam-community instance? Reading through the docs it says tradeoffer-manager creates a node-steam-community by default if an instance isn't applied to the constructor. If that's the case - but I didn't see any prototype functions that allow for this functionality. The use case scenario is to auto confirm trades with my bot when I send users item requests. Thanks!
  20. After reading through this https://dev.doctormckay.com/topic/332-identifying-steam-items/ I got the impression that an assetId/Id is always unique. However, after trading items between bots I realize that this asset Id changes after a trade. Is this correct? If so how can I track items, uniquely, across trades? Example scenario... I trade a gutknife doppler knife in csgo to my bot and a few other people trade the same type of knife to my bot, all with the same wear. How do I know which doppler knife was mine if the asset Id changes?
  21. console.log("New offer #" + offer.id + " from " + offer.partner.getSteamID64()); offer.getUserDetails(function(err,me,them){ }) Error: Malformed response, next 10 seconds trade offer change state 2 -> 7. Thanks Previously, it was all good https://github.com/DoctorMcKay/node-steam-tradeoffer-manager/issues/181
  22. So, I'm currently working on developing a trading bot for my website, instead of letting someone else do it, as there's only one way to gain experience. So far I have managed to do somewhat of a decent job, it works. But I have come to a point where I would need to do so it does not trade with users that are in escrow. This should preferably be checked during the process of making the offer. I have read, and tried what have been given in this thread - https://dev.doctormckay.com/topic/623-decline-trade-hold/ - but have reached the point of where I'm unsure of what to do, and seeking help from someone who have more knowledge than me with this. So I hope there's someone who's able to help, or point me in the right direction. Thanks in advance.
  23. Hello i want a in-bot convertor by example if I type: 10.11 it will answer 10 REFS and 0 REC and 1 SCRAP. How can I do this please reply me ;(..
  24. Hi, i've been trying to send trade offers in loop every time it blows. Here is what im doing in theory: im reading some valuables from local text file such as my items assetid, tradelinks and market hash name of item that i want to add trade. then im creating offers in loop and sending them. i tried to sleep in loop and so many things every time it gives error. in code : var SteamUser = require('steam-user'); var SteamCommunity = require('steamcommunity'); var SteamTotp = require('steam-totp'); var TradeOfferManager = require('steam-tradeoffer-manager'); var fs = require('fs'); var client = new SteamUser(); var manager = new TradeOfferManager({ "steam": client, "domain": "google.com","language": "en" }); var community = new SteamCommunity(); // Steam logon options var logOnOptions = { "accountName": "***", "password": "****", "twoFactorCode": SteamTotp.getAuthCode("sharedSecret")}; var lineReader = require('readline').createInterface({ input: require('fs').createReadStream('trd.txt')}); var lines=[]; var i,text,q; var itmName,myitmid; i = 0; q=0; // so far so good lineReader.on('line', function (line) {lines[i]=line;console.log(i+". trd :"+lines[i]);i++;}); lineReader2 = require('readline').createInterface({ input: require('fs').createReadStream('nm.txt')}); lineReader2.on('line',function (line2){ itmName =line2; console.log("itmName :"+itmName);}); lineReader3 = require('readline').createInterface({ input: require('fs').createReadStream('myitm.txt')}); lineReader3.on('line',function (line3){ myitmid =line3;console.log("myitmid :"+myitmid);}); //end reading if (fs.existsSync('polldata.json')) { manager.pollData = JSON.parse(fs.readFileSync('polldata.json'));} client.logOn(logOnOptions); client.on('loggedOn', function() { console.log("Logged into Steam");}); client.on('webSession', function(sessionID, cookies) //right here it begins { for(q = 0; q<lines.length-1;q++)//creating loop { manager.setCookies(cookies, function(err) { console.log("//////////"); console.log("q : "+q); console.log(lines[q]); console.log("\\\\\\\\\\"); //used this because it reads all links but tries to send just lastone if (err){console.log(err);process.exit(1);return;} var linqs = getstID(lines[q]);//getting the userid from tradelink cItmId = getInv(linqs);//getting asset id of item if(cItmId !== false && cItmId !== "undefined")//checking the value before send offer { sndTrade(myitmid,cItmId,lines[q]); } else { console.log("false"); } }); community.setCookies(cookies); } }); manager.on('sentOfferChanged', function(offer, oldState){console.log(`Offer #${offer.id} changed: ${TradeOfferManager.ETradeOfferState[oldState]} -> ${TradeOfferManager.ETradeOfferState[offer.state]}`);}); manager.on('pollData', function(pollData){fs.writeFile('polldata.json', JSON.stringify(pollData));}); function getstID(st)//that function gets the userid from tradelink { var ll = st.substring(st.indexOf("=")+1,st.indexOf("&")); ll = "[U:1:"+ll+"]"; return ll; } function getInv(sTeamID)//that func returns the assetid { manager.loadUserInventory(sTeamID,730,2,false,function(err,inventory) { console.log("envanter yükleniyor"); if(err) { console.log("[WARNING]: Couldn't load inventory of " + sTeamID + "!"); } else { console.log(sTeamID+"envanteri yüklendi"); for (var p = 0;p<inventory.length;p++) { if(inventory[p].market_hash_name == itmName) { console.log("item bulundu"); return inventory[p].assetid; } else { console.log(sTeamID+"Item bulunamadı"); return false; } } } }) } function sndTrade(mnItm,cItm,trdLink)//that creates the offer. { var offer = manager.createOffer(trdLink); offer.addMyItem({"assetid":mnItm,"appid":730,"contextid":2}); offer.addTheirItem({"assetid":cItm,"appid":730,"contextid":2}); offer.send(function(err,status) { if (err) {console.log(err);return;} if (status == "pending"){console.log("offer #${offer.id} sent, but reqires confirmation.");} }); } i've tried without/with functions, tried to log every value to check up.
  25. Hi. I've got some ideas about setting up some quota to some items, so that i won't overstock. Is there something I need to do with backpack or only the offer manager?
×
×
  • Create New...