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. Hey, I'm having trouble adding a certain amount of gems or gem sacks to a trade atm. I've managed to get the correct market_hash_name and inventory and can add gems/gem sacks to a trade, but it will add the entire stack of gems or sacks that is present in the inventory. manager.getUserInventoryContents(SENDER.getSteamID64(), 753, 6, true, (ERR, INV, CURR) => { } Any way to pass a parameter so that it will only add in 'x' number of gems/gem sacks. (gems/gem sacks are stackable items, not separate)
  2. Hi guys! How to send offer my friends, if i dont know partner trade url? var offer = manager.createOffer('[U:1:46143802]'); SteamID3 not working.
  3. Hello, once again, I am in the need of help. I have been trying for the last day or so to find a way to set a expire time for a single tradeoffer, as my bot will handle different offers, and some need to expire sooner than others. What would be the correct way of doing so? I have tried to modify the expire date without success.
  4. I am entirely new on java script and learning on day by day, i want to get on sending the items in a steam bots inventory. Sending it one by one and loops until the inventory is empty. Sorry for the trouble this might be spoon feeding the code to me, i can not get it undone its been lingering in my mind to post this, but i cant seem to do it because its kinda shameful, but i did it anyways. It will be a great help for my research. I just want somebody to modify the example code of the great doctormckay the offloader.js, in which it will send the items one by one and loops until the inventory is empty. Thank you in advance /** * 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('../lib/index.js'); // 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": "username", "password": "password", "twoFactorCode": SteamTotp.getAuthCode("sharedSecret") }; 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) { 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"); // Create and send the offer var offer = manager.createOffer("https://steamcommunity.com/tradeoffer/new/?partner=12345678&token=xxxxxxxx"); offer.addMyItems(inventory); offer.setMessage("Here, have some items!"); 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("identitySecret", 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), function() {}); }); /* * Example output: * * Logged into Steam * Got API key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx * Found 117 CS:GO items * Offer #1601569319 sent, but requires confirmation * Offer confirmed */
  5. I'm currently having competition in a little niche, and its all about beeing faster. For that reason I want to accept a tradeoffer asap after getting it. Here is my question: Is there anything that I can do to make manager.on('newOffer', function (offer) { //Just a function that has some logic, does pretty much just accept the offer as long as itemstogive.length ==0 accept(offer); }); faster? Or is this the fastest already. And how much delay is there between getting the offer, and this block of code realizing that a new offer came in? I can also post my full code if needed.
  6. Hi, After I use getInventoryContents I get an array of inventory objects. I want to be able to define a variable to determine how much items i send. For example: var amount = 5; offer.addMyItems(inventory[0 - 4]); var amount = 3; offer.addMyItems(inventory[0 - 2]);
  7. When call getInventoryContents(730, 2, true, function (err, myInv, currencies){ }); I received Error: Failure . Thanks !
  8. Hello, When I send offer i get error: "callback is not a function" in steam-tradeoffer-manager/lib/helpers.js in 45 line. That is my code: function sendOffer(customer, bot, customerItems, botItems) { var botInventory = manager.getUserInventoryContents(customer, 753, 6, true, function(err, inventory, currencies) { return inventory; }); var customerInventory = manager.getUserInventoryContents(bot, 753, 6, true, function(err, inventory, currencies) { return inventory; }); var Exchange = manager.createOffer(customer); var message = "Thank You for trading with me. Here's your cards. This offer expires in 10 minutes."; var ExchangeBot = GetExchangeItems(botInventory, botItems); var ExchangeUser = GetExchangeItems(customerInventory, customerItems); Exchange.addTheirItems(ExchangeUser); Exchange.addMyItems(ExchangeBot); Exchange.send(message, 'Dh58A2w', function(err, status) { console.log('Exchange ID:' + Exchange.id + ' send: ', status); }); } And I have second question. How to send offers to friends without token?
  9. Hello! I'm still on my challenge to avoid SteamApp (My Android device is quite bad, I know). Well. I'm trying to make a system for accept or decline manually incoming offers. I made the following code: manager.getOffers(1,function(err, sent, recived){ if (err) { console.log(err); } else { for (var i = 0; i < recived.length; i++) { if(recived[i].id == trade_I_want_to_decline){ recived[i].cancel(function(err) { if (err) { console.log(err.message); } else { console.log("Horray! trade declined!") } }); } } } }); //... Other unrelated code //... More unrelated code manager.getOffers(1,function(err, sent, recived){ if (err) { console.log(err); } else { for (var i = 0; i < recived.length; i++) { if(recived[i].id == trade_I_want_to_accept){ recived[i].accept(function(err) { if (err) { console.log(err.message); } else { console.log("Horray! Trade accepted!") } }); } } } }); Well. These are separated functions. As you can see, they are basically the same except the main function: Accept and Decline. Decline works like a charm. But accept... doesnt work well. In fact, it returns the "Horray! Trade accepted!" message, but it doesn't really accept the trade. Whay I'm missing? Did I need something more to make it work? Thanks for reading me and have a nice day!
  10. Is there any simple way to detect, that user that I want to trade with has tradeban or just cant get trades by any other reasin?
  11. Hello! I'm still on my challenge to avoid the SteamApp. I can send offers and check the incoming ones (retrieve all data, also, check the user profile). Now I have the interface done. But... is there a way to accept an offer by his own trade id? I looked into the wiki, but I didnt find a way to accept it by ID... only when I already have an "offer" object. Thnanks for reading me and happoy gaming!
  12. Function: manager.getUserInventoryContents(Trade.partner, 720, 2, true, (x, y, z) => {}); Error: k_EResultNoMatch Weird error, did exactly the same as I usually do and it does not seem to work.
  13. Can I set an item name instead of an assetID? If yes, how?
  14. So I've been making my bot and I came up with that I need to check item description for item within trade offer, I found this https://github.com/DoctorMcKay/node-steamcommunity/wiki/CEconItem#descriptions but item.descriptions & item.description doesn't seem to work. This is my part of the code: offer.itemsToReceive.forEach(function(item) { (this is the 388th line) if (item.appid == "my app ID" && item.type.match("My match")) { if(item.descriptions.match("my description match")){ return } This is the output: .js:388 if(item.descriptions.match("my description match we were talking about")){ ^ TypeError: item.descriptions.match is not a function
  15. Hello, I'd like to know if it is possible to somehow get every item's assetID(and maybe market hash name) by calling getInventoryContents. And if so, how? Thanks in advance!
  16. Error: connect ETIMEDOUT 104.94.55.49:443 I get this error really often and the bot just can't work after. Sometimes I get it to work normally, but then again it starts returning this error. I didn't have any problems in last at least 6 months with these kinds of errors. But I doubt I'm getting over the rate limit, since the API is different on each bot and the domain for login (I'm investigating if the login page is the issue). Do you have a suggestion where to start searching, because this is awful right now. Maybe someone has experienced similar issues with Steam? Last thing I install fail2ban and tweaked iptables, but to my knowledge it's not blocking this ip, and actually I tried a few times to connect with telnet and it worked from my machine.
  17. Hello again! On my challenge to avoid SteamApp now I'm trying to implement my own way to send and receive offers. Send offers now works fine now, but now I'm developing the incoming ones. I see the event "newOffer", which returns an object, "offer". Offers contains some interesting data, like trade's id, it's state, if scrow is enable.... but I have some questions 1- I see an "account id" field. I guess it's a steam3id. Is there a way to return a classic id for check the user profile? 2- I see a state field. Is an integer. Which are the possible status? 3- What is the difference between "id" and "tradeID"? I see id has the trade ID, but I don't know why tradeID is null... 4- How can I accept an offer by it's ID? 5- How can I check all incoming offers? Thanks for reading me and have a nice gaming! :D
  18. Hello, i found up that steam sometimes return status 8 after sending offer and change asset ids for sent items. My question is how to get new asset ids for this bugged offer? Is it possible to get it for this 1 offer or should i get whole inventory and check items that are not assigned to database and assign them by name?
  19. Hey, I see that there are already topics discussing this particular error, but most of them aren't including code examples. Tried to fix it myself, but it doesn't seem to work. So when accepting an offer, I sometimes get this error: Error: Not Logged In at SteamCommunity._checkCommunityError (/home/pi/Desktop/bot_final/node_modules/steamcommunity/components/http.js:128:9) at Request._callback (/home/pi/Desktop/bot_final/node_modules/steamcommunity/components/http.js:51:88) at Request.self.callback (/home/pi/Desktop/bot_final/node_modules/steamcommunity/node_modules/request/request.js:186:22) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7) at Request.<anonymous> (/home/pi/Desktop/bot_final/node_modules/steamcommunity/node_modules/request/request.js:1081:10) at emitOne (events.js:96:13) at Request.emit (events.js:188:7) at Gunzip.<anonymous> (/home/pi/Desktop/bot_final/node_modules/steamcommunity/node_modules/request/request.js:1001:12) at Gunzip.g (events.js:291:16)So to log in, I am using this: var config = require('./config.js'); var SteamCommunity = require('steamcommunity'); var SteamTotp = require('steam-totp'); var SteamUser = require('steam-user'); var TradeOfferManager = require('steam-tradeoffer-manager'); var community = new SteamCommunity(); var client = new SteamUser(); var manager = new TradeOfferManager({ steam: client, domain: 'example.com', language: 'en' }); client.logOn({ accountName: config.username, password: config.password, twoFactorCode: SteamTotp.generateAuthCode(config.sharedsecret) }); client.on('loggedOn', function(details) { console.log("Bot logged in"); client.setPersona(SteamUser.Steam.EPersonaState.Online,config.botname); }); client.on('webSession', function(sessionID, cookies) { manager.setCookies(cookies, function(err) { if (err) return console.log(err); console.log(" > Got API key!"); }); community.setCookies(cookies); community.startConfirmationChecker(10000, config.identitysecret); })And to keep the bot from coming up with the "Not logged in error", I added this (which obviously doesnt work). var lastLoginAttempt = Date.now(); client.on("sessionExpired", function(err) { if(Date.now() - lastLoginAttempt > 30000) { lastLoginAttempt = Date.now(); console.log(" > Session Expired, relogging."); client.webLogOn(); } else { console.log(" Session Expired, waiting a while before attempting to relogin."); } });I was told to add a "timer" so it doesn't spam the login when the websession expires. Any idea why it doesn't work? Is client.webLogOn() the right way to log in again? Any help is appreciated!
  20. Hello. I have been trying to load my bot inventory, but it have been too slow, first i though it was my internet because its very bad but then i tried to test using the request module and it got the inventory in 1 second. I have tried loading my tf2 inventory too and it worked fine. These are the codes i used to test it: Testing the manager.getUserInventoryContents: console.time("Load Inventory"); setTimeout(function(){ log.warn("Timeout") }, 60000); manager.getUserInventoryContents("76561198355595262", 753, 6, true, function(err, inventory){ if(err) log.error(err); else { console.timeEnd("Load Inventory") } }) Output: Timeout. Inventory never loaded and this is the code with request: var url = "http://steamcommunity.com/inventory/76561198355595262/753/6?l=english"; console.time("Load Inventory") request(url, function(err, response, body){ if(!err && response.statusCode === 200){ console.log(body) console.timeEnd("Load Inventory") } }); Output: inventory and 1017ms Am i doing something wrong?
  21. Hello everybody! I'm tormented by the question .. How do I restart the session? (Outputs "Error: Not Logged In")
  22. I was wondering if there is a way to use the getInventoryContents method, but only to get the items that are not currently in a trade. At first I thought the 'tradableOnly' parameter would do the trick. However, I think I was wrong. Thanks for the help.
  23. I tried to init TradeOfferManager with option {language: "cn"} and "ch", but getInventoryContents function still remain english name and describe. How can i get chinease content?
  24. Would it be possible to recognize card by their game? So you would be able to see them as sets. I don't think this feature exists. And if it exists how do I use it?
  25. What can be the reason that the offer.accept(function... doesn't work at all anymore after some time? I know that I get until there, because of console logs that I've put before that. The first thing that happens inside is also another console.log, but this one doesn't fire at all anymore. Since I really don't see whats wrong in my code, I hope that I can get some ideas from here. Keep up the great work! <3 mar71n
×
×
  • Create New...