Jump to content
McKay Development

Tayhayy

Member
  • Posts

    9
  • Joined

  • Last visited

Posts posted by Tayhayy

  1. I have this code so far

    origin.js
    const SteamCommunity = require("steamcommunity");
    const origin = new SteamCommunity();
    module.exports = { origin };
    __________________________________________________________________________________________________
    
    index.js
    const { origin } = require("./origin.js");
    
    origin.login({ accountName: originuser, password: originpass, authCode: "", twoFactorCode: "", captcha: "" }, function (err) {
      if (!err) {
        console.log("logged into origin");
      }
      // call worker
    });
    
    __________________________________________________________________________________________________
    
    worker.js
    const { origin } = require("./origin.js");
    const { workerData } = require("worker_threads");
    
    origin.editProfile({ customURL: workerData }, function (err) {
      if (!err) {
        console.log("changed url on origin");
    });

    Yet I get an error in worker.js saying I'm not logged in, I assume this is because it is creating a new steamcommunity every time require("./origin.js") is called, so how can I share the same steamcommunity across multiple workers, so I don't have to login inside each worker?

  2. So currently on steam, you can give awards to users via the golden badge at the right of their profile, you can also do this to their screenshots, reviews, artwork etc.

    There are multiple type of awards, 21 of them in total, so there should be an option to select the award you would like to give.

    Example implementation:

    community.award({ recipient: "https://steamcommunity.com/id/lcl", type: 4 }, function (err) {
    	if (!err){
    		console.log("Gave award to recipent successfully!");
    	} else {
    		console.log(err)
    		// This should say something like "You don't have enough Steam Points to give the recipent an award!"
    	}
    });

    In addition, there should also be a getPoints() function for the currently logged in user.

    Example implementation:

    community.getPoints({ /* Nothing here since you can only get the amount of points from yourself */ }, function (err, points) {
    	if (points){
    		console.log(`You have ${points} points!`);
    	}
    });

    Note that there is also https://steamcommunity.com/id/lcl/awards/, but I don't think an implementation for that is needed since you can get the needed info from parsing the HTML.

  3. I've done this:

    var SteamCommunity = require("steamcommunity");
    
    let account1 = new SteamCommunity();
    let account1user = "n318UAzhS";
    let account1pass = "7fdIVMpt";
    
    account1.login({ accountName: account1user, password: account1pass, authCode: "", twoFactorCode: "", captcha: "" }, function (err) {
        account1.getSteamUser({ id: account1.steamID }, function (user) {
            console.log(user);
        });
    });

    Yet it's giving me this

                    throw new Error("id parameter should be a user URL string or a SteamID object");
                    ^
    
    Error: id parameter should be a user URL string or a SteamID object

    Any ideas?

  4. How can this be accomplished with the code I provided?

    var SteamCommunity = require("steamcommunity");
    var account = new SteamCommunity();
    let accountName = "username";
    let password = "password";
    account.login({ accountName: accountName, password: password, authCode: "", twoFactorCode: "", captcha: "" }, function (err) {
    	// log customurl of the account i logged into
    }

     

×
×
  • Create New...