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, Ive got some questions regarding steam trade offer manager. The first one - can I use single polling file for multiple bots instances? The second - how many trades can I send and have pending at one time? I don’t know what limit should I set on my page. All answers will be appreciated. Thanks in advance.
  2. Can not addMyItems to offer.send, always returns 0 Actually receiving items works completely fine. But im struggling since 3 days about the sending offer part. So i started to log every activity on that part and commented every line to get things clear. I have two options of sending outgoing offers: 1) if i want to send the winnings to the user2) if i want to send the rake to myself I have chosen the Rake function because its less code with same functionalities. If i get this running i also get the SendOffer running. The function will be called by /sendrake in steamchat to the bot (works also) function sendRake(param){ logger.info('[RAKECHECK] Calling the Sending Function'); connection.query('SELECT * FROM `rakeitems` WHERE `status`=\'active\' GROUP BY `id` DESC LIMIT 1', function(err, row, fields) { logger.info('[RAKECHECK] Selected the correct Table for DB'); if(row.length!=0) // if not empty { logger.info('[RAKECHECK] Selected Table is not empty, continue'); var assetids=(row[0].assetid).split('/'); //assetid from first row named assetid logger.info('[RAKECHECK] Splitting the AssetID from our DB devided by Slash'); offers.getInventoryContents(730, 2, true, function (err, inventory) //getting inventory contents { logger.info('[RAKECHECK] getInventoryContents called!'); if (err){ // if we get an error if(param==1){ client.chatMessage(config.admin1, '[SERVER] Error while loading the Bot\'s Inventory, try again later boss!'); } logger.info('[RAKECHECK] getInventoryContents could get no Items'); console.log(err); return; } else { // no error on getting inventory so we can continue // If the inventory is empty if(inventory.length == 0) { logger.info('[RAKECHECK] getInventoryContents found an empty inventory!'); console.log("CS:GO inventory is empty"); return; } // if the inventory has no error and is not empty, give me the count of items console.log("Found " + inventory.length + " CS:GO items"); logger.info("[RAKECHECK] Found " + inventory.length + " CS:GO items"); //provides the token var token = row[0].token; logger.info("[RAKECHECK] Token: " + token + " found!"); // provides the gameid var gameid = row[0].id; logger.info("[RAKECHECK] Game ID: " + gameid + " found!"); //provides the value var value = row[0].value; logger.info("[RAKECHECK] Value: " + value + " found!"); // provides the partners steamid var sid = row[0].userid; logger.info("[RAKECHECK] Steam ID: " + sid + " found!"); // Create the offer var offer = offers.createOffer(new TradeOfferManager.SteamID(row[0].userid), '' + row[0].token + ''); logger.info("[RAKECHECK] createOffer: ID:" + sid + " TKN:" + row[0].token + ""); // If offer is not empty or outgoing trade contains imtems if(offer.itemsToGive.length!=0) { logger.info("[RAKECHECK] Confirmed: " + offer.itemsToGive.length + " Items"); //for each item in inventory do the following inventory.forEach(function(item) { //for each assetid to this assetids.forEach(function(asset) { //if the itemid is same as assetid if(item.id==asset) { //Add my item to the trade //Also tested with same result: offer.addMyItems(inventory[0]); offer.addMyItem({"appid": 730, "contextid": 2, "assetid": "10387413069",}); } }) }); } else { logger.info("[RAKECHECK] Items: " + offer.itemsToGive.length + " and this *Insult here* is still not working"); // The Tradeoffer is Empfty console.log("Found " + offer.itemsToGive.length + " Items, Tradeoffer is empty"); } // Send the Trade with a Message offer.setMessage('Rake for Game #'+gameid+' ($'+value+')'); //setTimeout(function(){ // sending offer offer.send(function(err, status) { //if we get an error, return the error to console and admin via chat if (err) { console.log(err); if(param==1){ client.chatMessage(config.admin1, '[SERVER] Error while sending the tradeoffer for the rake, try again later'); return; } return; } // if the status is pending we will need to accept the trade if (status == 'pending') { console.log('[SERVER] Rake for Game #'+gameid+' has been successfully sent and is awaiting mobile confirmation.'); // We need to confirm it console.log(`Offer #${offer.id} sent, but requires confirmation`); community.acceptConfirmationForObject(config.identitysecret, offer.id, function(err) { if (err) { console.log(err); } else { console.log("Offer confirmed"); } }); } // if no error and not pending, the trade seems to be accepted else { console.log(`Offer #${offer.id} sent successfully`); connection.query('UPDATE `rakeitems` SET `status`="sent" WHERE `id`=\''+gameid+'\''); if(param==1) { client.chatMessage(config.admin1, '[SERVER] Successfully sent the rake for Game #'+gameid+'!'); } } }); // End of send function // Actually unused timeout },2000); } // End of (else) for getting inventory with no error }); // Closing getInventoryContents } // If row lenght not 0 else { // If row is empty there is no query to call if(param==1) { client.chatMessage(config.admin1, '[SERVER] No more Rake Queries!'); return; } } }); } Output after running through: I always have no items in my offer and i get the following console output: 2017-06-26T11:58:45.599Z - info: [RAKECHECK] Calling the Sending Function 2017-06-26T11:58:45.631Z - info: [RAKECHECK] Selected the correct Table for DB 2017-06-26T11:58:45.632Z - info: [RAKECHECK] Selected Table is not empty, continue 2017-06-26T11:58:45.632Z - info: [RAKECHECK] Splitting the AssetID from our DB devided by Slash 2017-06-26T11:58:46.460Z - info: [RAKECHECK] getInventoryContents called! 2017-06-26T11:58:46.460Z - info: [RAKECHECK] Found 123 CS:GO items 2017-06-26T11:58:46.460Z - info: [RAKECHECK] Token: MzGQSP3P found! 2017-06-26T11:58:46.460Z - info: [RAKECHECK] Game ID: 17 found! 2017-06-26T11:58:46.460Z - info: [RAKECHECK] Value: 0.01 found! 2017-06-26T11:58:46.461Z - info: [RAKECHECK] Steam ID: 76561197995793247 found! 2017-06-26T11:58:46.461Z - info: [RAKECHECK] createOffer: ID:76561197995793247 TKN:MzGQSP3P 2017-06-26T11:58:46.461Z - info: [RAKECHECK] Items: 0 and this *Insult here* is still not working I think im stucked and i just cant see the fault i made. I have read the documentation so often that i consider buying any other book to get something other in my mind, also tried example bots to fit with my code and, and, and... finally i hope i can get some one to help with this. Cheers.
  3. windows system ! "C:\Program Files\JetBrains\WebStorm 2017.1.3\bin\runnerw.exe" "C:\Program Files\nodejs\node.exe" E:\nodework\nodeSteam\doctor-node-steam-tradeoffer-manager-master\examples\offloader.jsSteam Guard App Code: R6B8KLogged into SteamGot API key: <censored>Found 7H1Z1 Kill itemsOffer #2242951795 sent, but requires confirmationError: 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
  4. 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
  5. As the picture below how can i check if the item name contain the tag 'Craft Item' ?
  6. Hello, I was wondering if there's something like manager.cancelOffer(offerID); or something like that. I went through the trade-manager docs and found nothing that would help me cancel outgoing offers, best of what I found was constructor options to cancel offers & poll-data to keep offer data, but none of which is what I'm looking for. Is there anything that would let me push trade offer id's into an array and cancel them 1by1? Thanks in advance!
  7. i've been using this bot for a while then suddenly i had to change my mobile authentication and then wait for 15 days and now i see that bot doesnt sends any trade offer, Error: There was an error sending your trade offer. Please try again later. Bot has declined your trade request. someone help me please
  8. 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]}`) }) } });
  9. 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
  10. 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 .. ?
  11. 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.
  12. 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.
  13. 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.
  14. 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?
  15. 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
  16. Hello, I was wondering if it's possible to cancel all outgoing offers at once? Thanks in advance.
  17. 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.
  18. 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
  19. 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
  20. 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 */
  21. Hello. How many times I can cancel offer? Is any limit? Steam doesn't ban my account? Thanks
  22. 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
  23. 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?
  24. 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!") }
×
×
  • Create New...