kjsmita6 / node-steam-parentbot

A module that provides a simple base class for a Steam bot that can be easliy overwritten and customized.
MIT License
33 stars 9 forks source link

smsCode #32

Closed Xeroner closed 8 years ago

Xeroner commented 8 years ago

How to provide sms code recived by sms to get bot worked? there is guardCode etc but there is no sms code option.

kjsmita6 commented 8 years ago

The email code is called guardCode while the sms code from the steam mobile app is called twoFactorCode.

Xeroner commented 8 years ago

When im typing twoFactorCode its sayis

 2016-10-05T12:05:12.025Z - warn: [csgourban1] EResult for logon: 5
withdraw_bot-8 TypeError: must start with number, buffer, array or string
withdraw_bot-8     at fromObject (buffer.js:247:9)
withdraw_bot-8     at Function.Buffer.from (buffer.js:115:10)
withdraw_bot-8     at new Buffer (buffer.js:94:17)
withdraw_bot-8     at SteamWebLogOn.webLogOn (/var/www/qcases/node_modules/steam-weblogon/index.js:26:7)
withdraw_bot-8     at SteamClient.<anonymous> (/var/www/qcases/nodes/withdraw_bot.js:86:19)
withdraw_bot-8     at emitOne (events.js:95:20)
withdraw_bot-8     at SteamClient.emit (events.js:182:7)
Xeroner commented 8 years ago

Password is good.

kjsmita6 commented 8 years ago

What is line 86 of withdraw_bot.js say?

On Oct 5, 2016 7:05 AM, "Jacek.css" notifications@github.com wrote:

Password is good.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dragonbanshee/node-steam-parentbot/issues/32#issuecomment-251655771, or mute the thread https://github.com/notifications/unsubscribe-auth/AI-FCghL-uU1v9h36pA3i8Da-dogfFlzks5qw5KdgaJpZM4KOqtg .

Xeroner commented 8 years ago

`Bot.steamClient.on('logOnResponse', function (logonResp) { //console.log('Event "logOnResponse": ' + JSON.stringify(logonResp)); if (logonResp.eresult === Steam.EResult.OK) {

    console.log('Logged in!');
    SteamBot = true;
    reWebLogOn();

}
steamWebLogOn.webLogOn(function (webSessionID, cookies) {

    manager.setCookies(cookies, function (err) {
        if (err) {
            process.exit(1); // Fatal error since we couldn't get our API key
            return;
        }

        console.log("Got API key: " + manager.apiKey);
    });
    community.setCookies(cookies);
    community.startConfirmationChecker(30000, "identitySecret");
});

});`

kjsmita6 commented 8 years ago

Which is line 86?

Xeroner commented 8 years ago
        console.log("Got API key: " + manager.apiKey);
Xeroner commented 8 years ago

Now im having

 error: [csgourban1] Error: Error 84
withdraw_bot-8     at SteamCommunity.<anonymous> (/var/www/qcases/node_modules/steamcommunity/components/twofactor.js:42:17)
withdraw_bot-8     at Request._callback (/var/www/qcases/node_modules/steamcommunity/components/http.js:62:14)
withdraw_bot-8     at Request.self.callback (/var/www/qcases/node_modules/request/request.js:200:22)
withdraw_bot-8     at emitTwo (events.js:100:13)
withdraw_bot-8     at Request.emit (events.js:185:7)
withdraw_bot-8     at Request.<anonymous> (/var/www/qcases/node_modules/request/request.js:1067:10)
withdraw_bot-8     at emitOne (events.js:95:20)
withdraw_bot-8     at Request.emit (events.js:182:7)
withdraw_bot-8     at IncomingMessage.<anonymous> (/var/www/qcases/node_modules/request/request.js:988:12)
withdraw_bot-8     at emitNone (events.js:85:20)
kjsmita6 commented 8 years ago

84 means rate limit exceeded. You are attempting to login too much and failing. Some of my dependencies are outdated so I'm going to try to update them.

Xeroner commented 8 years ago

So please do it, i will wait, keep me inform in here :)

kjsmita6 commented 8 years ago

I have updated dependencies in https://github.com/dragonbanshee/node-steam-parentbot/commit/b36a60e121f12e8b27aa606862253a56cac03e12

See if it works now. Note: this may have broken some things but I doubt it.

Xeroner commented 8 years ago
2016-11-02T07:43:22.612Z - warn: [xxxxxxx] EResult for logon: 5
8|withdraw | TypeError: must start with number, buffer, array or string
8|withdraw |     at fromObject (buffer.js:247:9)
8|withdraw |     at Function.Buffer.from (buffer.js:115:10)
8|withdraw |     at new Buffer (buffer.js:94:17)
8|withdraw |     at SteamWebLogOn.webLogOn (/var/www/qcases/node_modules/steam-weblogon/index.js:26:7)
8|withdraw |     at SteamClient.<anonymous> (/var/www/qcases/nodes/withdraw_bot.js:85:19)
8|withdraw |     at emitOne (events.js:95:20)
8|withdraw |     at SteamClient.emit (events.js:182:7)
8|withdraw |     at SteamClient.handlers.(anonymous function) (/var/www/qcases/node_modules/steam/lib/steam_client.js:281:8)
8|withdraw |     at SteamClient._netMsgReceived (/var/www/qcases/node_modules/steam/lib/steam_client.js:157:26)
8|withdraw |     at SteamClient.handlers.(anonymous function) (/var/www/qcases/node_modules/steam/lib/steam_client.js:259:10)

Still same... I put fresh twoFactorCode and still cannot login... without its loggin in but without twofactor...

kjsmita6 commented 8 years ago

what is line 85 of withdraw_bot.js?

Sent from my iPad

On Nov 2, 2016, at 02:44, Jacek.css notifications@github.com wrote:

2016-11-02T07:43:22.612Z - warn: [xxxxxxx] EResult for logon: 5 8|withdraw | TypeError: must start with number, buffer, array or string 8|withdraw | at fromObject (buffer.js:247:9) 8|withdraw | at Function.Buffer.from (buffer.js:115:10) 8|withdraw | at new Buffer (buffer.js:94:17) 8|withdraw | at SteamWebLogOn.webLogOn (/var/www/qcases/node_modules/steam-weblogon/index.js:26:7) 8|withdraw | at SteamClient. (/var/www/qcases/nodes/withdraw_bot.js:85:19) 8|withdraw | at emitOne (events.js:95:20) 8|withdraw | at SteamClient.emit (events.js:182:7) 8|withdraw | at SteamClient.handlers.(anonymous function) (/var/www/qcases/node_modules/steam/lib/steam_client.js:281:8) 8|withdraw | at SteamClient._netMsgReceived (/var/www/qcases/node_modules/steam/lib/steam_client.js:157:26) 8|withdraw | at SteamClient.handlers.(anonymous function) (/var/www/qcases/node_modules/steam/lib/steam_client.js:259:10) Still same... I put fresh twoFactorCode and still cannot login... without its loggin in but without twofactor...

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

Xeroner commented 8 years ago
Bot.steamClient.on('logOnResponse', function (logonResp) {
    //console.log('Event "logOnResponse": ' + JSON.stringify(logonResp));
    if (logonResp.eresult === Steam.EResult.OK) {

        console.log('Logged in!');
        SteamBot = true;
        reWebLogOn();
**

> // LINE 85

**
    }
    steamWebLogOn.webLogOn(function (webSessionID, cookies) {

        manager.setCookies(cookies, function (err) {
            if (err) {
                process.exit(1); // Fatal error since we couldn't get our API key
                return;
            }

            console.log("Got API key: " + manager.apiKey);
        });
        community.setCookies(cookies);
        community.startConfirmationChecker(30000, "identitySecret");
    });
});
Xeroner commented 8 years ago

Without this function its still

8|withdraw | 2016-11-02T15:10:49.755Z - error: [xxxxx] Error: Error 84
8|withdraw |     at SteamCommunity.<anonymous> (/var/www/qcases/node_modules/steam-parentbot/node_modules/steamcommunity/components/twofactor.js:42:17)
8|withdraw |     at Request._callback (/var/www/qcases/node_modules/steam-parentbot/node_modules/steamcommunity/components/http.js:67:15)
8|withdraw |     at Request.self.callback (/var/www/qcases/node_modules/request/request.js:200:22)
8|withdraw |     at emitTwo (events.js:100:13)
8|withdraw |     at Request.emit (events.js:185:7)
8|withdraw |     at Request.<anonymous> (/var/www/qcases/node_modules/request/request.js:1067:10)
8|withdraw |     at emitOne (events.js:95:20)
8|withdraw |     at Request.emit (events.js:182:7)
8|withdraw |     at IncomingMessage.<anonymous> (/var/www/qcases/node_modules/request/request.js:988:12)
8|withdraw |     at emitNone (events.js:85:20)
kjsmita6 commented 8 years ago

Post only line 85, a comment can't cause an error.

Xeroner commented 8 years ago

Line 85 is empty :)

Bot.steamClient.on('logOnResponse', function (logonResp) {
    //console.log('Event "logOnResponse": ' + JSON.stringify(logonResp));
    if (logonResp.eresult === Steam.EResult.OK) {

        console.log('Logged in!');
        SteamBot = true;
        reWebLogOn();
LINE 85
    }
    steamWebLogOn.webLogOn(function (webSessionID, cookies) {

        manager.setCookies(cookies, function (err) {
            if (err) {
                process.exit(1); // Fatal error since we couldn't get our API key
                return;
            }

            console.log("Got API key: " + manager.apiKey);
        });
        community.setCookies(cookies);
        community.startConfirmationChecker(30000, "identitySecret");
    });
});
andrewda commented 8 years ago

If line 85 is empty, you're not running the right code, or your code has not been updated for some reason. Just to be clear, we need the code on line 85 of /var/www/qcases/nodes/withdraw_bot.js.

Node.js is reporting that line 85 is causing an error in your code, and empty lines/comments are ignored by Node.

Xeroner commented 8 years ago

I run code from https://github.com/dragonbanshee/node-steam-parentbot/blob/master/examples/example-es6.js and still same issue.....

kjsmita6 commented 8 years ago

If you get an error, don't change any code if you post the error stack. I can't help you if you change your code and the error isn't correct. An empty line will never cause an error.

Xeroner commented 8 years ago

Do you have any guide step by step how to connect account with parentbot (with 2fa)

kjsmita6 commented 8 years ago

Parentbot does it automatically for you, all you need to do is run it without changing any of the code. Run the example file without changing anything.

Xeroner commented 8 years ago

Dude i need bot with 2FA.....

kjsmita6 commented 8 years ago

I just told you how to do it lol. If you can't follow these instructions you need to learn how programming works and how node works.

Xeroner commented 8 years ago

Dude, i used your example code, its not working after i put sms guard code.... don't you understand? Why you want my empty 85 line if its your code.... Are you serious ?

kjsmita6 commented 8 years ago

The error you showed earlier said that line 85 of withdraw_bot.js was causing an error. The 2fa activation happens in the built in logonresponse listener. If you want it to be activated don't make your own listener for logonresponse.

Also I've tested this module extensively and tested every part and 2fa does work as it's supposed to. If it doesn't work it's on your end bot mine.

Xeroner commented 8 years ago

I TRIED YOUR EXAMPLE CODE, I WILL WRITE YOU STEP BY STEP WHAT I DO

  1. Copy code from https://github.com/dragonbanshee/node-steam-parentbot/blob/master/examples/example-es6.js
  2. Changed username, password, guardcode to mine.
let Bot = new ChildBot('username', 'password', {
    apikey: '1234567890987654321', // default apikey option for steam
    guardCode: 'ABCDE', // put guardcode here, remove after successful login
    sellPrice: '1 ref' // add your own options
});
  1. Next bot want my sms code and shared and identity secred so i put it on like :
 twoFactorCode: '27662', //two factor authentication code, only needed if you're using the mobile 2FA
    sharedSecret: 'xxxxxxxxxxxxxxxxxxM=', //shared secret, needed to automatically generate twoFactorCode
    identitySecret: 'xxxxxxxxxxxxxxxxxsQ=' //identity secret, needed to automatically confirm trade offers, must be used with confirmationInterval

AND NEXT I RESTART THE BOT AND :

8|withdraw | 2016-11-02T15:10:49.755Z - error: [xxxxx] Error: Error 84 8|withdraw | at SteamCommunity.<anonymous> (/var/www/qcases/node_modules/steam-parentbot/node_modules/steamcommunity/components/twofactor.js:42:17) 8|withdraw | at Request._callback (/var/www/qcases/node_modules/steam-parentbot/node_modules/steamcommunity/components/http.js:67:15) 8|withdraw | at Request.self.callback (/var/www/qcases/node_modules/request/request.js:200:22) 8|withdraw | at emitTwo (events.js:100:13) 8|withdraw | at Request.emit (events.js:185:7) 8|withdraw | at Request.<anonymous> (/var/www/qcases/node_modules/request/request.js:1067:10) 8|withdraw | at emitOne (events.js:95:20) 8|withdraw | at Request.emit (events.js:182:7) 8|withdraw | at IncomingMessage.<anonymous> (/var/www/qcases/node_modules/request/request.js:988:12) 8|withdraw | at emitNone (events.js:85:20)

BOOM.... Not working.. Do you understand me now ?

Xeroner commented 8 years ago

It was working half year ago and now its not, i have fully working bot using your parentbot and now i cannot connect new one... Whats wrong...

kjsmita6 commented 8 years ago

Error 84 means you're logging in too frequently. Wait a bit and try again.

If you are getting numbers as errors it's your fault not mine, there is nothing wrong with my code. You're also getting a different error every time, meaning you keep changing things. How can i help you if you keep changing the code?

If you look at the error logs it shows exactly which files the error is happening in. You will also notice that it never says "parentbot.js" because it isn't my code, it says "withdraw_bot.js" which is your file.

On Nov 3, 2016 08:46, "Jacek.css" notifications@github.com wrote:

It was working half year ago and now its not, i have fully working bot using your parentbot and now i cannot connect new one... Whats wrong...

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/dragonbanshee/node-steam-parentbot/issues/32#issuecomment-258146340, or mute the thread https://github.com/notifications/unsubscribe-auth/AI-FChErqdTgitlLSib0_cJN5GLSOvNtks5q6eXIgaJpZM4KOqtg .

kjsmita6 commented 8 years ago

I'm closing this since it isn't a problem with this module.