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

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. Good afternoon, I need my account # 1 to load inventory and send it to my account # 2. Is it possible to implement this? Tell me please. Now I'm doing authorization, it seems to work. 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 request = require('request'); var async = require('async'); var client = new SteamUser({ "dataDirectory": null // Kasutame oma sentry-t. }); var manager = new TradeOfferManager({ "steam": client, "domain": "skins.ee", "language": "en" }); var community = new SteamCommunity(); var steamID = SteamCommunity.SteamID; if(fs.existsSync('./users/users.json') && fs.existsSync('./users/master_ssfn')) { var users = JSON.parse(fs.readFileSync('./users/users.json')); var sentry = fs.readFileSync('./users/master_ssfn'); } else { console.log("Users file or master ssfn missing. Exiting.."); process.exit(1); } var user = users.thor1; var user2 = users.thor; var logOnOptions = { "accountName": user.accountName, "password": user.password, "twoFactorCode": SteamTotp.getAuthCode(user.twoFactorCode) }; var logOnOptions = { "accountName": user2.accountName, "password": user2.password, "twoFactorCode": SteamTotp.getAuthCode(user2.twoFactorCode) }; if(fs.existsSync('./polls/' + user.accountName + '.json')) { manager.pollData = JSON.parse(fs.readFileSync('./polls/' + user.accountName + '.json')); } if(fs.existsSync('./polls/' + user2.accountName + '.json')) { manager.pollData = JSON.parse(fs.readFileSync('./polls/' + user2.accountName + '.json')); } client.setSentry(sentry); client.logOn(logOnOptions); client.on('loggedOn', function() { console.log("Logged into Steam account " + user.accountName); }); client.on('loggedOn', function() { console.log("Logged into Steam account " + user2.accountName); }); 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 + " for user " + user.accountName); }); community.setCookies(cookies); community.startConfirmationChecker(30000, user.identitySecret); // Checks and accepts confirmations every 30 seconds client.setPersona(SteamUser.Steam.EPersonaState.Online, user.personaName); sessionInterval(3600000); }); 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 + " for user " + user2.accountName); }); community.setCookies(cookies); community.startConfirmationChecker(30000, user2.identitySecret); // Checks and accepts confirmations every 30 seconds client.setPersona(SteamUser.Steam.EPersonaState.Online, user2.personaName); sessionInterval(3600000); }); manager.on('newOffer', function(offer) { var steamID64 = offer.partner.getSteamID64(); console.log('Received new offer from ' + steamID64); if(steamID64 == "76561198099243226","7656119826044197","76561198376145647","76561198828998292","76561198828975623","76561198824853703","76561198824809848","76561198824795016") { offer.accept(); } else { offer.decline(); } }); manager.on('pollData', function(pollData) { fs.writeFile('./polls/' + user.accountName + '.json', JSON.stringify(pollData)); }); function sessionInterval(time) { setTimeout(function() { console.log('Getting new cookies.'); client.webLogOn(); }, time); } /** * Express API to access SteamBot features and functions */ var express = require('express'); var app = express(); var bodyParser = require('body-parser'); app.use(bodyParser.json()); // for parsing application/json app.use(bodyParser.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded app.get('/', function(req, res) { res.send('"Иди в дом, там мама тебе нальёт томатного." - Энди Картрайт'); }); app.listen(1337, function () { console.log('Express API listening on port 1337'); });
  2. Hi, I'm trying to get the assetid after the sentOfferChanged notices an accepted error, the code that I'm currently using logs the old assetid (at least thats what I think) instead of the new one. What seems to be the issue? Should offer.itemsToReceive be changed to something else, as this basically says ToReceive as in still have to get as in these assetids will not be updated? Code: manager.on('sentOfferChanged', function(offer) { var state = offer.state; //check for deposit or witrhdrawl, if withdrawl refund to their inventory. if(state === 3){ console.log('[SteamBot] A sent offer was accepted.'); var items = offer.itemsToReceive, user = offer.partner.getSteamID64(), socket = server.getSocket(user); items.forEach(function(item){ database.query('INSERT INTO `inventories` SET `assetid` = ' + database.pool.escape(item.assetid) + ', `market_hash_name` = ' + database.pool.escape(item.market_hash_name) + ', `user` = ' + database.pool.escape(user) + ', `image` = ' + database.pool.escape(item.icon_url) + ', `status` = 1, `bot` = ' + database.pool.escape(data.id), function(error, call) { if(error){ return; } }); }); server.showAlert(socket, 'success', 'Transaction was successfully completed.'); } }); Thanks in advance.
  3. I tried loading the inventory of my bot, and the Econitem objects doesn't have the owner_descriptions array, has it been recently changed? Thank You
  4. manager.on('newOffer', function(offer) { console.log("New offer #" + offer.id + " from " + offer.partner.getSteamID64()); if (offer.partner.getSteamID64() === config.ownerID) { 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 client.chatMessage(offer.partner.getSteamID64(), "Thanks for trade with me"); console.log("Offer accepted"); } }) } else { offer.decline(function(err) { if (err) { console.log("Unable to decline offer: " + err.message); } else { community.checkConfirmations(); // Check for confirmations right after declineing the offer client.chatMessage(offer.partner.getSteamID64(), "Sorry, I'm not ready to trade with you yet"); console.log("Offer decline"); } }) } }); when i gave my bot one skin,it's can accept. when i take this skin back it's can't work. it just don't confirmations the offer,but told me Thanks for trade with me,and i can see Offer accepted on console. same code can work before yestarday,but it can't work now
  5. Heyo, I've been looking to load someones inventory, I'd like to get the contents and send them over to the server, would the following way be a good way to load someones inventory? Would I be needing to cache their inventories? var request = require('request'); request('https://steamcommunity.com/inventory/x/578080/2', function(error, response, body) { if(error){ console.log(error); return; } var inventory = JSON.parse(body); inventory.descriptions.forEach(function(data){ console.log(data.market_name); }); });Also, would I not just be able to load someones inventory using manager.getUserInventoryContents to load their inventories without having to cache anything?
  6. Hello am trying to reduce the memory footprint of my bot. it's hitting 4-6gb at times quite high. Most of it happens on inventory loading so my idea was if there was a way to load the inventory page by page and store the data in files rather than server memory is there anything in this that can load an inventory page by page?
  7. Please help with my problem. I do not know why the 'appid' is not defined Stack trace: Logged into Steam /Users/user/Documents/node/steam/node_modules/steam-tradeoffer-manager/lib/classes/TradeOffer.js:419 if (typeof details.appid === 'undefined' || typeof details.contextid === 'undefined' || (typeof details.assetid === 'undefined' && typeof details.id === 'undefined')) { ^ TypeError: Cannot read property 'appid' of undefined at addItem (/Users/user/Documents/node/steam/node_modules/steam-tradeoffer-manager/lib/classes/TradeOffer.js:419:20) at TradeOffer.addTheirItem (/Users/user/Documents/node/steam/node_modules/steam-tradeoffer-manager/lib/classes/TradeOffer.js:374:9) at manager.loadUserInventory (/Users/user/Documents/node/steam/project4.js:80:12) at SteamCommunity.<anonymous> (/Users/user/Documents/node/steam/node_modules/steamcommunity/components/users.js:331:5) at Request._callback (/Users/user/Documents/node/steam/node_modules/steamcommunity/components/http.js:67:15) at Request.self.callback (/Users/user/Documents/node/steam/node_modules/request/request.js:188:22) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7) at Request.<anonymous> (/Users/user/Documents/node/steam/node_modules/request/request.js:1171:10) at emitOne (events.js:96:13) Code: function sendRandomItem() { const partner = 'partner_code'; const appid = 730; const contextid = 2; const offer = manager.createOffer(partner); manager.loadInventory(appid, contextid, true, (err, myInv) => { if (err) { console.log(err); } else { const myItem = myInv[Math.floor(Math.random() * myInv.length - 1)]; offer.addMyItem(myItem); manager.loadUserInventory(partner, appid, contextid, true, (err, theirInv) => { if (err) { console.log(err); } else { const theirItem = theirInv[Math.floor(Math.random() * theirInv.length - 1)]; offer.addTheirItem(theirItem); offer.setMessage(`Will you trade your ${theirItem.name} for my ${myItem.name}?`); offer.send((err, status) => { if (err) { console.log(err); } else { console.log(`Sent offer. Status: ${status}.`); } }); } }); } }); }
  8. Here is the actual code and here is the trigger. The idea is that the bot will send the item I selected, but it deosn't. and the worst part is that it doesnt log any errors, can you help me understand my mistake, if I did any? Manager version is 2.9.3
  9. Is there anyway to open a booster using this script? and if not any idea how i would go about doing that ?
  10. After the last steam update items after csgo successfull trade become unavailable to trade during 7 days period. If there is any opportunity to get field "owner_descriptions" from my inventory to know when the item is gonna be tradable(data time)?
  11. I want to get the other language of these items' market_hash_name I have tried to set TradeOfferManager's language property, but it doesnt work. So can you give one way to make it.. I think need to set manager.createOffer("xxxxx&language=schinese") like this? Very appreciate.
  12. hello, is it possible to get summary in trade how much backgrounds and emoticons are worth in amount of gems? something like this: if you receiving trade offer with steam backgrounds & emotes & trading cards to see how much these items are worth in gems?
  13. Hello, I've been using the trade offer manager for a while, and I noticed when I put the getReceivedItems the actions array is empty, but when I try to pull the same item from the inventory(which is now at my inventory) the actions array is not empty? is this a bug or am I doing something wrong? Thank you!
  14. When i receive offer . I get market_hash_name using offer.itemsToReceive[0].market_hash_name But when i using offer.getReceivedItems(function (err, items) { //Why items[0].market_hash_name !== offer.itemsToReceive[0].market_hash_name } It only happen when i received item in game PUBG (example item with market_hash_name: 'Combat Pants (camo)' ) Thanks !
  15. When I send 2 offers at the same time (Delta of 0-2 seconds) bot SOMETIMES ignore second offer and not fire `newOffer`. Its fired later when some other event is fired (next `newOffer`, or some of `OfferChanged` events)
  16. I'm trying to make a function, which gets called when the specified command is entered. function code: function tradecases(botid, senderid) { var appid = 730; var contextid1 = 2; bots[botid].offers.loadUserInventory(senderid, appid, contextid1, true, (err, theirInv) => { if (err) { logger.error(err); } else { var theirItem = theirInv bots[botid].offers.offer.addTheirItems({ 'appid': appid, 'contextid': contextid1 }); bots[botid].offers.offer.setMessage('This is an automated tradeoffer for all your trading cards. You can change it if you want.'); bots[botid].offers.offer.send((err, status) => { if (err) { logger.error(err); } else logger.info('sent offer status: ' + status); }); } }); } Error (error shows up in CMD): verbose: [B1] Received message from non-botadmin: !casedonate F:\va\Steam bots\main.js:240 bots[botid].offers.offer.addTheirItems({ ^ TypeError: Cannot read property 'addTheirItems' of undefined at bots.(anonymous function).offers.loadUserInventory (F:\va\ Steam bots\main.js:240:44) at SteamCommunity.<anonymous> (F:\va\node_modules\steamcommun ity\components\users.js:342:5) at Request._callback (F:\va\node_modules\steamcommunity\compo nents\http.js:67:15) at Request.self.callback (F:\va\node_modules\request\request. js:186:22) at Request.emit (events.js:180:13) at Request.<anonymous> (F:\va\node_modules\request\request.js :1163:10) at Request.emit (events.js:180:13) at IncomingMessage.<anonymous> (F:\va\node_modules\request\re quest.js:1085:12) at Object.onceWrapper (events.js:272:13) at IncomingMessage.emit (events.js:185:15) Could someone maybe give me advice, help, suggestions on how to fix this error? Extra info: Bots log in perfectly, nothing goes wrong. Bots are online. There is a second command like this but that one is meant for steam trading cards. This command has the same issues. All help is appreciated <3
  17. Hi, I'm trying to get all of the Received offers that are active. I read here about the function https://github.com/DoctorMcKay/node-steam-tradeoffer-manager/wiki/TradeOfferManager#getoffersfilterhistoricalcutoff-callback but I don't think I'm using the time object right. Here is my code: https://pastebin.com/SZcx0dwn What's the right way to do that?
  18. Hello, I'm trying to build a tradebot which creates offers with keys in it and I only want CSGO case keys, no capsule keys. Is there any other way then checking the tags on an item? The capsule and case keys both look the same there... tags: [ { internal_name: 'CSGO_Tool_WeaponCase_KeyTag', name: 'Key', category: 'Type', color: '', category_name: 'Type' }, { internal_name: 'normal', name: 'Normal', category: 'Quality', color: '', category_name: 'Category' }, { internal_name: 'Rarity_Common', name: 'Base Grade', category: 'Rarity', color: 'b0c3d9', category_name: 'Quality' } ] I can check the 'market_hash_name' if it contains 'Capsule' but that's kinda dirty ;( Any suggestion is really appreciated! Greetings
  19. Hi, so I'm making a bot that send the user a trade offer with 350 gems, but the problem is that it's my first time using JS, so I find it kinda difficult to do it... I found this online but I don't understand it at all....: manager.getUserInventoryContents(steamID, 753, 6, true, (err, inv) => { if (err) { throw err; } let gems = inv.filter(item => item.market_hash_name == "Gems"); let item = gems[0]; item.amount = 350; offer.addMyItem(item); offer.send(function(err, status) { if (err) { console.log(err); return; } //Some code }); }); But the problem is that I need: 1. Check if the user has at least 350 Gems or more in their inventory 2. Send the trade offer with the 350 gems So I basically have no idea how to do it... Anyone can help me out? Thanks.
  20. Hello, dear community, I am currently trying to manage multiple bots. I have made a bot.js where I am declaring how the object of the bot has to be. In the app.js I am making, for every steam account I have, a bot object and starting each bot synchronously after the bot before has been successfully logged in before. Now my problem: Let's say I have 10 steam accounts, every account owns Counter Strike and has a minimum spent of $5 in market. If I now start all bot instances, all steam accounts are shown as 'Currently In-Game Counter-Strike: Global Offensive' as far as good. But if I now send a trade offer to one of these bots, whatever bot I send the trade offer to it never gets accepted plus in the log files it says always: "Bot #10: Accepted offer. Status: pending"(Strange because the offer wasn't accepted!). So whatever bot I send the offer to, it's always bot #10 (the last bot) that tries to accept the offer. bot.js var SteamUser = require('steam-user'); var SteamTotp = require('steam-totp'); var SteamCommunity = require('steamcommunity'); var TradeOfferManager = require('steam-tradeoffer-manager'); var client; var community; var manager; var logOnOptions; function Bot(options, loggedIn){ //loggedIn -> Callback function, fires when client logs in successfully. client = new SteamUser(); community = new SteamCommunity(); manager = new TradeOfferManager({ steam: client, community: community, language: 'en' }); logOnOptions = { accountName : options.accountName, password : options.password, twoFactorCode : SteamTotp.generateAuthCode(options.shared_secret) }; client.logOn(logOnOptions); client.on('loggedOn', () => { console.log('Bot #'+options.id+' is running...'); client.setPersona(SteamUser.Steam.EPersonaState.Online); client.gamesPlayed(730); loggedIn(); }); client.on('webSession', (sessionid, cookies) => { manager.setCookies(cookies); community.setCookies(cookies); community.startConfirmationChecker(10000, options.identity_secret); }); manager.on('newOffer', offer => { if (offer.partner.getSteamID64() === '76561198100124418') { offer.accept((err, status) => { if (err) { console.log('Bot #'+options.id+': Error while accepting. '+err); } else { console.log('Bot #'+options.id+': Accepted offer. Status: '+status); } }); } else { offer.decline(err => { if (err) { console.log(err); } else { console.log('Bot #'+options.id+': Canceled offer: No trusted SteamID.'); } }); } }); } module.exports = Bot; app.js var Bot = require('./bot.js'); var config = require('./config.json'); var bots = []; var x = 0; var loopArray = function(arr) { startBot(arr[x],function(){ x++; if(x < arr.length) { loopArray(arr); } }); } function startBot(options,loggedIn) { console.log("Starting Bot "+options.id); var bot = new Bot(options, ()=>{ bots.push(bot); loggedIn(); }); } loopArray(config); I hope someone can help me ^^ Thank you in advance for any answers! -degs
  21. Hello guys I don't know how to create new bot and anyone can help me and sent me Created bot? please very evry please if anyone can upload any wbesite and give me bot :\ (I know how to use itBut don't know how to create on github)
  22. I have small dilema on my new bot what I am making. I have this communication between jackpot server and bot by REST API: Steam new incoming offer -> bot -> resend to jackpot server for validation -> jackpot server answers accept/decline -> if accept bot send to jackpot accepted offer object -> jackpot server do his work "if accept bot send to jackpot accepted offer object" - Here I have dilema.. Wait for accept callback, or use receivedOfferChanged event to get callback? I know waiting for callback is littlebit faster but is it 100% correct? Will it catch always? Same question for receivedOfferChanged. Thanks for help or suggestion how you guys (or Meredith McKey xD) do this kind of bot.
  23. Using node-steam-user + node-steamcommunity + node-steam-tradeoffer-manager. At some point this happening: Calling getUserDetails is returning Not logged in. steamCommuniti'es loggedIn returns true, bot is still polling offers and gets new offers, but even after webLogOn cant make getUserDetails reqeust. What can be a problem?
  24. My logic is: if the offer, sent by me, is changed, I decline it. I listen for 'sentOfferChanged', and if the offer.state == 4, I want to do offer.decline(). However if I do that, I am getting the errormessage Offer #3065190468 is not active, so it may not be cancelled or declined. Where is my error? Thank you
×
×
  • Create New...