Jump to content
McKay Development

Search the Community

Showing results for tags 'Node.js'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News & Announcements
    • Releases & Updates
  • Help & Support
    • General
    • Guides
    • node-steam-user
    • node-steamcommunity
    • node-steam-tradeoffer-manager
    • node-steam-session

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Skype


Location


Interests

  1. I'm not sure about steam-tradeoffer-manager, maybe my problem is related to steam-user.I always received the text of errors (ERR) in English. But after launching a third-party program, now i get them in another language. let client = new SteamUser(), manager = new TradeOfferManager({ "steam": client, "language": "en" }), community = new SteamCommunity(); //... let t = manager.createOffer(SID); t.getUserDetails((ERR, ME, THEM) => { if (ERR) { console.log("cant trade: " + ERR); // <<< not in English } else if (ME.escrowDays == 0 && THEM.escrowDays == 0) { console.log("all good"); } else { console.log("escrowDays"); } }); How can I return the language to English? (Global) And can I get errors in a specific language if need?
  2. Guest

    fix for handlers

    Hi, i fixed my issue https://dev.doctormckay.com/topic/1949-node-steam-user-v-4/page-2 The error was found in existing handlers checking. If you'll use a few accounts you can see that handlers length will be equal to accounts count. You will be able to add this code in your module for fix this https://github.com/DoctorMcKay/node-steam-user/blob/v4/components/classes/HandlerManager.js#L21 if( this._handlers.hasOwnProperty(msg) && this._handlers[msg].length >= 1 ) { return; }P.S. In the steam-user v 4.0. don't work method gamesPlayed() . How can i fix it ? UPDATE: login with steamguard don't work too. Always get error "Error: Already logged on, cannot log on again"
  3. leoptu

    HELP

    I do not know if this is the right area for this, I'm new here .. But someone has available, some kind of automatic Steam Account Creator?
  4. Hello, sorry for stupid post but I have question why after use this code second time console.log print the same information twice? 3 turns on 3 times when I use in other place 'loggedOn' I see again console.log(this.informations) in other function. Someone can tell me why and what I can to do with that? Sorry for my rip English and code. { let p = new Promise((resolve,reject)=>{ this.steam.logOn(this.account_details); this.steam.on('loggedOn', () => { this.steam.setPersona(SteamUser.Steam.EPersonaState.Online); this.informations.steamID=this.steam.client.steamID; this.informations.accountid=this.steam.steamID.accountid; console.log(this.informations); this.steam.logOff(); setTimeout(()=>{ resolve(true); },1000); }); }); return p.then((resolve)=>{ console.log(`...`); }); } Console:
  5. Hi, how can i create a new proto for my method ? For example i need to use method FriendsList.GetFriendsList#1 I use client._sendUnified("FriendsList.GetFriendsList#1", { bConstMethod: !0 }, body => { console.log(body) })But i get the error "Cannot read property 'encode' of undefined". What i need to do for using my methods through steam-user ?
  6. Hi, it is possible to set API? Trade-offers: this.apiKey = null; this._community.getWebApiKey(this._domain, (err, key) => { if (err) { callback(err); return; } this.apiKey = key; callback(); }); I can make a pull request to change this.apiKey = (options.apiKey || null); Or there is a reason for not giving option to pass api key?
  7. Error: Already logged on, cannot log on again Why crashing script? :// after hours
  8. //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.
  9. Any way add game like CS GO (ID 730) in my new account use node ? Now my HB works only if i run 1 time game. After this HB works perfect.
  10. 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
  11. my bot is getting web session expired and i use community.on('sessionExpired', function(err) { if (err) { console.log('sessionExpired: '+err); } if (client.steamID) { client.webLogOn(); } else { client.logOn(logon_details); } });this code is triggered when the user of bot tried to make the bot start a trade offer. what is a simple way for me to trigger session expired like every 15 mins if the session has expired? Ans- A simple http request every 15 mins using node-cron to trigger it. (i am not a coder so if u could show it to me thanks!) Right now the user of bot triggers it then has to wait 1-2 mins then the bot webLogon() and then sends trade offer Alternative 2 it was suggested in forum we can use direct cronschedule that does webLogOn() every 15 min , and whenever that error fires I also do a webLogOn(). but idk what will happen if i try to webLogON() if the session hasnt been expired yet thats y i wanted to set up Alternative 1
  12. 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
  13. I'm running a bot and the majority of trade offers are not going through. The bot logs in and handles expired sessions like this: let client = new SteamUser(); let community = new SteamCommunity(); let manager = new TradeOfferManager({ community: community, steam: client, domain: "example.com", language: "en", pollInterval: 2000 }); let logOnOptions = { "accountName": data.username, "password": data.password, "twoFactorCode": SteamTotp.getAuthCode(data.shared_secret) }; client.logOn(logOnOptions); client.on('loggedOn', function() { console.log("Logged into Steam"); client.setPersona(SteamUser.EPersonaState.Online); }); client.on('webSession', function(sessionID, cookies) { manager.setCookies(cookies); community.setCookies(cookies); console.log("weblogon") }); community.on("sessionExpired", function(err) { console.log("## Session Expired"); client.webLogOn(); }); The bot gets new offers with manager.on('newOffer', function(offer) { , makes a simple request using https://www.npmjs.com/package/request and calls offer.getUserDetails. An offer is accepted like this: offer.accept(accept(offer, 1)); These are the two functions that handle accepting and confirming trades: function confirm(offer, count) { return function(err) { if (err) { if (count < 20) { console.log(err); setTimeout(community.acceptConfirmationForObject, 10000, data.identity_secret, offer.id, confirm(offer, count + 1)); } else { console.error("CONFIRM FUNCTION: "); console.error(err); } } } } function accept(offer, count) { return function(err, status) { if (err) { if (count < 20) { console.log(err); setTimeout(offer.accept, 10000, accept(offer, count + 1)); } else { console.error("ACCEPT FUNCTION: "); console.error(err); } } else { if (status === "pending") { community.acceptConfirmationForObject(data.identity_secret, offer.id, confirm(offer, 1)); } } } } Whenever I run the code it works for a few hours accepting offers and confirming them. Then offer comes in and the sessionExpired and webSession events are emitted twice. Error: Cannot accept an unsent offer happens every time it tries to accept the offer. This from stdout (it also logs the timestamp): 16:31:23 Error: Not Logged In at SteamCommunity._checkCommunityError (/home/user/bot/node_modules/steamcommunity/components/http.js:128:9) at Request._callback (/home/user/bot/node_modules/steamcommunity/components/http.js:51:88) at Request.self.callback (/home/user/bot/node_modules/request/request.js:185:22) at emitTwo (events.js:126:13) at Request.emit (events.js:214:7) at Request.<anonymous> (/home/user/bot/node_modules/request/request.js:1161:10) at emitOne (events.js:116:13) at Request.emit (events.js:211:7) at Gunzip.<anonymous> (/home/user/bot/node_modules/request/request.js:1083:12) at Object.onceWrapper (events.js:313:30) 16:31:23 ## Session Expired 16:31:23 ## Session Expired 16:31:23 Error: Not Logged In at SteamCommunity.manager._community.httpRequestPost (/home/user/bot/node_modules/steam-tradeoffer-manager/lib/classes/TradeOffer.js:483:25) at Request._callback (/home/user/bot/node_modules/steamcommunity/components/http.js:67:15) at Request.self.callback (/home/user/bot/node_modules/request/request.js:185:22) at emitTwo (events.js:126:13) at Request.emit (events.js:214:7) at Request.<anonymous> (/home/user/bot/node_modules/request/request.js:1161:10) at emitOne (events.js:116:13) at Request.emit (events.js:211:7) at IncomingMessage.<anonymous> (/home/user/bot/node_modules/request/request.js:1083:12) at Object.onceWrapper (events.js:313:30) 16:31:23 weblogon 16:31:24 weblogon 16:31:33 Error: Cannot accept an unsent offer at Timeout.TradeOffer.accept [as _onTimeout] (/home/user/bot/node_modules/steam-tradeoffer-manager/lib/classes/TradeOffer.js:451:23) at ontimeout (timers.js:502:15) at tryOnTimeout (timers.js:323:5) at Timer.listOnTimeout (timers.js:290:5) 16:31:43 Error: Cannot accept an unsent offer at Timeout.TradeOffer.accept [as _onTimeout] (/home/user/bot/node_modules/steam-tradeoffer-manager/lib/classes/TradeOffer.js:451:23) at ontimeout (timers.js:502:15) at tryOnTimeout (timers.js:323:5) at Timer.listOnTimeout (timers.js:290:5) ... etc What am I doing wrong?
  14. Hi, im sorry to bother you but i need a litte bit of help. I need to find, how to get my sended offers and to be honest, I dont even know where to start, what function use and even if its possible or if i will need o save every trade i send. Thank you
  15. Sorry to bother anyone on Christmas but I'm trying to send comments to user profiles. community.postUserComment("steam id", "hello", function (err) { console.log(err); }); But it keeps returning the error: Error: The settings on this account do not allow you to add comments. I've tried this on multiple accounts all of which have comments enabled, even tried on my own (bots) profile, still no luck. Any help would be greatly appreciated!
  16. community.getUserInventoryContents(partner, 753, 6, true, (error, items) => { if(error) { users.removeReservation(partner, true, removeFunc); return callback(error); } let count = 0; for(let i = 0; i < items.length; i++) { let item = items[i]; if(item.type.toLowerCase() != "Trading Card") continue; count += item.amount; if(count > price) { item.amount -= (count - price); count -= (count - price); } offer.addTheirItem(item); if(count == price) break; } if(count < price) { users.removeReservation(partner, true, removeFunc); return callback("You do not have enough gems to purchase random games."); } if(count > price) { users.removeReservation(partner, true, removeFunc); return callback("An unexpected error occurred, please try again."); } offer.send((error, status) => { if(error) { users.removeReservation(partner, true, removeFunc); return callback(error); } if(status == "pending") { community.acceptConfirmationForObject(files.getConfig().identity, offer.id, error => { if(error) { users.removeReservation(partner, true, removeFunc); return callback(error); } callback(null, "https://steamcommunity.com/tradeoffer/" + offer.id); }); } else if(status == "sent") callback(null, "https://steamcommunity.com/tradeoffer/" + offer.id); }); }); break; default: users.removeReservation(partner, true, (error) => { if(error) return callback(error); return callback("Invalid payment method"); }); } }); }); } Where is my fault?
  17. Guest

    node-steam-user v 4

    Hi, when do you planning release node-steam-user v 4 ?
  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
  19. But steam-user inviteToGroup works fine. Though earlier inviteUserToGroup worked as it should.Can you tell me why ?
  20. I want take random 5 trading cards how can i do ? i use this; community.getUserInventory(partner, 753, 6, true, (error, items) => {if(error) {users.removeReservation(partner, true, removeFunc);return callback(error);} let count = 0; for(let i = 0; i < items.length; i++) {let item = items; if(item.type.toLowerCase() != "Steam Trading Cards")continue; count += item.amount; if(count > price) {item.amount -= (count - price);count -= (count - price);} offer.addTheirItem(item); if(count == price)break;} But dont working help me please
  21. Hello there, I am very new to node.js and learning step by step, I had a look at many topics in this forum to learn some basics of trading codes, I need little help here, I want to connect to database, retrieve steam trading card names from database (like Alpaca Mage, Mysterious Card 4 etc.) and send a trade offer containing only those trading cards. I also want my bot to check my database like every 10 seconds and if a value i want is found, it will create a trade offer. Is something like this possible ? Thanks in advance
  22. http://prntscr.com/lv0q6u my developer is busy for few days. can anyone give me any idea why this happens so i could fix it? it happens after 24 hrs etc when bot is working
  23. So, i would like to search for specific items (keys). Code: community.getUserInventoryContents(steamid, 730, 2, true, (err, inventory) => {if (err) {throw err;}else{for(var i = 0, len = inventory.length; i < len; i++){var itemnames = inventory.market_hash_name;}var found = itemnames.search("R8 Revolver | Bone Mask (Well-Worn)");if(found != -1) {console.log();}console.log(itemnames);console.log (found); } I would like to write a code which is search for a specific item, then check this item's amount and then do something, but i'm new at nodeJS so i don't know so many things.Please Help, or give me some docs. Tnanks
  24. Hello, can I somehow interact when one of my friends gets online? best regards Kingnemehl
  25. Is there any way to learn if an offer between 2 different steam accounts (that are not mine) got accepted or declined ? I would like to create a website in which people advertise their cs go skins and others buy it, the skins are traded via their own steam accounts but i need to learn if the skin gets to buyer or not ? Is there any way to do that ? Thanks in advance
×
×
  • Create New...