Jump to content
McKay Development

TomYoki

Member
  • Posts

    82
  • Joined

  • Last visited

Posts posted by TomYoki

  1. Hello, I've been working on a function on my bot that requires the user to insert different user's steamID64 (through chat message).

    The problem is I need this to be an integer.

    I already tried parseInt(), parseFloat() & Math. Functions, but for some reason this changes last 2 numbers of the ID to 20. (I also tried adjusting the base values (parseInt(msg[1], 10))

     

    Any help would be appreciated!

  2. Here's how you can automatically accept them, it will also log who has added you

     

    client.on('friendRelationship', function(steamID, relationship) {
    
        if (relationship == SteamUser.Steam.EFriendRelationship.RequestRecipient) {
            client.addFriend(steamID);
            console.log("Accepted friend request from: " + steamID);
            client.chatMessage(steamID, "This line is optional, this message user will receive when bot is added.");
        }
        });
    
  3. Thanks

    Probably I will use get request, but can I use getGameBadgeLevel(gamId, callback) with steamid?

    You could use this module

    https://github.com/DPr00f/steam-api-node

    player.GetSteamLevel(optionalSteamId).done(function(result){
      console.log(result);
    });
    
    player.GetPlayerLevelDetails(optionalSteamId).done(function(result){
      console.log(result);
    });
    
    player.GetBadges(optionalSteamId).done(function(result){
      console.log(result);
    });
    
    player.GetCommunityBadgeProgress(optionalBadgeId, optionalSteamId).done(function(result){
      console.log(result);
    });
    
  4. Oh, I forgot to set manager when calling the function.

    Now I have new issue tho

    \node_modules\steamcommunity\components\users.js:357
                            "uri": "https://steamcommunity.com/inventory/" + userID.getSteamID64() + "/" + appID + "/" + contextID,
                                                                                   ^
    
    TypeError: Cannot read property 'getSteamID64' of null
    

    I used to have this before I set SteamID for tradeoffer manager,

    and it works fine when I call it from chat command.

    However functions don't seem to like it :(

     

    Part of code:

    function LoadInventory(manager, callback){
        manager.getInventoryContents(440, 2, true, function(err, inventory) {
                if (err) {
                    console.log(err);
                    return;
                }
    
                if (inventory.length == 0) {
                    // Inventory empty
                    console.log("TF2 inventory is empty");
                    return;
                } else {
    
                       //My tids and bits          
    
                console.log("Found " + inventory.length + " TF2 items");
                }
            });
        setTimeout(LoadInventory, 3600000);
    }
    
    LoadInventory(manager);
    
  5. Hello, I tried making getInventoryContents into a function so It'd be able to update time to time,

    however I get this error:

    :384
        manager.getInventoryContents(440, 2, true, function(err, inventory) {
               ^
    
    TypeError: Cannot read property 'getInventoryContents' of undefined
    

    Part of code:

    function LoadInventory(manager, callback){
        manager.getInventoryContents(440, 2, true, function(err, inventory) {
                if (err) {
                    console.log(err);
                    return;
                }
    
                if (inventory.length == 0) {
                    // Inventory empty
                    console.log("TF2 inventory is empty");
                    return;
                } else {
    
    
  6. So I've been making my bot and I came up with that I need to check item description for item within trade offer, 

    I found this https://github.com/DoctorMcKay/node-steamcommunity/wiki/CEconItem#descriptions

    but item.descriptions & item.description doesn't seem to work.

    This is my part of the code:

        offer.itemsToReceive.forEach(function(item) {
    
    (this is the 388th line) if (item.appid == "my app ID" &&  item.type.match("My match")) {
            if(item.descriptions.match("my description match")){
            return
    } 

    This is the output: 

    .js:388
                    if(item.descriptions.match("my description match we were talking about")){
                                         ^
    
    TypeError: item.descriptions.match is not a function
    
  7. How do you check if appid is 753? Before I tried just item.name == "Cards name" and it worked fine, does this means I made sure that appid is 753? Also I'm making trading card bot, so under this line it makes sure that all other items are metals. And no - I don't think I provided language.

×
×
  • Create New...