Jump to content
McKay Development

Recommended Posts

Posted
const logOnOptionsBot = {
  accountName: "xxx",
  password: "xxx",
  twoFactorCode: SteamTotp.generateAuthCode("xxxxxxxxxxxxxxxxxxx")
};
bot1.logOn(logOnOptionsBot);
bot1.on("loggedOn", () => {
    console.log("Starting ...");
    sleep(2);
    console.log("Bot");
    client.setPersona(SteamUser.Steam.EPersonaState.Online);

});

const logOnOptions = {
  accountName: "xxx",
  password: "xxx",
};

SteamUser.prototype._steamGuardPrompt = function(domain, lastCodeWrong, code) {
	if (this.options.promptSteamGuardCode) {
    bot1.on("friendMessage", (steamid, message) => {
          if(message.indexOf("!guard") === 0) {
            var code = (message.replace(/^!guard ?/, ""));
            callback(code);
        }
      });
	} else {
		this.emit('steamGuard', domain, callback, lastCodeWrong);
	}
};

client.logOn(logOnOptions);
client.on("loggedOn", () => {
    console.log("Starting ...");
    sleep(2);
    console.log("You are logged in as : SpiTik Bot");
    client.setPersona(SteamUser.Steam.EPersonaState.Online);
    client.gamesPlayed(["test"]);

});

Im try create type steam guard to the steam chat with command and i have problem and i dont know where is problem 

 

 

error : 

 
            callback(code);
            ^
 
ReferenceError: callback is not defined
 
Thanks for Help
Posted (edited)

not work 

 
client.on('steamGuard', function (domain, callback) {
    console.log("Steam Guard code needed from ");
      botGuard.chatMessage(clientID, "[bOT] : Idle bot are started please enter you guard. Write !guard <code>");
      botGuard.on("friendMessage", (steamid, message) => {
          if(message.indexOf("!guard") === 0) {
              var code = (message.replace(/^!guard ?/, ""));
              callback(code);
            } else {
              botGuard.chatMessage(steamid, "[bOT] : Unknow command please contact support. If you dont know hot to use bot, bot is not for you!!")
          }
        });
});
Edited by SpiTik
Posted

And i have problem if im write two times in a row !guard guard script crashed Error : Already logged on , cannot logon again. Can you help me with this. Im try use client1.on('disconnect', function () { setTimeout(function () { start(); }, 10000); }); and not work.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...