Jump to content


Photo
Question

Logout via Chat Message

node.js node-steam-user

Best Answer CellSplitter , 03 April 2019 - 11:48 PM

Sometimes you do not see the forest for the trees.🙄

Thx, now it works fine 🤙 Go to the full post


  • Please log in to reply
2 replies to this topic

#1 CellSplitter

CellSplitter

    Member

  • Member
  • PipPip
  • 20 posts

Posted 03 April 2019 - 09:50 AM

Hey, iam work on new functions for my BOT.
I am currently working on boosting my main account via chat message to my BOT. The login works fine, but the logout does not work and I can't find the error

Here my Code:

// Boost Owners Account START
		else if (MSG.toUpperCase().indexOf("!STARTBOOST") >= 0) {
			
			let BoostClient = new SteamUser(),
			BoostManager = new TradeOfferManager({
				"steam": BoostClient,
				"pollInterval": "10000",
				"cancelTime": "1800000" // 30m in ms
			}),
			BoostCommunity = new SteamCommunity();
									
					let BoostLogOnOptions = {
						accountName: CONFIG.Boost.USERNAME,
						password: CONFIG.Boost.PASSWORD,
						twoFactorCode: SteamTotp.generateAuthCode(CONFIG.Boost.SHAREDSECRET)
					};
					BoostClient.logOn(BoostLogOnOptions);

					BoostClient.on("loggedOn", function() {
						BoostClient.getPersonas([BoostClient.steamID], (personas) => {
							sleep(500);
							console.log("[Boost Steam Account] - Login successfully!");
							client.chatMessage(SENDER, "[Boost Steam Account] - Login successfully!");
							BoostClient.setPersona(SteamUser.Steam.EPersonaState.Online);
							BoostClient.gamesPlayed(730);
					   });
					});

					BoostClient.on('webSession', (sessionid, cookies) => {
					   BoostManager.setCookies(cookies);
					   BoostCommunity.setCookies(cookies);
					   sleep(2000);
					   console.log("[Boost Steam Account] - Cookies set successfully");
					   client.chatMessage(SENDER, "[Boost Steam Account] - Cookies set successfully");
					});
					sleep(7000);
					console.log("[Boost Steam Account] - Boosting Games Active");
					client.chatMessage(SENDER, "[Boost Steam Account] - Start Boosting Games");
		}
		else if (MSG.toUpperCase().indexOf("!STOPBOOST") >= 0) {
			
		    let BoostClient = new SteamUser();

			BoostClient.logOff();
			sleep(1000);
			console.log("[Boost Steam Account] - Stop Boosting Games");
			client.chatMessage(SENDER, "[Boost Steam Account] - Stop Boosting Games");
			
			
		}
		// Boost Owners Account END

It runs not in an error, but i dont log off :-(((

 

I hope someone can help me out... THX


Edited by CellSplitter, 03 April 2019 - 12:33 PM.


#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,162 posts

Posted 03 April 2019 - 07:36 PM

You're calling logOff on a new SteamUser instance. You have to call it on the same instance that's already logged on.



#3 CellSplitter

CellSplitter

    Member

  • Member
  • PipPip
  • 20 posts

Posted 03 April 2019 - 11:48 PM   Best Answer

Sometimes you do not see the forest for the trees.🙄

Thx, now it works fine 🤙
  • Dr. McKay likes this





Also tagged with one or more of these keywords: Question, node.js, node-steam-user

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users