Jump to content
McKay Development

Verize

Member
  • Posts

    9
  • Joined

  • Last visited

Posts posted by Verize

  1. If you haven't figured it out by now: The confirmation checker is probably getting you rate-limited. That happens if you are sending many requests in a relatively short period of time. That's why the confirmation checker is deprecated - because it does exactly this. Accept all incoming and outgoing offers manually with the method 

    acceptConfirmationForObject()
  2. As far as I understand, the assetid, that is needed to identify a specific item, can change after a trade. When sending an offer and the other party accepts it, how can I get the new assetids of the received items, so I can save the ids in my database and use them, later on, to identify the items and send them? Is there a method that I can call on the 'sentOfferChanged' event to get the new assetids? 

    That's all I want to know. Thanks! :)

  3. When creating a new trade offer I get following error:
     

    TypeError: Cannot read property 'isValid' of undefined
        at new TradeOffer (C:\Users\JP\SteamBots\node_modules\steam-tradeoffer-manager\lib\classes\TradeOffer.js:19:19)
        at TradeOfferManager.createOffer (C:\Users\JP\SteamBots\node_modules\steam-tradeoffer-manager\lib\index.js:386:14)
        at SteamManager.sendSmallPotWinnings (C:\Users\JP\SteamBots\lib\SteamManager.js:327:29)
        at SmallPot.getRoundById (C:\Users\JP\SteamBots\server.js:704:11)
        at model.Query.<anonymous> (C:\Users\JP\SteamBots\node_modules\mongoose\lib\model.js:3919:16)
        at C:\Users\JP\SteamBots\node_modules\kareem\index.js:273:21
        at C:\Users\JP\SteamBots\node_modules\kareem\index.js:131:16
        at _combinedTickCallback (internal/process/next_tick.js:131:7)
        at process._tickCallback (internal/process/next_tick.js:180:9)

    The only thing I am doing is this:
    let offer = manager.createOffer(tradelink);

     

    What exactly is happening here? Thanks in advance

  4. This may be a more general question but I hope you can still help me. I have following code:

     

    bot.js

    I created a class which I export using module.exports and can now import in other files. (To keep my code organized)
     

    class SteamBot {
        
        constructor(logOnOptions){
            this.client = new SteamUser();
            this.community = new SteamCommunity();
            this.manager = new TradeOfferManager({
                steam: this.client,
                community: this.community,
                language: 'en'
            });

            this.logOn(logOnOptions);
        }

        logOn(logOnOptions){
    [...]
        }

        getUserInventory(sid, gameid, contextid, onlyTradeable, callback){
            this.manager.getUserInventoryContents(sid, gameid, contextid, onlyTradeable, (err, inventory) => {
                if(err){
                    console.log(err);
                    callback(new Error('Could not fetch user inventory'), false);
                } else {
                    if(inventory){
                        callback(err, inventory)
                    }
                }
            })
        }

    }

    module.exports = SteamBot;

     

    in another file (app.js) I then require the file above (bot.js) and instantiate a new bot:
     

    const SteamBot = require('./bots/bot.js');

    const bot = new SteamBot({
        accountName: config.botusername,
        password: config.botpassword,
        twoFactorCode: SteamTotp.generateAuthCode(config.botsharedsecret)
    });

     

     

    So far everything works. I can call the function getUserInventory() by typing bot.getUserInventory(). What I am currently trying to solve is: I need to use the function in other files also (more specifically my router files) and I don't want to instantiate a new bot since it wouldn't be practical. How exactly can I do this? Thanks 

×
×
  • Create New...