Jump to content
McKay Development

MrInka

Member
  • Posts

    11
  • Joined

  • Last visited

Recent Profile Visitors

467 profile views

MrInka's Achievements

  1. Yup and thanks for the reply, I read about that by now. Sadly, I tested and this also happens when running the bot on my Windows PC, where the system time is 100% right. What else could cause this error?
  2. Hey, I know this is an old topic, so I did quite a bit of research. - I am not using a confirmation key twice (I guess?), since I am only calling direct confirmations for offers that just got accepted - also not accepting multiple offers at once in one bot. - I am not being rate-limited (Yes, I have two bots running parallel in separated scripts, but both start up delayed and both confirmationcheckers are disabled (just like polling for offers)). - I am defenitly logged in. - I have seen "The tag for accepting needs to be allow, not accept." on another post, same error. This doesn't apply to me right? Here is how I am handling offers: manager.on('newOffer', function(offer) { if(acceptArray.indexOf(offer.id) >= 0){ //Check if the offer ID is listed in an array console.log("Offer ID is listed! Accepting!") offer.accept(function(err) { if (err) { console.log("Accepting failed:" + err); } else { console.log("Accepted! (" + offer.id + ")") setTimeout(function(){ // Small delay between accepting and confirming. Does this make sense? community.acceptConfirmationForObject(config.identitysecret, offer.id, function(err){ if(err){ console.log("Confirming failed: " + err); } else { console.log("Confirmed! (" + offer.id + ")"); } }); }, 250); } }); } else { console.log("Offer ID unknown. Ignoring this trade!") } });It doesn't fail for every offer, but sometimes! Is there anything else I could do to fix this? - Thanks! Edit: Just came to my mind. My bot is running on a RaspberryPi: Raspberries dont have a battery, so they can't keep up with the system time when they are fully turned off. Sometimes after starting it, it has problems to update the system time automatically. Sadly I dont know if this problem occured together with the problem I described above. Just generally: Could a wrong system time cause a "could not act on confirmation" error in some way? Edit2: Okay, also happens on my windows PC where the system time is 100% right. Any more ideas?
  3. Hey, I see that there are already topics discussing this particular error, but most of them aren't including code examples. Tried to fix it myself, but it doesn't seem to work. So when accepting an offer, I sometimes get this error: Error: Not Logged In at SteamCommunity._checkCommunityError (/home/pi/Desktop/bot_final/node_modules/steamcommunity/components/http.js:128:9) at Request._callback (/home/pi/Desktop/bot_final/node_modules/steamcommunity/components/http.js:51:88) at Request.self.callback (/home/pi/Desktop/bot_final/node_modules/steamcommunity/node_modules/request/request.js:186:22) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7) at Request.<anonymous> (/home/pi/Desktop/bot_final/node_modules/steamcommunity/node_modules/request/request.js:1081:10) at emitOne (events.js:96:13) at Request.emit (events.js:188:7) at Gunzip.<anonymous> (/home/pi/Desktop/bot_final/node_modules/steamcommunity/node_modules/request/request.js:1001:12) at Gunzip.g (events.js:291:16)So to log in, I am using this: var config = require('./config.js'); var SteamCommunity = require('steamcommunity'); var SteamTotp = require('steam-totp'); var SteamUser = require('steam-user'); var TradeOfferManager = require('steam-tradeoffer-manager'); var community = new SteamCommunity(); var client = new SteamUser(); var manager = new TradeOfferManager({ steam: client, domain: 'example.com', language: 'en' }); client.logOn({ accountName: config.username, password: config.password, twoFactorCode: SteamTotp.generateAuthCode(config.sharedsecret) }); client.on('loggedOn', function(details) { console.log("Bot logged in"); client.setPersona(SteamUser.Steam.EPersonaState.Online,config.botname); }); client.on('webSession', function(sessionID, cookies) { manager.setCookies(cookies, function(err) { if (err) return console.log(err); console.log(" > Got API key!"); }); community.setCookies(cookies); community.startConfirmationChecker(10000, config.identitysecret); })And to keep the bot from coming up with the "Not logged in error", I added this (which obviously doesnt work). var lastLoginAttempt = Date.now(); client.on("sessionExpired", function(err) { if(Date.now() - lastLoginAttempt > 30000) { lastLoginAttempt = Date.now(); console.log(" > Session Expired, relogging."); client.webLogOn(); } else { console.log(" Session Expired, waiting a while before attempting to relogin."); } });I was told to add a "timer" so it doesn't spam the login when the websession expires. Any idea why it doesn't work? Is client.webLogOn() the right way to log in again? Any help is appreciated!
  4. Sorry, I didn't fully understand what you meant with I used Van Kappas suggestion to check if it worked with if(details.eresult == SteamUser.EResult.OK) and added a setTimeout(function() { client.logOn(login); }, 30000);to the ELSE to handle any upcoming errors. Would this be the right way? And yes, Playing works fine and reconnecting to the steam chat doesn't seem to affect the bot, I would just like to keep it from setting my steamchat to offline everytime it logs in. Any chance here? Thanks for the replies!
  5. I made the suggested changes. My dev is still wondering why these things are happening, but said that those changes could help. Thanks a lot for the effort, my friend! Really hoping that it fixes my problems! Another, probably really short thing: The bot sets my steam client (on my pc) to offline everytime it logs in. Is there any way to prevent this or shouldnt I be playing on the same account while the bot is running in general?
  6. It finally happened (this time while running on my raspberryPI. ## Session Expired, relogging. ==> Couldn't get userInfo! Error: Error: Not Logged In ============ New Offer =============================== /home/pi/Desktop/moneyBot/index.js:71 console.log("== Partner: " + them.personaName); TypeError: Cannot read property 'personaName' of undefined at /home/pi/Desktop/moneyBot/index.js:71:43 at Object.exports.makeAnError (/home/pi/Desktop/moneyBot/node_modules/steam-tradeoffer-manager/lib/helpers.js:33:4) at manager._community.httpRequestGet (/home/pi/Desktop/moneyBot/node_modules/steam-tradeoffer-manager/lib/classes/TradeOffer.js:818:12) at SteamCommunity._checkCommunityError (/home/pi/Desktop/moneyBot/node_modules/steamcommunity/components/http.js:129:3) at Request._callback (/home/pi/Desktop/moneyBot/node_modules/steamcommunity/components/http.js:51:88) at Request.self.callback (/home/pi/Desktop/moneyBot/node_modules/steamcommunity/node_modules/request/request.js:186:22) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7) at Request.<anonymous> (/home/pi/Desktop/moneyBot/node_modules/steamcommunity/node_modules/request/request.js:1081:10) at emitOne (events.js:96:13)So ... "err" contains "Error: Not Logged In" - not quite sure what to do with that. I am also getting these errors every now and then: #1 ============ Logged in =============================== == Name: ✘ Mr. Inka ✘ CS.MONEY == ID64: 76561198046273125 ====================================================== /home/pi/Desktop/moneyBot/node_modules/steam-user/components/web.js:9 throw new Error("Cannot log onto steamcommunity.com without first being connected to Steam network"); ^ Error: Cannot log onto steamcommunity.com without first being connected to Steam network at SteamUser.webLogOn (/home/pi/Desktop/moneyBot/node_modules/steam-user/components/web.js:9:9) at Timeout._onTimeout (/home/pi/Desktop/moneyBot/index.js:47:37) at ontimeout (timers.js:365:14) at tryOnTimeout (timers.js:237:5) at Timer.listOnTimeout (timers.js:207:5) #2 ## Session Expired, relogging. /home/pi/Desktop/moneyBot/node_modules/steam-user/components/web.js:9 throw new Error("Cannot log onto steamcommunity.com without first being connected to Steam network"); ^ Error: Cannot log onto steamcommunity.com without first being connected to Steam network at SteamUser.webLogOn (/home/pi/Desktop/moneyBot/node_modules/steam-user/components/web.js:9:9) at SteamCommunity.<anonymous> (/home/pi/Desktop/moneyBot/index.js:60:12) at emitOne (events.js:96:13) at SteamCommunity.emit (events.js:188:7) at SteamCommunity._notifySessionExpired (/home/pi/Desktop/moneyBot/node_modules/steamcommunity/components/http.js:85:7) at /home/pi/Desktop/moneyBot/node_modules/steamcommunity/components/confirmations.js:21:10 at /home/pi/Desktop/moneyBot/node_modules/steamcommunity/components/confirmations.js:268:4 at SteamCommunity._checkHttpError (/home/pi/Desktop/moneyBot/node_modules/steamcommunity/components/http.js:90:3) at Request._callback (/home/pi/Desktop/moneyBot/node_modules/steamcommunity/components/http.js:50:61) at self.callback (/home/pi/Desktop/moneyBot/node_modules/steamcommunity/node_modules/request/request.js:186:22) Those two seem to pop up sometime after logging in or relogging when the session expired. It seems like those 3 errors have a connection. I find it a bit weird that it seems to happen "sometimes". Usually... community.on("sessionExpired", function(err) { console.log("## Session Expired, relogging."); client.webLogOn(); });...fires a new client.webLogOn(); and the bot keeps working. Why would this fail sometimes? Any idea would help!
  7. Added a line to log "err" if something comes up. Sadly I can't reproduce the problem. Right now, it's running fine, no errors, handling trades how it should! Thanks already!
  8. Hey, my tradeBot (only sometimes) crashes right after receiving an offer. I tried to fix it with a friend who is more into coding SteamBots than me, but we weren't able to figure out what is going wrong here. I want to keep the script more or less private since someone made it for me and he doesn't want me to share the full code for it, but this should be enough. Will provide more if needed! var config = require('./config.js'); var SteamUser = require('steam-user'); var client = new SteamUser(); var SteamCommunity = require("steamcommunity"); var community = new SteamCommunity(); var SteamTotp = require('steam-totp'); var mobilecode = SteamTotp.getAuthCode(config.sharedsecret); var TradeOfferManager = require('steam-tradeoffer-manager'); var manager = new TradeOfferManager({ "steam": client, "domain": "http://localhost", "language": "en", "cancelTime": "600000", // 10 minutes "pollInterval": "5000" }); var login = { accountName: config.username, password: config.password, twoFactorCode: mobilecode }; client.logOn(login); client.on('loggedOn', function(details) { client.getPersonas([client.steamID], function(personas) { console.log("============ Logged in ===============================") console.log('== Name: ' + personas[client.steamID]["player_name"]); console.log('== ID64: ' + client.steamID); console.log("======================================================"); console.log(""); }); console.log(); client.setPersona(1); // Shows the status as online. 0 = offline (It will still work though!) 1 = online setInterval(function() { client.webLogOn(); }, 1000 * 60); // Refreshes session every 10 minutes }); client.on('webSession', function(sessionID, cookies) { manager.setCookies(cookies, function(err) { if (err) { console.log("Couldn\'t set cookies! Error: " + err); } }); community.setCookies(cookies); community.startConfirmationChecker(10000, config.identitysecret); }); client.on('error', function(e) { console.log(e); process.exit(1); }); community.on("sessionExpired", function(err) { console.log("## Session Expired, relogging."); client.webLogOn(); }); manager.on('newOffer', function(offer) { // When a new offer is received do the stuff below offer.getUserDetails(function(err, me, them) { // Get errors, an object containing the escrow days left and the inventory of the bot and the partner console.log("============ New Offer ==============================="); console.log("== Partner: " + them.personaName); //This is where the error happened! console.log("============ My items ================================")The error is happening in line 78. (The second-last starting with console.log("== Partner: ...)) TypeError: Cannot read property 'personaName' of undefined at C:\Users\Thomas\Desktop\Coding\Steam Trading\moneyBot\index.js:78:43 at Object.exports.makeAnError (C:\Users\Thomas\Desktop\Coding\Steam Trading\moneyBot\node_modules\steam-tradeoffer-manager\lib\helpers.js:33:4) at C:\Users\Thomas\Desktop\Coding\Steam Trading\moneyBot\node_modules\steam-tradeoffer-manager\lib\classes\TradeOffer.js:818:12 at SteamCommunity._checkTradeError (C:\Users\Thomas\Desktop\Coding\Steam Trading\moneyBot\node_modules\steamcommunity\components\http.js:145:3) at Request._callback (C:\Users\Thomas\Desktop\Coding\Steam Trading\moneyBot\node_modules\steamcommunity\components\http.js:52:80) at Request.self.callback (C:\Users\Thomas\Desktop\Coding\Steam Trading\moneyBot\node_modules\steamcommunity\node_modules\request\request.js:186:22) at emitTwo (events.js:87:13) at Request.emit (events.js:172:7) at Request.<anonymous> (C:\Users\Thomas\Desktop\Coding\Steam Trading\moneyBot\node_modules\steamcommunity\node_modules\request\request.js:1081:10) at emitOne (events.js:77:13) I feel like this error is really weird. Why would personaName be undefined right after receiving the trade? It also handles a lot of trades without any problems, but then suddenly crashes. steam-tradeoffer-manager is running on 2.5.0 and I also reinstalled all modules. Any help is appreciated!
  9. Hey and thank you, I found an answer made by you on here. offer.update(function(err) { if (err) { console.log(err); } else { // now the offer is fresh from the WebAPI } });I was just wondering, If my bot finds a new offer, sees that it's glitched and runs the code above instead of accepting / checking trade conditions, will the same offer just pop up again? Will he then find it automatically Or will I need to tell my bot to "forget" the offer he just found after / before I updated?
  10. Hey, I am still not too good with Node or JS, but working on it! I have a working NodeJS bot to accept item donations. Sometimes, offers are glitched. The bots console log tell me, that it accepted them, which of course doesn't work. If I restart the bot, it finds the offer and accepts it (if it's not glitched anymore). I managed to let the bot find out if an offer is glitched. if(offer.isGlitched() == true) { console.log("Offer is glitched!"); } else { console.log("Offer is not glitched!"); }Now ... since I don't fully understand how the bot gets the new offers, I don't know how to manually refresh them. Lets say, I would use the code above right after a new offers is received and "isGlitched()" equals "true", what would I need to have a few seconds delay and then just refresh all offers until the offer is not glitched anymore? if(offer.isGlitched() == true) { console.log("Offer is glitched!"); setTimeout(function(){ //Reload offers! }, 15000); } else { console.log("Offer is not glitched!"); //Some conditions offer.accept();" } What would I need as "Reload offers!"? This might be some easy-to-solve question, but I tried and didn't succeed. Any help is greatly appreciated!
×
×
  • Create New...