Jump to content
McKay Development

sergun

Member
  • Posts

    18
  • Joined

  • Last visited

Posts posted by sergun

  1. hello there,

    i can confirm any trade offer with the offerID property but while confirming a market listing, i get this error:Error: Could not find confirmation for object "id here"

    example data:

      CConfirmation {
        id: '7914986268',
        type: 3,
        creator: '2846786440405394409',
        key: '5826745867538273787',
        title: 'Sell - Strange Flying Guillotine',
        receiving: '249,98 TL (217,39 TL)',
        time: '28 minutes ago',
        icon: 'https://steamcommunity-a.akamaihd.net/economy/image/fWFc82js0fmoRAP-qOIPu5THSWqfSmTELLqcUywGkijVjZULUrsm1j-9xgEIUxQVYhjuvTlVjdrZAfOeD-VOyNxs48VTjzc7kFl4NrPhZDFiIV2bUaQGWK1v9124WiYzupIzDNS3ofUWJ1vzhdlvNA/32fx32f',
        offerID: null
      }

    i've tried id, key and none of them worked.

  2. hello there,

    my bot buys items automatically from people and i sell them on steam community market for profit.

    the second part takes some time so i want to automate it as well.

    is it okay to automatically sell specific items by reading steam's graphs, checking other listings price and adjusting the price according to them, etc.

     

    steam says it's not but i wonder if there are some people doing that

    https://store.steampowered.com/subscriber_agreement/

    "You may not use Cheats, automation software (bots), mods, hacks, or any other unauthorized third-party software, to modify or automate any Subscription Marketplace process."

  3. 23 minutes ago, Dr. McKay said:

    This is just how Steam works, sadly. When you confirm an incoming trade offer, the confirmation request doesn't respond until all items have been exchanged. If a trade offer contains many items, it's very possible that the request will time out (30 seconds) before all items have been exchanged. In this situation, the trade will still complete in the background.

    Thank you, I need to confirm that trade successfully got accepted because I'm keeping stats.

    Should i watch receivedOfferChanged event for this purpose, instead of chaining everything?

  4. 2 hours ago, vrtgn said:

    What is your code?


    You may not be error handling. 

    I do. Mostly, API doesn't response in time and I get timeout error from my queue system.

    Sometimes, I get a 403. Offers always get successfully accepted though.

     

    Also, I just realized that i was mentioning offer.accept method, not 2fa confirmation. Been a while since I touched my code, sorry for confusion.

    So, it's a steamcommunity module related problem.

     

    I meant the acceptConfirmationForObject method, doesn't response in time.

    image.thumb.png.e168b8617bb1ba441feb43a5e3e8aa80.png

    function confirm2FA(offerID) {
        return new Promise((resolve, reject) => {
            community.acceptConfirmationForObject(config.get('steam').identitySecret, offerID, function (err) {
                if (err) reject('Offer confirmation 2FA: ' + err);
                } else {
                    resolve(true);  //  Offer is confirmed by 2FA
                }
            });
        });
    }

     

    Also, I just read that adding a small delay between accepting the offer and confirming 2FA would be better. I'll try this.

     

    Just tried adding some delay, didn't change much. It seems that 2FA confirmation takes some time.

  5. hello there,

    i have a queue system for offers which allows maximum 60 seconds for an offer to get processed & accepted (gets queued again if requests fail somehow) but sometimes, after accepting an offer with the acceptConfirmationForObject() method, the callback takes really long to get triggered or it doesn't get triggered at all while the offer sucessfully got accepted within in seconds after calling the function.

    sometimes, it just works fine and gets triggered after accepting as it should be.

     

    is there anything i can do to fix this unreliability?

  6. 4 hours ago, Dr. McKay said:

    I suppose before you overwrite the variable, you could try deleting the backpack property.

    manager.on('receivedOfferChanged', function (offer) {
        if (offer.state === TradeOfferManager.ETradeOfferState.Accepted) {
            delete(tf2.backpack);
            tf2 = new TeamFortress2(client);
            client.gamesPlayed([440], true);
        }
    });

    Didn't make any difference, I guess.

    image.png.b7cc6603dda2a535d6c4be8473ccd79b.png

    image.thumb.png.28fbedb98c2861c13f1921c8bde1e5ff.png

     

    image.thumb.png.9d4300aa364d1ef7663692c1cafcfff4.png

     

    I don't know how to properly catch memory leaks but I guess there's something to do with the lib itself.

    Snapshot 1 is taken while the bot is in idle state, TF2 client was initialized and then killed. (95MB)

    Snapshot 2 is taken after the bot has finished processing an offer and initialized a new tf2 client (deleted tf2.backpack before that), ran the currencyMaintainer, killed 440. (139MB)

    Snapshot 3 is the same cycle as snapshot 2. (150MB, ~11MB diff)

  7. 4 minutes ago, Dr. McKay said:

    I'm sorry, I don't think I can really help you much more with this. I haven't seriously touched any GC-related code in a good while, and the most I could do is experiment, which it seems is what you're doing anyway.

    I can send you my full source if needed, however; everything is fine if i reinitialize the tf2 class just before starting 440 again:

    20 hours ago, sergun said:

    It's not about the inventory contents, TF2 client should be initialized properly in order to use the craft method, right?

    Can I still use the craft method after killing and restarting the 440, while it didn't emit the backpackLoaded event for the second time?

     

    Additionally, backpackLoaded gets triggered if I reinitialize the tf2 class just before relaunching 440 but I get like ~+25MB memory leak which is caused by the lib (I guess) every time I do this. (not on a new variable, I overwrite the variable which is declared on the global scope)

    Is there anything we can do to fix the memory leak?

    I'm almost sure it's not caused on my end because I didn't experience any memory leaks before doing this. (The bot ran like that for like 4 months without restarting on limited resources)

  8. 12 minutes ago, Dr. McKay said:

    I don't see any reason why you couldn't try to craft without having received your backpack contents, assuming you are connected to the GC.

    I did try after posting that message, forgot to inform you; sorry.

    It seems I'm not connected to GC after restarting the 440, I've tried to run my currencyMaintain function with itemAcquired and itemRemoved events but they won't get triggered anymore after restarting 440. (Same situation with backpackLoaded event)

     

  9. 5 hours ago, Dr. McKay said:

    GCs don't really tend to like it when you launch and quit the game frequently. If you don't want to stay in TF2 all the time, you're probably better off getting your inventory from steamcommunity or steam-tradeoffer-manager rather than node-tf2.

    It's not about the inventory contents, TF2 client should be initialized properly in order to use the craft method, right?

    Can I still use the craft method after killing and restarting the 440, while it didn't emit the backpackLoaded event for the second time?

     

    Additionally, backpackLoaded gets triggered if I reinitialize the tf2 class just before relaunching 440 but I get like ~+25MB memory leak which is caused by the lib (I guess) every time I do this. (not on a new variable, I overwrite the variable which is declared on the global scope)

  10. spacer.png

    Here, the bot started the TF2 client on the initial launch and it triggered the backpackLoaded event.

    currencyMaintain class did it's job as we can see with "2020-02-06 13:27:28: ℹ info Smelting 1 refined to obtain 3 reclaimed (current reclaimed: 3)"

    After that, the bot stopped playing TF2 which is what I wanted.

     

    I took some metals from the bot's inventory so the currencyMaintain class will work when backpackLoaded gets triggered but it does not get triggered even it did launch the TF2 client again with the receivedOfferChanged event.

     

  11. Hello there,

    I couldn't see the section for node-tf2 so I'm creating the thread in here, sorry.

    I wrote something to prevent my trading bot's metal stock from running out.

     

    When an offer gets accepted, the bot should launch tf2 and do crafting then kill all running games in order to minimize the effect on the playtime stats.

    manager.on('receivedOfferChanged', function (offer) {
        if (offer.state === TradeOfferManager.ETradeOfferState.Accepted) {
            client.gamesPlayed([440], true);
        }
    });
    let currMaintainCalled = false; // defined on the global scope on the initial execution
    let lastBpCall = 0; // defined on the global scope on the initial execution
    tf2.on('backpackLoaded', function () {
        if (moment().diff(lastBpCall, 'seconds') > 1) {
            if (initSeq.tf2.Client && tf2.backpack && !currMaintainCalled) {
                lastBpCall = moment();
                let maintain = new currencyMaintain(tf2, config.get('app').behaviour.currencyMaintain.tf2, logger, currMaintainCalled);
                currMaintainCalled = true;
                maintain.Maintain();
                client.gamesPlayed([], true);
            }
        }
    });

    Since backpackLoaded can get emitted more than one time in a short period of time, i've added an epoch cooldown which is 1 second.

    tf2 class is initialized on the global scope.

     

    So, when the bot completes an offer; TF2 should be launched and backpackLoaded should get triggered but after TF2 launches, backpackLoaded doesn't get triggered.

    However, backpackLoaded does get triggered and currencyMaintainer class does it's job when I launch TF2 on the initial Steam login but it doesn't get triggered after i kill TF2 with client.gamesPlayed([]); and start the TF2 client again.

     

×
×
  • Create New...