Estkin Posted March 23, 2016 Report Share Posted March 23, 2016 Hello, I have running MySQL database where I store partner SteamID, bot SteamID, partner Trade link and Items.Is that everything I need to create new offer with bot? I would like to get some example, please. Thanks. Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted March 24, 2016 Report Share Posted March 24, 2016 var offer = manager.createOffer("[U:1:46143802]"); offer.addMyItem({"appid": 440, "contextid": 2, "assetid": "1234567890"}); offer.send("Hi there", "KYworVTM", function(err, status) { if (err) { console.log(err); } else { console.log("Offer #" + offer.id + " " + status); } }); Something like that, where [u:1:46143802] is my SteamID and KYworVTM is my trade token. I'm L! 1 Quote Link to comment Share on other sites More sharing options...
Argyl Posted March 24, 2016 Report Share Posted March 24, 2016 Going to have to use your problem thinking skills to deconstruct objects you send to the bot or arrays. xD Quote Link to comment Share on other sites More sharing options...
Estkin Posted March 24, 2016 Author Report Share Posted March 24, 2016 Thanks for example @Dr. McKay, I get it now.And I don't get that @Argyl, sorry. Quote Link to comment Share on other sites More sharing options...
Argyl Posted March 24, 2016 Report Share Posted March 24, 2016 I'm just saying if you are sending multiply items going to have to loop through the items. Whether the are in an object or array. Quote Link to comment Share on other sites More sharing options...
cookie Posted March 24, 2016 Report Share Posted March 24, 2016 I'm just saying if you are sending multiply items going to have to loop through the items. Whether the are in an object or array. not necessarily, an array of items can be added without having a loop. Quote Link to comment Share on other sites More sharing options...
Estkin Posted March 24, 2016 Author Report Share Posted March 24, 2016 Why would you even want to loop through, if you store it as {} Quote Link to comment Share on other sites More sharing options...
Argyl Posted March 24, 2016 Report Share Posted March 24, 2016 Then you would need to use addTheirItems(). Same thing as addTheirItems(), I just prefer the second cause I can do more with my array that I send. Quote Link to comment Share on other sites More sharing options...
MakeCodeNotWar Posted April 13, 2016 Report Share Posted April 13, 2016 var offer = manager.createOffer("[U:1:46143802]"); offer.addMyItem({"appid": 440, "contextid": 2, "assetid": "1234567890"}); offer.send("Hi there", "KYworVTM", function(err, status) { if (err) { console.log(err); } else { console.log("Offer #" + offer.id + " " + status); } });Something like that, where [u:1:46143802] is my SteamID and KYworVTM is my trade token. Hi there McKay. Im not strong in JS as you, so could u help, i just need an example like that, but if i want to recieve items from another person. Thanks you, mate, for all job that you`ve done! Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted April 13, 2016 Report Share Posted April 13, 2016 Hi there McKay. Im not strong in JS as you, so could u help, i just need an example like that, but if i want to recieve items from another person. Thanks you, mate, for all job that you`ve done! Check out the storehouse examples on GitHub. MakeCodeNotWar 1 Quote Link to comment Share on other sites More sharing options...
MakeCodeNotWar Posted April 14, 2016 Report Share Posted April 14, 2016 (edited) McKay, thanks for answering, but I just don`t get it, my acc is logged, i`m trying to send offer for my friend, to get his item, but i get an error: some bla-bla + "In order to protect the items in your inventory, you will be unable to trade from this device for 7 days.", but in my steamcommunity i could send it.My code: var offer = manager.createOffer("[U:1:STEAMID]"); offer.addTheirItem({"appid": 570, "contextid": 2, "assetid": "247762039"}); offer.send("Hi there", "TOKEN", function(err, status) { if (err) { console.log("There`s an error: " + err); } else { console.log("Offer #" + offer.id + " " + status); } }); STEAMID - my friend steamID.TOKEN - his token from Trade Link.I begging you, please mate, tell me what am I doing wrong, cause my head gonna be crashed soon. Edited April 14, 2016 by MakeCodeNotWar Quote Link to comment Share on other sites More sharing options...
MakeCodeNotWar Posted April 14, 2016 Report Share Posted April 14, 2016 Now i`m trying to make the same offer with the same code but from another account, and now i got another: Error: There was an error sending your trade offer. Please try again later. (20). Quote Link to comment Share on other sites More sharing options...
MakeCodeNotWar Posted April 14, 2016 Report Share Posted April 14, 2016 It works! That code is correct. Make sure that your account not in 7-days block, that your token and partner id correct, that your item asset id correct and all gonna be fine! I`m thankful as hell for you, McKay, for all job that you`ve done. Quote Link to comment Share on other sites More sharing options...
Scraebs Posted September 21, 2016 Report Share Posted September 21, 2016 var offer = manager.createOffer("[U:1:46143802]"); offer.addMyItem({"appid": 440, "contextid": 2, "assetid": "1234567890"}); offer.send("Hi there", "KYworVTM", function(err, status) { if (err) { console.log(err); } else { console.log("Offer #" + offer.id + " " + status); } });Something like that, where [u:1:46143802] is my SteamID and KYworVTM is my trade token. And if my bot should create trade offer with it's friend, how it will look like? Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted September 21, 2016 Report Share Posted September 21, 2016 That example is old and won't work with v2 (v1 is now unsupported). Code for sending an offer to a friend (without a trade token) with v2 looks like this: var offer = manager.createOffer("[U:1:46143802]"); offer.addMyItem({"appid": 440, "contextid": "assetid": 1234567890}); offer.send(function(err, status) { if (err) { console.log(err); } else { console.log("Offer #" + offer.id + " " + status); } }); Quote Link to comment Share on other sites More sharing options...
Attacler Posted July 4, 2017 Report Share Posted July 4, 2017 That example is old and won't work with v2 (v1 is now unsupported). Code for sending an offer to a friend (without a trade token) with v2 looks like this: var offer = manager.createOffer("[U:1:46143802]"); offer.addMyItem({"appid": 440, "contextid": "assetid": 1234567890}); offer.send(function(err, status) { if (err) { console.log(err); } else { console.log("Offer #" + offer.id + " " + status); } }); Hi there, I use this method, but i keep getting error 26.My code: var offer = manager.createOffer(result[0].url); offer.addMyItem({"appid": 730, "contextid": 2,"assetid": result[0].itemid}); offer.send(function(err, status) { if (err) { console.log(err); } else { console.log("Offer #" + offer.id + " " + status); } }); the result[0].url is a steam trade url and the result[0].itemid is an item id, i have this ran after the bot setted his cookies.Please help. Bye,Bart Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted July 4, 2017 Report Share Posted July 4, 2017 https://steamerrors.com/26 Attacler 1 Quote Link to comment Share on other sites More sharing options...
Attacler Posted July 7, 2017 Report Share Posted July 7, 2017 https://steamerrors.com/26I used the wrong item id its fixed now!, thanks! Quote Link to comment Share on other sites More sharing options...
Attacler Posted July 8, 2017 Report Share Posted July 8, 2017 (edited) https://steamerrors.com/26How can i confirm the trade?i have this function: function checkitems(){ connection.query('Select tradeurl, itemcode, tradecode, typetrade,tradestatus,sended From bot Where Botchecknummer = 1', function(err, result) { if (err) console.log(err); else console.log(result); console.log(result[0].url); if(result != null){ var offer = manager.createOffer(result[0].tradeurl); if(result[0].typetrade == 'withdraw'){ offer.addMyItem({"appid": 730, "contextid": 2,"assetid": result[0].itemcode }); }else{ offer.addTheirItems({"appid": 730, "contextid": 2,"assetid": 9508261450 }); } var id = '0'; offer.setMessage(result[0].tradecode); offer.send(function(err, status) { if (err) { console.log(err); } else { console.log("Offer #" + offer.id + " " + status); } }); console.log(offer); offer.accept(function (err) { if (err) { console.log("Unable to accept offer "+ offer.id +": " + err.message); } else { console.log("Offer accepted"); } }); } },100); } but it says: Unable to accept offer null: Cannot accept an unsent offer.If i try it after its send, it says that it cant confirm trade null, trade offer doesnt exist, but the trade offer is waiting for a confirmationif i do it after console.log("Offer #" + offer.id + " " + status); , it says: Unable to accept offer 2282084226: Offer #2282084226 is not active, so it may not be accepted Bye,Bart Edited July 8, 2017 by Attacler Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted July 8, 2017 Report Share Posted July 8, 2017 the accept method is to accept an incoming offer, not to confirm an outgoing one. The documentation is clear about this. You can use node-steamcommunity to confirm trades. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.