Jump to content
McKay Development

mar71n

Member
  • Posts

    20
  • Joined

  • Last visited

Everything posted by mar71n

  1. To describe my problem: Everything runs smoothly until a few days went by. Then I'm apparently not logged in anymore (I get 'Error: Not Logged In' when trying to send a tradeoffer). I would prefer to deal with beeing logged of instead of relogging based on the errorcallback when sending the trade. First: autoRelogin doesn't seem to handle that issue, is autoRelogin ONLY for the weekly downtime that happens on tuesday? Second: Since this is quite hard to test (I don't know how to force it, maybe by logging into the client manually while the bot is logged in?), I hope to find the answer here: Will the error / disconnect fire when I get logged out / the session expires, and is it enough to just do a new logOn() then? Thanks in advance! ** ** Edit: What I was able to test so far: Logging in manually into the client kills the session. If that happens, the error and the disconnect-event don't fire. If I try to just do client.logOn again, I get the error "already logged on". Edit2: Looks like I found a fix, client.webLogOn(); does the trick. Is there a more elegant way of dealing with this issue other than just relogging when the error happens? I would prefer to relog after getting logged out / The session expiring.client.webLogOn(); Edit3: People told me to listen for the sessionExpired event and to renew the session if it fires. However this event doesn't fire when I manually destroy the cookies, and it doesn't fire when I make the cookies invalid by logging into the client manually. When does it fire? My solution for now: I have a cronschedule that does webLogOn() every 45 min (does that time make sense?), and whenever that error fires I also do a webLogOn(). Still not satisfied by that solution tbh tho.
  2. Whenever I use this function, I do lose my profiles background and also a custom textbox that i have setup manually. Do i need to hardcode those or is there a way of ignoring them?
  3. I am trying to get the users name, and not just any recent name, but the actual current name. These methods deliver outdated names, and I wonder why that is. Is there some caching going on or what am I doing wrong? Edit: I ended up using the webapi
  4. My logic is: if the offer, sent by me, is changed, I decline it. I listen for 'sentOfferChanged', and if the offer.state == 4, I want to do offer.decline(). However if I do that, I am getting the errormessage Offer #3065190468 is not active, so it may not be cancelled or declined. Where is my error? Thank you
  5. do you have any experience with that? I bet that steam doesn't like if the interval is too low
  6. I'm currently having competition in a little niche, and its all about beeing faster. For that reason I want to accept a tradeoffer asap after getting it. Here is my question: Is there anything that I can do to make manager.on('newOffer', function (offer) { //Just a function that has some logic, does pretty much just accept the offer as long as itemstogive.length ==0 accept(offer); }); faster? Or is this the fastest already. And how much delay is there between getting the offer, and this block of code realizing that a new offer came in? I can also post my full code if needed.
  7. Exactly. Can it have any effect that I log onto this account with my phone sometimes, and manually accept trades there?
  8. What can be the reason that the offer.accept(function... doesn't work at all anymore after some time? I know that I get until there, because of console logs that I've put before that. The first thing that happens inside is also another console.log, but this one doesn't fire at all anymore. Since I really don't see whats wrong in my code, I hope that I can get some ideas from here. Keep up the great work! <3 mar71n
  9. would be really nice if someone could reply to this one, because I'm completely lost :[
  10. After some testing, I figured out the following behavior today: My assumption is not the reason. When this problem happens, the callback of offer.accept never gets executed. And when it happens, all the upcoming offers don't get accepted aswell. I changed the code a bit, here it is: //new tradeoffermanager.on('newOffer', function (offer) { accept(offer); }); function accept(offer) { console.log("Attempting to accept offer..."); console.log("Items to give Length: " + offer.itemsToGive.length); console.log("offer.state: " + offer.state); if (offer.itemsToGive.length == 0) { offer.accept(false, function (err) { console.log("offer.State: " + offer.state); if (err) { console.log("error: " + err); console.log("offer.State: " + offer.state); } if (!(offer.state == 3 || offer.state == 6 || offer.state == 8)) { console.log("recursive attempt..."); setTimeout(accept(offer), 3000); return; } console.log("\n"); }); } } everything gets printed all the time except the stuff that is contained inside the callback of offer.accept(...)(Not even the first line). My Question here is: Is my code just stupid / did I do a thinking error, or is it problematic when I am logged into that account from browser and phone at the same time and do things there aswell? Also, one thing that I forgot: When I restart that code in the console, It works fine again.
  11. To make interactions with bots and alts easier, I wanted to get an autoaccept-script going, that simply accepts everything where the itemstogive.length ==0. This is my code: manager.on('newOffer', function (offer) { accept(offer); }); function accept(offer) { if (offer.itemsToGive.length == 0) { offer.accept(true, function (err) { console.log("offer.State: " + offer.state); if (err) { console.log("error: " + err); console.log("offer.State: " + offer.state); if (!(offer.state == 3 || offer.state == 6 || offer.state == 8)) { setTimeout(accept(offer), 3000); return; } } }); Sometimes just nothing happens, and the offer gets ignored completely. My guess is, that the trade-offer is buggy at the beginning (no items show on both sides), and that offer.itemstogive.length is undefined then, and my if is never true? Its quite hard to debug it for me, since this "error-case" isn't really reproduceable since it happens just very rarely.
  12. I know one endpoint for getting additional infos on items (http://api.steampowered.com/IEconItems_730/GetPlayerItems/v0001/?key=KEYHERE&SteamID=IDHERE). But this only works if the item is still in that inventory. What if the inspect-link is from the past? Is there any endpoint that I am missing?
  13. At this point in my code, I just want to accept the offer, until its accepted for real. I'm aware that errors can happen, for example when steam is beeing slow or laggy. In this case I just wanna keep trying until the offer is either accepted or expired. offer.accept(true, function (err){ if(err){ while(offer.state!=3 || offer.state!=8){ offer.accept(); } } }); Could this work, how would it be done better?
  14. In case anyone cares: My problem came from node.js. Updating and updating all dependencies fixed it.
  15. it doesn't change the behavior at all. for some reason something blocks the program completely. only control + c changes that. and then the program works as expected again until the next block occurs. Also: it doesn'T matter if I get tradeoffers or not, just after a certain time this happens. (not even too much time, like a few minutes)
  16. I guess you mean something like this? var task = cron.schedule('0 * * * *', function() { client.webLogOn(); }
  17. you are right, I probably fucked up copying it somehow. Here is the entire code again, still with the same issues: var Steam = require('steam'); var request = require('request'); var SteamUser = require("steam-user"); var SteamCommunity = require("steamcommunity"); var SteamTotp = require("steam-totp"); var TradeOfferManager = require("steam-tradeoffer-manager"); var fs = require("fs"); var client = new SteamUser(); var friends = new Steam.SteamFriends(client.client); var manager = new TradeOfferManager({ "steam": client, "domain": "example.com", "language": "en" }); var net = require('net'); var community = new SteamCommunity(); var logOnOptions = { "accountName": "*********", "password": "*********", "twoFactorCode": SteamTotp.getAuthCode("*********") }; client.logOn(logOnOptions); client.on("loggedOn", function (details) { console.log("Logged on to Steam! With the SteamID of " + client.steamID.getSteam3RenderedID()); client.setPersona(SteamUser.Steam.EPersonaState.Online); }); client.on('webSession', function (sessionID, cookies) { manager.setCookies(cookies, function (err) { if (err) { process.exit(1); } console.log("Got API key: " + manager.apiKey); }); community.setCookies(cookies); }); //new tradeoffer manager.on('newOffer', function (offer) { if(offer.itemsToGive.length == 0 && offer.itemsToReceive.length > 0) { offer.accept(); console.log("offer accepted, "+offer.itemsToReceive.length+" new Items obtained!"); } });
  18. I know this endpoint with the format http://steamcommunity.com/profiles/<PROFILEID>/inventory/json/753/1 However this endpoint, as many of you know, has very strict limits (3 / min without login, 15/min with login, these values vary a little I think). I also found this endpoint: http://steamcommunity.com/inventory/<PROFILEID>/440/2?l=english&count=5000 It replies with a much smaller json, and was hoping that it has less strict restrictions. Does anyone have experiences with it, and does anyone know how to modify the link to make it access the csgo-inventory? cheers :> Edit: It looks like that the 440 must be replaced with 730, then it works. As for the actual limits, I didn't try it yet. Will update this again as soon as I know it. It seems that it works much better tho!
  19. Hey, I've played around a little with the library you're offering us. However, my little application just gets stuck at some point, and I don't really get why. Code: manager.on('newOffer', function (offer) { var itemsToReceive = offer.itemsToReceive; var itemsToGive = offer.itemsToGive; if (itemsToGive.length >0) {} }else{ offer.accept(function (err) { if(err){ console.log("Unable to accept offer: "); } console.log("offer accepted "+itemsToReceive.length+" Keys received"); }); } } ); I'm loging in, setting cookie etc. following your examples. However this should accept any offer that it gets as long as its empty on my bots side. But after some time it just gets stuck and doesn't accept anymore. I can also press control + c in my terminal then, to exit the code where it got stuck at. And another question: How can I make a callback to do the offer.accept over and over again, until its done / gone? (steam has issues too often). Thank you for reading & thanks for your great work
  20. I've created lots of accounts with the bluestacks-android emulator, because I thought that I could just access my files there easily, but it doesn't seem like it. Does anyone know how I can root this emulator, or do it without rooting it? Thanks!
×
×
  • Create New...