Jump to content
McKay Development

TextDynasty

Member
  • Posts

    144
  • Joined

  • Last visited

Posts posted by TextDynasty

  1. Thanks for the fast reply. So the code should be this?

    var client1 = new SteamUser();
    var client2 = new SteamUser();
    
    client1.logOn({
    accountName: config.username1,
    password: config.password1,
        "twoFactorCode": SteamTotp.getAuthCode("config.shared_secret")
    });
    client2.logOn({
    accountName: config.username2,
    password: config.password2,
        "twoFactorCode": SteamTotp.getAuthCode("config.shared_secret")
    });
    
  2. You'd need two of whatever you're using to login too.

    Thanks for the fast reply. But do you mean by that?

    client.logOn({
        accountName: config.username1,
        password: config.password1,
    	"twoFactorCode": SteamTotp.getAuthCode("config.shared_secret")
    });
    client.logOn({
        accountName: config.username2,
        password: config.password2,
    	"twoFactorCode": SteamTotp.getAuthCode("config.shared_secret")
    });
    

  3. client.logOn({
    accountName: config.username1,
    password: config.password1,
    "twoFactorCode": SteamTotp.getAuthCode("shared_secret")
    });
    client.logOn({
    accountName: config.username2,
    password: config.password2,
    "twoFactorCode": SteamTotp.getAuthCode("shared_secret")
    });
  4. Hi McKay, idk why my offer was declined everytime i sent a correct offer

     

    Here is my code

    manager.on("newOffer", function(offer) {
        var metal = 0
        var key = 0    
        
        var BuyKey = (offer.itemsToReceive.forEach(function(item) {
            if (item.name == "Mann Co. Supply Crate Key")
            return key++
        }));
        var FromRef1 = (offer.itemsToGive.forEach(function(item) {
            if (item.name == "Refined Metal")
            return metal += 9
            if (item.name == "Reclaimed Metal")
            return metal += 3
            if (item.name == "Scrap Metal")
            return metal++
        }));
      if (BuyKey && FromRef1) {
    		
            if (metal == key) {
            offer.accept(function(err) {
            if (err)
                console.log(err);
            else
                console.log("They are selling " + key + " keys for " + buykeyprice * key + " refined metal.");
                console.log(colors.red("Accepting the trade offer."));
                console.log(colors.green("Trade offer accepted."));
            });
        }}        
        else {
            console.log("Trade offer not validated. Declining");
            console.log("They offered " + key + " keys and " + metal + " refined metals. ")
            offer.decline(function(err) {
                if (err) console.log(err);
            });
        }
        });
    
  5. Whats wrong with my code??

    manager.on("newOffer", function(offer) {
        var metal = 0
        var key = 0    
        
        var BuyKey = (offer.itemsToReceive.forEach(function(item) {
            if (item.name == "Mann Co. Supply Crate Key")
            return key++
        }));
        var FromRef1 = (offer.itemsToGive.forEach(function(item) {
            if (item.name == "Refined Metal")
            return metal += 9
            if (item.name == "Reclaimed Metal")
            return metal += 3
            if (item.name == "Scrap Metal")
            return metal++
        }));
      if (BuyKey && FromRef1) {
    		
            if (metal == key) {
            offer.accept(function(err) {
            if (err)
                console.log(err);
            else
                console.log("They are selling " + key + " keys for " + buykeyprice * key + " refined metal.");
                console.log(colors.red("Accepting the trade offer."));
                console.log(colors.green("Trade offer accepted."));
            });
        }}        
        else {
            console.log("Trade offer not validated. Declining");
            console.log("They offered " + key + " keys and " + metal + " refined metals. ")
            offer.decline(function(err) {
                if (err) console.log(err);
            });
        }
        });
    
    
    Trade offer not validated. Declining
    They offered 1 keys and 198 refined metals.
    
  6. Maybe somethings wrong here?

    if (BuyKey && FromRef1) {
            if (metal == key * buykeyprice) {
            offer.accept(function(err) {
            if (err)
                console.log(err);
            else
                console.log("They are selling " + key + " keys for " + buykeyprice * key + " refined metal.");
                console.log(colors.red("Accepting the trade offer."));
                console.log(colors.green("Trade offer accepted."));
            });
        }}        
    
    

    (the buykeyprice set to 198 and this shows up when received offer)

    Trade offer not validated. Declining
    They offered 1 keys and 198 refined metals.
    
×
×
  • Create New...