Jump to content
McKay Development

Lesu

Member
  • Posts

    11
  • Joined

  • Last visited

Posts posted by Lesu

  1. Considering then that I cannot eternally bind an assetid from a bot to a person as for different reasons it may as well change before it is traded back to someone else, do you think it would be good practice to instead bind the classid and instanceid, as the combination, as I understood here --> https://dev.doctormckay.com/topic/332-identifying-steam-items/ <-- , seems to be unique for as long as the item's properties go? Are sticker and item wear *percentage* from CS:GO also considered in the uniqueness of these IDs?

  2. When you think you know how to fully scroll down a page, and this happens... thanks!

     

    EDIT: Sorry, one last thing, does it work if a trade is cancelled? Apparently assetids can change when items are involved in trades even if they aren't completed, is there a way to get the ID of an item that just changed it because it felt like it during a broken trade?

  3. Greetings,

     

    Is there any way to fetch contextIDs from Spiral Knight user inventories? I'd give more information, but there's really nothing more to it. If it could be possible, I'd like to load user inventories from Spiral Knights in order to implement trades for it, however this specific game's contextids are quite dynamic and I'd need to know them for to load inventories, or some range to test from, whatever way would make this possible. Many thanks for your attention.


  4. var bot = new SteamCommunity();
    var offers = new TradeOfferManager({
    steam: bot,
    domain: config.domain,
    language: "en",
    pollInterval: 10000,
    cancelTime: 300000
    });
    SteamTotp.getAuthCode(my_shared_secret, function(err, code) {
    if (err) logger.debug(err.message);
    logger.debug(code);
    bot.login({
    "accountName": config.username,
    "password": config.password,
    "twoFactorCode": code
    }, function(err, cookies) {
    if (err) logger.debug(err.message);
    logger.debug(cookies);
    logger.debug("Login successful as: " + bot.steamID.getSteam3RenderedID());
    offers.setCookies(cookies, function(err) { // This is where it fails, doesn't even run the callback
    if (err) logger.debug(err.message);
    logger.debug("Cookies set successfully, proceeding to extracting inventory...");
    offers.loadUserInventory(certain_steamid64, 570, true, function(inventory) { logger.debug(inventory);});
    });
    });
    });
  5. Aha, since it seemed like some kind of internal error I didn't think it could've been the root of the problem, many thanks. However, if I try to set cookies with setCookies, this happens:

    /var/lib/openshift/579916d07628e13b0f000010/app-root/runtime/repo/node_modules/steamcommunity/index.js:214
    	cookies.forEach(function(cookie) {
    	        ^
    
    TypeError: cookies.forEach is not a function
        at SteamCommunity.setCookies (/var/lib/openshift/579916d07628e13b0f000010/app-root/runtime/repo/node_modules/steamcommunity/index.js:214:10)
        at TradeOfferManager.options._steam.on._steam.on.TradeOfferManager.setCookies.checkDone [as setCookies] (/var/lib/openshift/579916d07628e13b0f000010/app-root/runtime/repo/node_modules/steam-tradeoffer-manager/lib/index.js:78:18)
        at /var/lib/openshift/579916d07628e13b0f000010/app-root/runtime/repo/app.js:125:10
        at SteamCommunity.<anonymous> (/var/lib/openshift/579916d07628e13b0f000010/app-root/runtime/repo/node_modules/steamcommunity/index.js:162:5)
        at Request._callback (/var/lib/openshift/579916d07628e13b0f000010/app-root/runtime/repo/node_modules/steamcommunity/components/http.js:67:15)
        at Request.self.callback (/var/lib/openshift/579916d07628e13b0f000010/app-root/runtime/repo/node_modules/steamcommunity/node_modules/request/request.js:187:22)
        at emitTwo (events.js:87:13)
        at Request.emit (events.js:172:7)
        at Request.<anonymous> (/var/lib/openshift/579916d07628e13b0f000010/app-root/runtime/repo/node_modules/steamcommunity/node_modules/request/request.js:1044:10)
        at emitOne (events.js:77:13)
    
    

    I can output the cookies passed out of the login's callback, which are represented by an alphanumeric string, but inputting them into setCookies somehow fails with this. I must be doing something very stupid again but I couldn't guess it, any help with that as well? Sorry for the inconvenience.

     

    (I switched into steamcommunity again instead of steam-user, however it still logs in so I don't think I could've screwed that part up, methinks)

  6. Helloes people and Dr. McKay,

     

    Calling loadUserInventory with an instance of TradeOfferManager throws this error (running on a nodejs vs 4 cartridge at openshift):

     

     

    /var/lib/openshift/579916d07628e13b0f000010/app-root/runtime/repo/node_modules/steamcommunity/components/users.js:267
        var endpoint = "/profiles/" + userID.getSteamID64();
                                             ^

    TypeError: userID.getSteamID64 is not a function
        at SteamCommunity.getUserInventory (/var/lib/openshift/579916d07628e13b0f000010/app-root/runtime/repo/node_modules/steamcommunity/components/users.js:267:39)
        at TradeOfferManager.options._steam.on._steam.on.TradeOfferManager.setCookies.TradeOfferManager.parentalUnlock.TradeOfferManager._checkApiKey.TradeOfferManager.loadUserInventory (/var/lib/openshift/579916d07628e13b0f000010/app-root/runtime/repo/node_modules/steam-tradeoffer-manager/lib/index.js:153:18)
        at SteamUser.<anonymous> (/var/lib/openshift/579916d07628e13b0f000010/app-root/runtime/repo/app.js:127:9)
        at emitTwo (events.js:87:13)
        at SteamUser.emit (events.js:172:7)
        at SteamUser._handlers.(anonymous function) (/var/lib/openshift/579916d07628e13b0f000010/app-root/runtime/repo/node_modules/steam-user/components/logon.js:268:9)
        at SteamUser._handleMessage (/var/lib/openshift/579916d07628e13b0f000010/app-root/runtime/repo/node_modules/steam-user/components/messages.js:200:29)
        at emitThree (events.js:97:13)
        at CMClient.emit (events.js:175:7)
        at CMClient._netMsgReceived (/var/lib/openshift/579916d07628e13b0f000010/app-root/runtime/repo/node_modules/steam-client/lib/cm_client.js:278:8)

     

    This error appears when I both instantiate tradeoffer-manager and login with another instance of steam-user, although the same error is shown when I use steamcommunity (although I guess slightly different so that the references to SteamUser are references to SteamCommunity?)...wait what?

     

    Here is the related code;

    var SteamUser = require('steam-user');
    var SteamTotp = require('steam-totp');
    var TradeOfferManager = require('steam-tradeoffer-manager');
    
    var SU = new SteamUser();
    var offers = new TradeOfferManager({
        steam:        SU,
        domain:       config.domain, 
        language:     "en",
        pollInterval: 10000,
        cancelTime:   300000
    });
    SteamTotp.getAuthCode(my_shared_secret, function(err, code) {
    	if (err) logger.debug(err.message);
    	logger.debug(code);
    	SU.logOn({
    		"accountName": config.username,
    		"password": config.password,
    		"twoFactorCode": code
    	});
    });
    
    SU.on('loggedOn', function (details) {
    	logger.debug("Login successful as: " + SU.steamID.getSteam3RenderedID());
    	offers.loadUserInventory(my_steamID64, 570, true, function(inventory) { logger.debug(inventory);});
    });
    

    (again, same happens if I use node-steamcommunity and try to call loadUserInventory from it's own login function's callback.)

     

    I have been able to enable two-factor authentication and login with steam-totp ever since, so I've no idea where the problem could lie anymore. Any ideas? Many thanks regardless.

×
×
  • Create New...