Jump to content
McKay Development

roughnecks

Member
  • Posts

    70
  • Joined

  • Last visited

Everything posted by roughnecks

  1. manager.on('newOffer', offer => { if (offer.partner.getSteamID64() === '76561198061492959') { offer.accept((err, status) => { if (err) { console.log(err); } else { console.log(`Accepted offer from owner. Status: ${status}.`); } }); } else { if (offer.itemsToGive.length === 0) { offer.getUserDetails((err, me, them) => { if (typeof (them) !== 'undefined') { donator = them.personaName; //console.log(`donator is: ${donator}`); } else { console.log('getuserdetails' + err); } }); offer.accept((err, status) => { offer.getReceivedItems((err, items) => { if (typeof (items) !== 'undefined') { donationnum = items.length; //console.log(`donationnum is: ${donationnum}`); } else { console.log('getreceiveditems' + err); } }); if (err) { console.log(err); } else { console.log(`Donation accepted. Status: ${status}.`); success = 1; } }); setTimeout(postComment, 3000); } else { offer.decline(err => { if (err) { console.log(err); } else { console.log('Offer declined (wanted our items).'); } }); } } });
  2. Hello With new steam chat we get a trade notification chat message together with any incoming offer from a friend: https://i.imgur.com/PV4TgEu.jpg My problem is that when I'm using this code: //Chat Messages Check //This will fire when we receive a chat message from ANY friend client.on('friendMessage', function(steamID, message) { client.getPersonas([steamID], function (personas) { console.log('Friend message from ' + personas[steamID]["player_name"] + ': ' + message); }); }); Bot's notifications aren't cleared (there is one for every trade offer); so my question is, there's a way to keep that code and clear trade notifications altogether (maybe something which fires after a trade is received)? Thanks
  3. Still I don't understand why it's happening only for the first incoming offer, while all the following ones are working fine.
  4. I can't check it right now but thanks, @PonyExpress. EDIT: Looks like it's working
  5. I got the same issue, anyone who can help?
  6. Answer is "no". https://support.steampowered.com/kb_article.php?ref=4044-qdhj-5691#phone
  7. I read that in the doc but what's your definition of active? Maybe you mean that it's not a "new" trade offer but when a trade is pending to me is still "active" because I can accept it until it's canceled. So there's no other way to get sender's name for all the trades if I can't keep my bot always running?
  8. Tried once more after adding a new piece of code: community.on('sessionExpired', function(err) { if (err) { console.log('Session Expired: ' + err); } if (client.steamID) { client.webLogOn(); console.log('called weblogon: ' + client.steamID); } else { client.logOn(logOnOptions); console.log('called logon'); } }); and I got this error: [[01:46:43]] [LOG] Session Expired: Error: HTTP error 403[[01:46:43]] [LOG] called weblogon: 76........[[01:46:43]] [LOG] Error: Not Logged In at SteamCommunity.manager._community.httpRequestPost (D:\Portable\Birba\node_modules\steam-tradeoffer-manager\lib\classes\TradeOffer.js:483:25) It repeats every time I send a new offer.
  9. Also found this: https://dev.doctormckay.com/topic/1900-has-cookies-changed/?do=findComment&comment=6149 Looks like same (not resolved) issue.
  10. This is an example log between different attempts with almost the same code as above: [[20:48:09]] [LOG] == Logged in ============= [[20:48:10]] [LOG] == Name: BOT [[20:48:10]] [LOG] == ID64: 765611................. [[20:48:10]] [LOG] ========================== [[20:48:10]] [LOG] [[21:00:00]] [LOG] Already logged in [[21:06:05]] [LOG] Error: Not Logged In at SteamCommunity.manager._community.httpRequestPost (D:\Portable\Birba\node_modules\steam-tradeoffer-manager\lib\classes\TradeOffer.js:483:25)
  11. //Logging ON client.logOn(logOnOptions); client.on('loggedOn', function (details) { if (details.eresult == SteamUser.EResult.OK) { 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(""); }); client.setPersona(5); //"5": "LookingToTrade" -- https://github.com/DoctorMcKay/node-steam-user/blob/master/enums/EPersonaState.js client.gamesPlayed('Accepting Junk and Making Friends'); } else { console.log(details); //Do whatever u want to handle the error... } }); client.on('webSession', (sessionid, cookies) => { manager.setCookies(cookies); community.setCookies(cookies); }); As soon as the bot starts everythings works fine. After some minutes, every time an offer is received by the bot, I get the "Not Logged In" error. I set up a cron (after reading a similar thread on this forum), like this: //Session refresh every 15 minutes cron.schedule('*/15 * * * *', () => { if (client.steamID) { client.webLogOn(); } else { client.logOn(logOnOptions); console.log('Logged in again using cron'); } }); but the "not logged in" error still remains. I also read this topic where Admin says this but at this point I don't understand which session needs to be refreshed and how. Also calling "sessionExpired" isn't helping because whenever an incoming trade offer gives me the error, bot doesn't try anymore to accept it, even after session is refreshed, so I have to restart it. manager.on('newOffer', offer => { if (offer.partner.getSteamID64() === 'my_stemid_64') { offer.accept((err, status) => { if (err) { console.log(err); } else { console.log(`Accepted offer from owner. Status: ${status}.`); } }); } else { if (offer.itemsToGive.length === 0) { offer.accept((err, status) => { if (err) { console.log(err); } else { console.log(`Donation accepted. Status: ${status}.`); } }); } else { offer.decline(err => { if (err) { console.log(err); } else { console.log('Donation declined (wanted our items).'); } }); } } }); Any help would be appreciated.
  12. Hello My bot is not running. I send an offer to it and then start it. Trade offer gets accepted but I get the error message "This trade offer is no longer valid." It's happening when retrieving UserDetails: if (offer.itemsToGive.length === 0) { offer.getUserDetails((err, me, them) => { if (typeof (them) !== 'undefined') { donator = them.personaName; console.log(`donator is: ${donator}`); } else { console.log(err); } }); because I'm not getting donator's name. This is my console.log: Error: This trade offer is no longer valid. at SteamCommunity._checkTradeError (D:\Portable\Birba\node_modules\steamcommunity\components\http.js:144:13) at Request._callback (D:\Portable\Birba\node_modules\steamcommunity\components\http.js:52:80) at Request.self.callback (D:\Portable\Birba\node_modules\request\request.js:185:22) at Request.emit (events.js:182:13) at Request.<anonymous> (D:\Portable\Birba\node_modules\request\request.js:1161:10) at Request.emit (events.js:182:13) at Gunzip.<anonymous> (D:\Portable\Birba\node_modules\request\request.js:1083:12) at Object.onceWrapper (events.js:273:13) at Gunzip.emit (events.js:187:15) at endReadableNT (_stream_readable.js:1094:12)Donation accepted. Status: accepted. Problem is, I'm posting a comment on bot's profile upon successful incoming donation and if there are offers BEFORE I run the bot, comments are not posted, since there's a check on "donator" and it doesn't return. BUT: If I keep the bot running and then send one more offer, it gets accepted and all is working fine without errors. donator is: roughnecks Donation accepted. Status: accepted. Comment Posted
  13. Hi. I was thinking about creating a random, 1:1 trade bot; meaning that anyone can send an item to the bot and then the bot sends back another item of the same inventory type (e.g. a TF2 weapon for another TF2 weapon). First problem I see is that I should somehow differentiate between donations (my bot is currently set up to accept donations only) and a "lottery" type of trade (people sending an item but expecting something back). I thought maybe they could attach a message like "lottery" to their trade offer and the bot would know it's not a donation, so initiating an outgoing offer soon after, but I only found a "setMessage(message)" method, can't see any "getMessage". Is this achievable somehow? Anyone (with experience) can shed some light about the best course of actions? Thanks
  14. Thanks, I searched but didn't find it by myself.
  15. What if I have same number on 2 account, then remove number from account #2 and then get a ban in account #1? Will #2 also get banned because it was linked to the same number earlier?
  16. Hello Sorry if this is a dumb question, but here I go: after I entered my "email guard code" bot logged in and for any subsequent login it just worked without asking for a new code, but... ...Inside bot's directory I cannot find any other file, so where are cookies or session/other info stored? Thanks
  17. Yeah, thanks. I believe that "Error 24" I'm getting is because of Steam Guard which has locked this new "device" from trading for 7 days... Am I right?
  18. Hello. I'm new to all this stuff, so just a generic question before I dig further in. Can I create a bot which only accepts donations (i.e. no item loss from bot side) if the associated steam account doesn't use Mobile 2FA but is not a limited account (using email auth)? I'm asking because trying this code... client.on('webSession', (sessionid, cookies) => { manager.setCookies(cookies); community.setCookies(cookies); community.startConfirmationChecker(10000, 'my_identity_secret'); }); ...I'm not sure how to avoid that "identity_secret" argument. Thanks
×
×
  • Create New...