SpiTik Posted November 29, 2018 Report Posted November 29, 2018 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 Quote
SpiTik Posted November 29, 2018 Author Report Posted November 29, 2018 (edited) Fixed SteamUser.prototype._steamGuardPrompt = function(domain, lastCodeWrong, callback) Edited November 29, 2018 by SpiTik Quote
Dr. McKay Posted November 29, 2018 Report Posted November 29, 2018 Why are you overriding the prototype? Don't do that, just use the steamGuard event. Quote
SpiTik Posted November 30, 2018 Author Report Posted November 30, 2018 Why are you overriding the prototype? Don't do that, just use the steamGuard event.Idk how this event work, im want log to bot with steam chat Quote
SpiTik Posted November 30, 2018 Author Report Posted November 30, 2018 (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 November 30, 2018 by SpiTik Quote
Dr. McKay Posted December 1, 2018 Report Posted December 1, 2018 Have you set the promptSteamGuardCode option to false? Quote
SpiTik Posted December 1, 2018 Author Report Posted December 1, 2018 and i have one error i off script and one from two log accs work after off Quote
SpiTik Posted December 1, 2018 Author Report Posted December 1, 2018 Bot work After restart PC wtf Quote
SpiTik Posted December 3, 2018 Author Report Posted December 3, 2018 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. Quote
Dr. McKay Posted December 4, 2018 Report Posted December 4, 2018 You need to remove your friendMessage listener after you get your Steam Guard code, otherwise it tries to login again later with the old details. Quote
Recommended Posts
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.