Jump to content
McKay Development

Dr. McKay

Administrator
  • Posts

    3596
  • Joined

  • Last visited

Reputation Activity

  1. Like
    Dr. McKay got a reaction from Coyeks in How to only accept CSGO keys in 'newOffer'   
    offer.itemsToReceive contains an array of the items you'd receive if you accepted this offer. For each item in this array, check appid to make sure it's CS:GO and name to make sure it's a key. For example:
    var allItemsAreGood = offer.itemsToReceive.every(function(item) { return item.appid == 730 && item.name == "CS:GO Case Key"; });
  2. Like
    Dr. McKay got a reaction from jazz in Custom Storage Engine   
    If that works it's a fluke. You should pass an Error to the callback, like this:
    callback(new Error("File not found"));
  3. Like
    Dr. McKay got a reaction from jazz in bind ip to node-steam-user   
    No. No Steam services support IPv6 at the present time.
  4. Like
    Dr. McKay got a reaction from Frost Byte in How to go from Steam64 to Steam username (the name currently used on steam)   
    Your problem is that getPersonas expects an array as the first argument, and you aren't passing it an array. What you want to do is client.getPersonas([steamID], function(personas) { /* etc */ });
     
    Also in this case, the callback is essentially mandatory for you. getPersonas doesn't return anything. The data is only available inside the callback. In your case, you want something like this:
    client.getPersonas([steamID], function(personas) { var persona = personas[steamID.getSteamID64()]; var name = persona ? persona.player_name : ("[" + steamID.getSteamID64() + "]"); // the player's name is now available as name });
  5. Like
    Dr. McKay reacted to Frost Byte in How to go from Steam64 to Steam username (the name currently used on steam)   
    I found out myself!
     
    You already have the properties and methods from the steam handlers in your own steam-user library. So there I don't need a specific handler like 'friends' to send a message. I can just ask your steam-user object (in my case I called it client) and ask for the chatMessage method.
     
    Right? Well it works for me now 
     
    Yeah, it really works. And I managed to only use your node-steam-user library with all it's functions + your node-steamcommunity library!
  6. Like
    Dr. McKay got a reaction from TextDynasty in Decline Trade Hold   
    https://github.com/DoctorMcKay/node-steam-user#chatmessagerecipient-message-type
  7. Like
    Dr. McKay got a reaction from TextDynasty in Decline Trade Hold   
    offer.getUserDetails(function(err, me, them) {
    if (err) {
    throw err;
    }

    if (them.escrowDays > 0) {
    offer.decline();
    }
    });
  8. Like
    Dr. McKay got a reaction from Santa in Deleting from poll data   
    It's not really recommended to manipulate poll data. TradeOfferManager's job is to emit newOffer once per incoming offer. Errors can be frustrating but it's your responsibility to make sure that they're dealt with properly.
     
    You could use offerList to check for offers that should have already been accepted (probably want to keep a list of offers you've attempted to accept and the timestamp so you don't try to accept an offer too frequently).
  9. Like
    Dr. McKay got a reaction from TextDynasty in cannot declined the wrong offer   
    You aren't assigning anything to BuyKey and FromRef1. forEach doesn't return anything.
     
    Also, further on down you're using = when you want to use ==
  10. Like
    Dr. McKay got a reaction from mtn in bind ip to node-steam-user & node-steamcommunity   
    The constructor is new SteamCommunity()
  11. Like
    Dr. McKay reacted to adma in cannot declined the wrong offer   
    I don't know what you are trying to do with the comma operator, but by the looks of it you want to use the and operator (&&) in your if (onlyKeys, onlyRef) checks...
     
    if (onlyKeys2, onlyRef2) âž¡ if (onlyKeys2 && onlyRef2)
     
    In regards to your declining offer thing... its probably to do with your lack of curly braces surrounding if and else e.g
    if (x && y) { // code } else { // code } Not ...
    if (x && y) // code else // code What do these lines do/mean?
    'refAmount = offer.itemsToGive.length == keyAmount * buyprice'
    'refAmount = offer.itemsToReceive.length == keyAmount * sellprice'
     
    Also, unless you want the refAmount and keyAmount to be global, you should really declare them with var ... keyAmount = offer.itemsToGive.length âž¡ var keyAmount =  offer.itemsToGive.length
     
    Even though I am new to coding/scripting and I can see your code is very untidy/messy...
     
    PS: What is offers.on('newOffer') ? and why is trade offer manager newOffer listener nested inside this???
  12. Like
    Dr. McKay got a reaction from boxxy in Will I get 7 day penality ?   
    If you're using two-factor authentication (via SDA or whatever), then there's no new-device cooldown, so no.
     
    But if you aren't, then the answer is still no because "devices" are remembered by sentry files. Your sentry file is saved by steam-user in your appdata directory, so it will always be reused on the same machine (until you reformat or whatever).
  13. Like
    Dr. McKay got a reaction from MrRobot in Error: HTTP error 302 on editProfile()   
    Thanks, live in v3.27.1.
  14. Like
    Dr. McKay got a reaction from adma in newOffer triggered on real trade   
    Check fromRealTimeTrade and abort if it's true in newOffer.
  15. Like
    Dr. McKay got a reaction from adma in Listening for accepted trade offer from real trade   
    https://github.com/DoctorMcKay/node-steam-tradeoffer-manager/wiki/Real-Time-Trades
  16. Like
    Dr. McKay got a reaction from GHOST in relogin to steam   
    Yes.
  17. Like
    Dr. McKay reacted to adma in Listening for accepted trade offer from real trade   
    I honestly can't believe how prompt you were with implementing this. Thanks very much McKay!
  18. Like
    Dr. McKay got a reaction from MrRobot in node-steamcommunity v3.26.1   
    Right.... you didn't see anything..... <_>
  19. Like
    Dr. McKay got a reaction from MrRobot in httpRequest with store.steampowered.com   
    You're kind of meant to use steam-store for store.steampowered.com requests, but I could see how it would be more useful to have that available in steamcommunity, especially since steam-store doesn't offer the HTTP stuff. This is now available in 3.26.0.
  20. Like
    Dr. McKay got a reaction from yellowish in Minimal code to stay logged in forever...   
    That all looks fine to me. sessionExpired is only emitted when a request you make fails because you aren't logged in. It doesn't check automatically, it only checks whenever the library makes a request somewhere.
     
    Starting a new confirmation checker without stopping the old one is just fine. It'll stop an old one if you call it while one is running.
     
    I recommend updating to v3.23.1 if you're going to use webchat.
  21. Like
    Dr. McKay got a reaction from MrRobot in A few Questions   
    Only Valve knows the answer to that, but out of the interest of everyone I'd avoid registering accounts super quickly.
    No idea.
    Not possible through steam-user at this time, but would be possible to implement. Couldn't give you a timeframe, though.
  22. Like
    Dr. McKay got a reaction from MrRobot in A few Questions   
    Okay, the timeframe was a bit sooner than expected. You can now change account email (which trade bans you for 5 days) and password (no trade ban) in v3.13.0.
  23. Like
    Dr. McKay got a reaction from KiTa in Cannot read property 'escrowDays' of undefined   
    No, that's the actual solution. Errors are a fact of life (especially when you're working with Steam). You need to handle them, or else you'll crash.
  24. Like
    Dr. McKay got a reaction from KiTa in Cannot read property 'escrowDays' of undefined   
    You aren't checking the error. In every callback, if err is truthy, then there was an error and all other arguments are undefined.
  25. Like
    Dr. McKay got a reaction from Ryan in tradeOffers event and changes in state   
    Correct. steam-tradeoffer-manager will handle all that polling for you.
×
×
  • Create New...