Jump to content
McKay Development

Mr Game and Watch

Member
  • Posts

    36
  • Joined

  • Last visited

Everything posted by Mr Game and Watch

  1. Ups, sorry about that. I deleted that line, but in my code there's a return there (I guess I deleted that line by mistake). This is what happens in the second function (the "non-working" one): It loads the offer (with a null id in that moment), loads the items and set the message. Then, it sends correctly the offer. It checks if the status is "pending" (it is). But it goes to error, saying that it can't confirm an offer with null id. I'm working with the solution Vanilla told, but... I wanted to know why that happened. It's just curious. Thanks Dr. McKay
  2. I'll try that. But I'm kinda worried. I mean: Now I can avoid this null problem with counter, but... what wold happen if I need more functions to send objects? That would be a problem. Thanks Vanilla. I'l try that. Has this error happened to you before? I mean, get null info of your offers.
  3. Hello! I'm trying to send automatic offers. I have two functions for doing this: One for the ones I want to send and other to send counter offers. The first one works perfect (Thanks again for helping me with that), then I decided to copy-paste that for the second and change it a little. But here's what is strange: the couner function can send offers, but can't confirm them because the offer id is always null. Here are the 2 offers objects: TradeOffer { partner: censored, id: '2192436500', message: 'Here's your trade', state: 9, itemsToGive: [ ... ], itemsToReceive: [ ... ], isOurOffer: true, created: 2018-01-21T11:03:44.021Z, updated: 2018-01-21T11:03:44.021Z, expires: 2018-02-04T11:03:44.021Z, tradeID: null, fromRealTimeTrade: false, confirmationMethod: 2, escrowEnds: null, rawJson: '' } And this is the wrong one: TradeOffer { partner: censored, id: null, message: 'That was not the correct price. Here's what I wanted.', state: 1, itemsToGive: [ ... ], itemsToReceive: [ ... ], isOurOffer: true, created: null, updated: null, expires: null, tradeID: null, fromRealTimeTrade: false, confirmationMethod: null, escrowEnds: null, rawJson: '' } Here is the working one: var offer = manager.createOffer(item.trade_route); offer.addMyItems(items_to_send); offer.addTheirItem({"appid": 440, "contextid": 2, "assetid": item.currentID}); offer.setMessage("Here's your trade"); offer.send(function(err, status) { if (err) { console.log(err); return; } console.log(offer); //here's the one I posted above if (status == 'pending') { console.log(`Offer #${offer.id} sent, but requires confirmation`); setTimeout( function(){ community.acceptConfirmationForObject(key, offer.id, function(err) { if (err) { console.log(err); } else { console.log("Offer " + offer.id +" confirmed"); } }); }, 2000 ); } else { console.log(`Offer #${offer.id} sent successfully`); } }); Here's the worng one (counter offer): var offer = manager.createOffer(trade_url); manager.loadUserInventory(user_id, 440, 2, false, function (err, inventory, currencies) { if ('code for validating other things') { offer.addMyItem(...); offer.addTheirItems(items_to_send); offer.setMessage("That was not the correct price. Here's what I wanted."); offer.send(function (err, status) { if (err) { console.log(err); } if (status == 'pending') { console.log(offer) // Here's the one I posted above setTimeout(function () { community.acceptConfirmationForObject(key, offer.id, function (err) { if (err) { console.log(err); } else { console.log("Offer " + offer.id + " confirmed"); } }); }, 4000); } else { console.log(`Offer #${offer.id} sent successfully`); } }); } else { console.log("Validation failed") ... non related code } }); }); Why the second one can't have the offer.id? Any kinf of help would be aprreciated Note: I had to remove the non-related code and coments... sorry if you test it and fails.
  4. Thanks. Now it works (Or looks like for me). Again, thanks you and happy holidays. You deserve the best!!!
  5. Sorry to ask again about this, but I can't find that methods. In which modules are they? I can only find "GetOffer" or "GetOffers" on your "node-steam-tradeoffer-manager" module. (I tried that IDs, dind't work). Also, thanks for your time and happy holidays! Edit: I think I found that "tradeID", but I get always null: isOurOffer: false, created: 2017-12-24T13:58:46.000Z, updated: 2017-12-24T13:58:51.000Z, expires: 2018-01-07T13:58:46.000Z, tradeID: null, fromRealTimeTrade: false, confirmationMethod: 0, escrowEnds: null, Is this the tradeID you mean?
  6. Well... I'm stucked trying to get that work I make the trade. I confirm it and then I send a request like this: http://api.steampowered.com/IEconService/GetTradeStatus/v1/?key=*API key goes here*&format=json&tradeid=0123456789&get_descriptions=1&language=en the trade ID I send is the one I get for the confirmation. The API key is the one I have. OK. I check it before and after the trade is made... but I always get an empty JSON. What I'm doing wrong?
  7. OK. I'll check it out. Thanks you so much and merry christmas Dr. McKay
  8. Hello! I noticed that when I get an item from other people.. it's id change. Then, I have a question: If I have to return it... how can I make sure it's the same item? For example: I can have 2 TF2 items with the same quality, the same unusual effect and the same level. Is there a way to check it? Another "secret id" to check? Sorry if that was asked, but I didnt found it Thanks and have a nice day Edit: I found the main thread, "Identifying Steam Items", but I still don't get it, sorry
  9. OK. I just found a solution. Thanks for your answer!
  10. OK. I think I got what are you saying... but... how can I get the objectID of a market listing?
  11. Thanks for your answer! What do you mean as "the same way". I mean, for retrieve offers I use "manager.getOffers", but this method doesn't get Steam market confirmations. Is there a method to get them?
  12. Hello! I'm still working on my personal project to get rid of the Steam App. I can Get my Auth code, send offer and accept the incoming ones. But today I needed to sell an item on steam market... and then I realize I need to open the App. And I was looking the APIs information... but I don't find anithing about Steam market confirmations. Is there a way to confirm the market confirmations? Or my project will lack this feature because it's not possible to do that? I really try to avoid the App, because it blocks the other features some hours... Thanks for reading me, and have a happy gaming!
  13. Thanks for your answer. The weird part of this inactive offers is that when I try to accept, it says is inactive but I can see them in the web version and then I need to accept them with SteamApp Now it works ok again, but if this happens again I will re-open this topic with more details. Thanks again!
  14. Hello! Today I'm getting this error while accepting offers (incoming ones or the ones I create): Offer #XXXXXXXXX is not active, so it may not be accepted. Then, the only way I have to confirm the trade is using the mobile App and then stop the bot few hours to avoid this problem... but it persists. Waht does it mean is "not active"? How can I avoid it? Thanks for reading me!
  15. Well, I used "trade_I_want_to_accept" instead of recived[i] as, like you said, was no longer valid. Thanks again!
  16. Yes! Now it works! thank you so much for your help! And also thanks to Dr. Mckay for all the prevous posts! :D
  17. I'm not on my PC right now for make some tests before asking, but... how can I accept them first? I mean, for example, when I send one I use createOffer and then I use "send" before I use "acceptConfirmationForObject", but how can I accept first the trade? Like I put on my first comment code? Or it's completely different? Thanks you for reading meSunriseM and Dr. McKay! You are so nice!
  18. I think I don't. That method always confirm all the offers? Because if that is true, then I might get in trouble. I just want to accept 1 offer... maybe one guy send me a fishy one and get all my items
  19. 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!
  20. Well. Then I need to change other things in my code to keep the offer object. Thanks for your quick answer!
  21. 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!
  22. OK. Thanks again for your fast answers! now is time to develop again!
  23. Sorry for re-opening the question,but I see when the offer is sent I see that the object has a field called icon_url. But it's not an URL... os there a way to convert that string in a URL? Also, I can convert the sender ID for check their profile(Horray! Was easy looking for what you said on your previous Answer). But I was wondering... is there a way to get they info profile from your steamcomunnity API? Or should I use Steam API for that?
  24. Thanks for your complete answer! Now that my questions are resolved I'll continue developing! Thanks again and happy gaming
  25. 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
×
×
  • Create New...