Ted Posted January 1, 2018 Report Posted January 1, 2018 Hello, Everyone What I am trying to do is use Telegram and my own bot there to start and stop the steam idle bot my current code is below.So the problem I am having is I have no clue as to how to tell the bot to start playing a game from what I understand "client.on('loggedOn', function(details)" is what happens when the bot has logged on when i put "client.gamesPlayed([107410]);" it plays Arma 3 right when it log's on but I want it to stop and playanother game and such. Really appreciate all feedback. var TelegramBot = require('node-telegram-bot-api');var SteamUser = require('steam-user');var prompt = require('prompt');const bot = new TelegramBot(TOKEN, {polling: true});function steamlogin(){ var SteamUser = require('steam-user');var prompt = require('prompt'); var client = new SteamUser();var prompt = require('prompt'); var properties = [{name: 'username',validator: /^[a-zA-Z\s\-]+$/,warning: 'Username must be only letters, spaces, or dashes'},{name: 'password',replace: '*',hidden: true}]; prompt.start(); prompt.get(properties, function (err, result) {if (err) { return onErr(err); }console.log('Thank you for logging in.'); client.logOn({"accountName": result.username,"password": result.password}); }); function onErr(err) {console.log(err);return 1;}client.on('loggedOn', function(details) {console.log("Logged into Steam as " + client.steamID.getSteam3RenderedID());client.setPersona(SteamUser.EPersonaState.Online); }); }function arma3(){client.gamesPlayed([107410]);}bot.onText(/\/login/, (msg) =>{steamlogin();bot.sendMessage(msg.chat.id,"Starting Login Process. SEE TERMINAL FOR MORE INFO");});bot.onText(/\/arma/, (msg) =>{bot.sendMessage(msg.chat.id,"Started Arma 3");arma3();}); Quote
Dr. McKay Posted January 1, 2018 Report Posted January 1, 2018 Just call client.gamesPlayed again with a different AppID. Quote
Ted Posted January 3, 2018 Author Report Posted January 3, 2018 Yes, i figured out the problem. Thanks to @Vanilla and thank you Dr.McKay for all your hard work and dedication. Here is the working code if anyone wants it. var TelegramBot = require('node-telegram-bot-api'); var SteamUser = require('steam-user'); var prompt = require('prompt'); const TOKEN = 'YOUR TOKEN HERE'; const bot = new TelegramBot(TOKEN, {polling: true}); var client = new SteamUser(); function steamlogin() { var properties = [ { name: 'username', validator: /^[a-zA-Z\s\-]+$/, warning: 'Username must be only letters, spaces, or dashes' }, { name: 'password', replace: '*', hidden: true } ]; prompt.start(); prompt.get(properties, function (err, result) { if (err) { return onErr(err); } console.log('Thank you for logging in.'); client.logOn({ "accountName": result.username, "password": result.password }); }); function onErr(err) { console.log(err); return 1; } client.on('loggedOn', function(details) { console.log("Logged into Steam as " + client.steamID.getSteam3RenderedID()); client.setPersona(SteamUser.EPersonaState.Online); }); } function arma3() { client.gamesPlayed([123456]); } bot.onText(/\/login/, (msg) => { steamlogin(); bot.sendMessage(msg.chat.id,"Starting Login Process. SEE TERMINAL TO COMPLETE THE PROCESS"); }); bot.onText(/\/arma/, (msg) => { bot.sendMessage(msg.chat.id,"Started Arma 3"); arma3(); }); bot.onText(/\/none/, (msg) => { client.gamesPlayed([]); }); bot.onText(/\/kill/, (msg) => { bot.sendMessage(msg.chat.id,"Process Killed"); process.exit() }); bot.onText(/\/help/, (msg) => { bot.sendMessage(msg.chat.id,"/login = Login"); bot.sendMessage(msg.chat.id,"/arma = Start playing Games"); bot.sendMessage(msg.chat.id,"/none = Stop playing games"); bot.sendMessage(msg.chat.id,"/kill = Kill the process"); }); Quote
Richardnab Posted March 3, 2018 Report Posted March 3, 2018 When I press start auto playing it doesnt auto move the mouse to the battle button it was working last night 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.