Jump to content
McKay Development

African

Member
  • Posts

    20
  • Joined

  • Last visited

Posts posted by African

  1. > Non-object method name: inviteUserToGroup

    Ok, I think I understand. The inviteToGroup needs to be user.inviteToGroup(groupID) while you can also use community.inviteUserToGroup(userID, groupID).

     

    Last question, when using the object method version(user.inviteToGroup) how does the script know who its inviting to the group? It's not like you can log into that account.

  2. After looking through the wiki for the SteamCommunity module I cannot find the method for inviting a user to a group. Can someone please tell me where to find info about it and how to use it.

     

    Thanks

     

    EDIT: I found where the function is mentioned but it doesn't look like its used how other people are using it as seen here.

  3. Event for sending a message...

     

    You sure you're not looking for a function to send a message?

    No, I am working on a bot for a friend. I made it so when someone types !pause the bot won't respond to commands. He wants it to be able to be !pause from himself so his friends don't have to always !pause. I'm not trying to send a message, just know when I've sent one, who to, and the message itself

  4. function compareItems(offer){
        var myItems=0;
        var yoItems=0;
        //need to get items "specialty" value and multiply by percent
        for (var index = 0; index < offer.itemsToGive.length; ++index) {
            var x= offer.itemsToGive[index].market_hash_name;
            var price=list[x].safe_price;
            console.log(x);
            console.log(price);
            if(price!=0){
                myItems+=price;
                logger.info("Used v2 pricing");
            }
            else{
               // myItems+=list[x].7_days.average_price;
               steamlytics.csgo.prices(x, function(err, data){
                   if(err)
                    logger.error(err);
                    else{
                        myItems+=data.median_price;
                        logger.info("Used regular price function");
                        console.log(data.median_price);
                    }
               });
            }
        }
        for (var index = 0; index < offer.itemsToRecieve.length; ++index) {
            var x= offer.itemsToRecieve[index].market_hash_name;
            var price=list[x].safe_price;
            console.log(x);
            console.log(price);
            if(price!=0){
                yoItems+=price;
                logger.info("Used v2 pricing");
            }
            else{
               // myItems+=list[x].7_days.average_price;
               steamlytics.csgo.prices(x, function(err, data){
                   if(err)
                    logger.error(err);
                    else{
                        yoItems+=data.median_price;
                        logger.info("Used regular price function");
                        console.log(data.median_price);
                    }
               });
            }
        }
      
        return myItems < yoItems;
    }
    

    I tried using the above code to run through an offer and compare the prices of each side. I get an error with the length property of the array itemsToGive/Recieve although in the API it is stated that they are arrays. I received the following error.

     

     

    C:\node\fixed.js:335

        for (var index = 0; index < offer.itemsToRecieve.length; ++index) {
                                                        ^
     
    TypeError: Cannot read property 'length' of undefined
        at compareItems (C:\node\fixed.js:335:53)
        at manageOffer (C:\node\fixed.js:274:8)
        at TradeOfferManager.<anonymous> (C:\node\fixed.js:192:5)
        at emitOne (events.js:96:13)
        at TradeOfferManager.emit (events.js:188:7)
        at received.forEach (C:\node\node_modules\steam-tradeoffer-manager\lib\polling.js:235:10)
        at Array.forEach (native)
        at getOffers (C:\node\node_modules\steam-tradeoffer-manager\lib\polling.js:219:12)
        at Helpers.checkNeededDescriptions (C:\node\node_modules\steam-tradeoffer-manager\lib\index.js:359:4)
        at Object.exports.checkNeededDescriptions (C:\node\node_modules\steam-tradeoffer-manager\lib\helpers.js:90:3)
        at _apiCall (C:\node\node_modules\steam-tradeoffer-manager\lib\index.js:350:11)
        at SteamCommunity._community.httpRequest (C:\node\node_modules\steam-tradeoffer-manager\lib\webapi.js:54:3)
        at Request._callback (C:\node\node_modules\steamcommunity\components\http.js:67:15)
        at Request.self.callback (C:\node\node_modules\request\request.js:188:22)
        at emitTwo (events.js:106:13)
        at Request.emit (events.js:191:7)
     

    I will attempt to do the same thing using a for-of or forEach loop. I will post again shortly with whatever happens.

     

     

    Thanks for reading

     

     

    EDIT: When I did a for-of loop it didn't give me errors, but nothing ever printed out, meaning the loop never ran. I'll look through the rest of my code to try and find why.

     

    This is my code

  5. I just finished making the bare essentials of my Trade Bot. I'm looking for a way to get reliable pricing on items. I am not sure what to use as I want information that is up to date and accurate.


     


    So far I have found the following: 


    https://www.npmjs.com/package/node-steamlytics


    https://www.npmjs.com/package/csgo-market 


    https://www.npmjs.com/package/@node-steam/market-pricing


    https://www.npmjs.com/package/steam-market-pricing 


    https://github.com/andrewda/CSGOItemDB


     


    Does anyone have any recommendations on what to use?


  6. Please read the whole documentations. https://github.com/DoctorMcKay/node-steam-totp#gettimeoffsetcallback . You will have to add the callback time, to getAuthCode timeOffset property.

    I tried this, it worked and logged in but then gave me the following error.

     

     

    EDIT: Nevermind, I was using the wrong value for my identity_secret. I changed it and it worked

    var timeOffset;
    //getting offset for log in
    SteamTotp.getTimeOffset(function(error, offset, latentcy){
        timeOffset=offset;
    });
    
    client.logOn({
        accountName: Config.username,
        password: Config.password,
        twoFactorCode: SteamTotp.getAuthCode(Config.shared_secret, timeOffset)
    });
    

     

    5:19:46 PM - error: Unable to accept offer 2137947588: It looks like your Steam Guard Mobile Authenticator is providing incorrect Steam Guard codes.

    This could be caused by an inaccurate clock or bad timezone settings on your device.

    If your time settings are correct, it could be that a different device has been set up to provide the Steam Guard codes for your account, which means the authenticator on this device is no longer valid.

  7. Change it to

     

    if (offer.partner.getSteamID64() === Config.admin || offer.itemsToGive.length === 0) {
            logger.info("User "+ offer.partner.getSteam3RenderedID() +" offered a valid trade.  Trying to accept offer.");
            offer.accept(function (err, status) {
            if (err) {
                logger.error("Unable to accept offer "+ offer.id +": " + err.message);
            } else {
                logger.info("Offer Status:", status);
                }
        });
    
    Check what status outputs.

     

    Also remember that if its not a "donation offer" you have to confirm the trade after accepting it

    How can I confirm it, I started the confirmation checker when the client gets a web session. I am at school right now so I will post the code of how I thought it was confirmed when I get home.

  8. Hello,

     

    I have been working on a trade bot. I set it up so that it will accept any trade from me(admin) or a donation(not giving items). So far it accepts all donations but is having issues accepting trades from me. I have made sure my SteamID in my config is SteamID64. According to the console output, it says the trade should have been accepted although it hasn't. Here's the console output and heres my code. Feel free to add me on steam if you think you can help. 

     

    http://steamcommunity.com/id/swagattack835/

     

     

    10:02:32 PM - info: New offer #2137947588 from [u:1:108568888]

    10:02:32 PM - info: User [u:1:108568888] offered a valid trade.  Trying to accept offer.
    10:02:34 PM - info: Offer accepted
    // Accept any trade offer from the bot administrator, or where we're getting free stuff.
        if (offer.partner.getSteamID64() === Config.admin || offer.itemsToGive.length === 0) {
            logger.info("User "+ offer.partner.getSteam3RenderedID() +" offered a valid trade.  Trying to accept offer.");
            offer.accept(function (err) {
            if (err) {
                logger.error("Unable to accept offer "+ offer.id +": " + err.message);
            } else {
                logger.info("Offer accepted");
                }
        });
    

    Thanks,

     

    African

  9. Hello all,

     

    I just finished working on a bot using this tutorial. After trying to use it I noticed from debugging this:

    Exception has occurred: Error
    TypeError: Cannot read property 'on' of undefined
        at Object.<anonymous> (c:\node\tradebot.js:127:15)
        at Module._compile (module.js:570:32)
        at Object.Module._extensions..js (module.js:579:10)
        at Module.load (module.js:487:32)
        at tryModuleLoad (module.js:446:12)
        at Function.Module._load (module.js:438:3)
        at Timeout.Module.runMain [as _onTimeout] (module.js:604:10)
        at ontimeout (timers.js:386:14)
        at tryOnTimeout (timers.js:250:5)
        at Timer.listOnTimeout (timers.js:214:5) 

    Here is the code causing the error.

    client.friends.on('relationships', function(){ 

    After closely looking at the comments in the guide I saw McKay said this:

     

     

     

    client.friends was removed in node-steam-user v2.0.0. You’ll want the newest v1.x.x, which is 1.13.0.

     So to fix the issue do I download the github repo for steam-user and override mine with the 1.13.0 version?

     

    Otherwise how would you go about doing things involving friends without using client.friends.on() ?

     

     

    Thanks for your time and help

  10. Hello,

     

    I used the following code to log into my account, yet when I run the script, I'm still prompted for a Steam Guard Code in terminal.

    This wouldn't be an issue except the bot doesn't log in until I input the code, yet it's supposed to auto generate it itself so not to have to deal with this.

    I know my shared_secret is correct because it is in the exact same format as the example one.

    var SteamTotp = require('steam-totp');
    
    client.logOn({
        accountName: Config.username,
        password: Config.password,
        twoFactorCode: SteamTotp.generateAuthCode(Config.shared_secret)
    });
    

    Any ideas what I need to change?

     

     

    Thanks for your help

×
×
  • Create New...