Jump to content
McKay Development

Ted

Member
  • Posts

    2
  • Joined

  • Last visited

Ted's Achievements

  1. 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"); });
  2. 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 play another game and such. Really appreciate all feedback.
×
×
  • Create New...