You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Full disclaimer; I'm not very good at Javascript. I did a bit with jQuery/Javascript for web, but I'm just starting out with NodeJS.
I'm trying to build a forever looping service that just polls my Ark servers for the chat log, and posts it to my Discord server via webhooks. Unfortunately, I'm having issues using the response back from RCON outside of the .on() functions.
I used both examples to create something like this, and it fails because 'response' is not specified.
varRcon=require('../node-rcon');varconn=newRcon('localhost',1234,'password');conn.on('auth',function(){console.log("Authenticated");console.log("Sending command: help")conn.send("help");}).on('response',function(str){varresponse=str;console.log("Response: "+str);}).on('error',function(err){console.log("Error: "+err);}).on('end',function(){console.log("Connection closed");process.exit();});conn.connect();if(response=="some response"){console.log("Do something with "+response);}
It would be nice to have an example that shows how to use the data outside of the .on() function. It may be seen as baby sitting but server admins aren't always the most saavy nodejs devs, and it's rather inhibiting getting stuck on things like this.
Googling didn't provide extraordinarily great assistance because I could use promises, but I don't know how that applies in context to this module.
The text was updated successfully, but these errors were encountered:
Hi!
Full disclaimer; I'm not very good at Javascript. I did a bit with jQuery/Javascript for web, but I'm just starting out with NodeJS.
I'm trying to build a forever looping service that just polls my Ark servers for the chat log, and posts it to my Discord server via webhooks. Unfortunately, I'm having issues using the response back from RCON outside of the
.on()
functions.I used both examples to create something like this, and it fails because 'response' is not specified.
It would be nice to have an example that shows how to use the data outside of the
.on()
function. It may be seen as baby sitting but server admins aren't always the most saavy nodejs devs, and it's rather inhibiting getting stuck on things like this.Googling didn't provide extraordinarily great assistance because I could use promises, but I don't know how that applies in context to this module.
The text was updated successfully, but these errors were encountered: