Frohser
Member-
Posts
9 -
Joined
-
Last visited
Everything posted by Frohser
-
I want have in my bot command for show trade url and for change trade url, trying to do that like that but... after this not working, I was thinking how to do that. Any help? if (command == '!tradelink') { community.on('getTradeURL', function(err, url) { if (err) { console.log("(" + dateTime() + " |" + dateTime(true) + ")" + " Trade link err: " + err); } else { console.log("(" + dateTime() + " |" + dateTime(true) + ")" + " Trade link: " + url); client.chatMessage(config.adminID, "Trade link: " + url); } }); } To be sure: [email protected]
-
What version node.js do you have?
-
Update your node.js using this tip.
-
Question Already logged on, cannot log on again
Frohser replied to Frohser's topic in node-steam-user
I'm not sure what to do that... I'm trying with many ways and all failed. This should work? You wrote about this? manager.on('pollFailure', function (err) { if (err) { console.log("(" + dateTime() + " |" + dateTime(true) + ")" + ` Error polling information: ${err.message}`); console.log("(" + dateTime() + " |" + dateTime(true) + ")" + ' Login off...'); client.logOff(); } }); client.on('disconnected', function () { console.log("(" + dateTime() + " |" + dateTime(true) + ")" + " Disconnected... Login in again!"); if (client.steamID == null) { setTimeout(function () { client.logOn(logOptions); }, 10000); // 10 seconds } else { client.webLogOn((err) => { if (err) { console.log("(" + dateTime() + " |" + dateTime(true) + ")" + err.message) } }) } }); Edit 1: Script login correctly but... don't print "Logged in!". client.on('loggedOn', function() { client.setPersona(SteamUser.Steam.EPersonaState.Away); // Set status to Away console.log("(" + dateTime() + " |" + dateTime(true) + ")" + ` Logged in!\n`); // Output: (26/09/2017 | 12:43:36) Logged in! }); PS. Sent 5 usd donate via PayPal -
Question Already logged on, cannot log on again
Frohser replied to Frohser's topic in node-steam-user
I don't know if I good understand you but imo yes. Changed little bit my code: manager.on('pollFailure', function (err) { if (err) { console.log("Error polling"); client.logOff(); } }); client.on('disconnected', function () { console.log("(" + dateTime() + " |" + dateTime(true) + ")" + " Disconnected... Login in again!"); setTimeout(function () { client.logOn(logOptions); }, 10000); // 10 seconds }); Anyway I'm getting pollFailure - socket hang up always after 2 hours. I check my connection in VPS and also at my home connection and its not a caused by my connection. Why when I send a request to a remote server, and receive no timely response always after two hours? Edit: nope... not working.. he didn't logOn (26/09/2017 | 14:59:45) Logged in! (26/09/2017 | 17:00:01) Disconnected... Login in again! Also I changed code to client.relog, but after getting new offer I got error from accepting trade: "Can't accept offer: Not logged in" Fuck off with this logOn or Relog or whatever... I just put new crontab for restart bot.js every hour and I don't give a shit about this.. I can feel pain -.- -
Question Already logged on, cannot log on again
Frohser replied to Frohser's topic in node-steam-user
Using this: const sleep = require('sleep'); // https://www.npmjs.com/package/sleepSet to 30 and sleeping working. This code is pretty good? manager.on('pollFailure', function (err) { if (err) { console.log("(" + dateTime() + " |" + dateTime(true) + ")" + ` Error polling: ${err.message}`); //console.log("(" + dateTime() + " |" + dateTime(true) + ")" + ' Log off...'); client.logOff(); setTimeout(function () { client.logOn(logOnOptions); }, 10000); // 10 seconds } }); -
Check this.
-
bot.js: manager.on('pollFailure', function (err) { if (err) { console.log(`Error polling for trade offers ${err.message}`); console.log(formatted); // time_and_date client.logOff(); sleep.sleep(10); client.logOn(logOnOptions); } }); bot-out-0.log Logged: my_name 2017-09-23 16:42:57 Error polling for trade offers socket hang up 2017-09-23 18:42:57 Logged: my_name 2017-09-23 18:43:27 bot-error-0.log Error: Already logged on, cannot log on again at SteamUser.logOn (/home/steam/node_modules/steam-user/components/logon.js:11:9) at TradeOfferManager.<anonymous> (/home/steam/bot.js:267:10) at emitOne (events.js:96:13) at TradeOfferManager.emit (events.js:188:7) at getOffers (/home/steam/node_modules/steam-tradeoffer-manager/lib/polling.js:54:9) at _apiCall (/home/steam/node_modules/steam-tradeoffer-manager/lib/index.js:453:4) at _community.httpRequest (/home/steam/node_modules/steam-tradeoffer-manager/lib/webapi.js:32:4) at SteamCommunity._checkHttpError (/home/steam/node_modules/steamcommunity/components/http.js:90:3) at Request._callback (/home/steam/node_modules/steamcommunity/components/http.js:50:61) at self.callback (/home/steam/node_modules/request/request.js:186:22) What is wrong with this code?