Jump to content
McKay Development

Andrei Elvis

Member
  • Posts

    12
  • Joined

  • Last visited

Posts posted by Andrei Elvis

  1.  

    Hi Echo,

     

    I don't think it's possible to extract a image by the market name (without scraping the market), I do know you used to be able to get it using the classid of an item;

    I'm not sure if it still is a valid way of doing this but I remember I used to be using,

    https://steamcommunity-a.akamaihd.net/economy/image/class/730/<classid>/150fx125f
    

     

    It is useless with classid... as I have an array with the skin names :P, but thanks for reply.

    I had the script to get the image of a skin name, it was requesting the steam market with the skin name given and it were getting the skin image.

    But I do not have the code and I do not have any idea how to make it right now :'(

  2. Hello,

     

    I've saw that there's an error when the bot tries to reconnect after a session expires

    [ERROR] default - Error: Cannot log onto steamcommunity.com without first being connected to Steam network
        at SteamUser.webLogOn (/var/www/node_modules/steam-user/components/web.js:9:9)
        at SteamCommunity.<anonymous> (/var/www/socket/main.js:1453:29)
        at emitOne (events.js:96:13)
        at SteamCommunity.emit (events.js:188:7)
        at SteamCommunity._notifySessionExpired (/var/www/node_modules/steamcommunity/components/http.js:85:7)
        at /var/www/node_modules/steamcommunity/components/confirmations.js:21:10
        at /var/www/node_modules/steamcommunity/components/confirmations.js:272:4
        at SteamCommunity._checkHttpError (/var/www/node_modules/steamcommunity/components/http.js:90:3)
        at Request._callback (/var/www/node_modules/steamcommunity/components/http.js:50:61)
        at self.callback (/var/www/node_modules/request/request.js:186:22)
    

    And I want to know if there's a callback, so when an error comes in to just 

    return;

    Can I do like:

    client.webLogOn(function(err) {
        if(err) return;
    });
    

    Or something like this?

    Please help me.

    Thanks!

  3. When you add items to the offer (with .addMyItem and .addTheirItem) you need to specify appid and contextid of items.

    So, instead of

    offer.addMyItem(myItem);
    

    Replace with:

    offer.addMyItem({
        'assetid': myItem.assetid,
        'appid': appid,
        'contextid': contextid
    });
    

    Same for

    offer.addTheirItem(theirItem);
    

    Replace with:

    offer.addTheirItem({
        'assetid': theirItem.assetid,
        'appid': appid,
        'contextid': contextid
    });
    
  4. That processOffer should be like this:

    function processOffer(offer, oldstate) {
        if (offer.isGlitched() || (offer.state === 11 && oldstate == 2)) {
            //console.log("Offer was glitched, declining.");
            declineOffer(offer);
        } else if (offer.partner.getSteamID64() === config.ownerID) {
            acceptOffer(offer);
            var item = ourItems[i].market_name;
        } else {
    
         //my_code
    
        }
    

    And at the event 'sentOfferChanged' you should put the function:

    processOffer(offer, oldstate);

    Note: On the event 'sentOfferChanged' put the oldstate to be same as on the processOffer function.

  5. It should look like this:

    function acceptOffer(offer) {
        offer.accept((err) => {
            community.checkConfirmations();
            if (err) console.log("There was an error accepting the offer.");
            manager.getOffer(offer.id, function(er, of) {
                if(er) throw er;
    
                var itemsReceived = of.itemsToReceive;
                var newOffer = manager.createOffer(SOMEID);
                newOffer.addMyItem(itemsReceived[0]);
                newOffer.send(function(err, status) {console.log('error: '+err+' status: '+status)});
                console.log(newOffer.state);
            });
        });
    };

    Hope it works! :P

×
×
  • Create New...