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. http://pastebin.com/sDi8gSc0 This is my code right now, when I send trades with only my items/my items added it says An error occured whilst sending trade offer: Error: HTTP error 401 but when I send a trade offer where I don't add any of my items (only their items) it works fine, so may I ask how do I stop this error? Here's my code for sending a trade with my items if(type == "withdraw") { offer.setMessage("By acceppting this offer you will lose " + value + " Gems"); for (var a = 0; a < itemsToGive.length; a++) { offer.addMyItem({"assetid": itemsToGive[a], "appid": 730, "contextid":2}); console.log(itemsToGive[a]); } } offer.send(function(err, status) { if (err) { console.log("An error occured whilst sending trade offer: " + err); } if(status == "pending") { console.log("Trade offer Pending. Offer #" + offer.id + " Regardless, adding to database with the offer state: 9"); tradeData = { tradeofferid: offer.id, steamid: partner, type: type, amount: value, paid: 0, offerState: 9 }; connection.query('INSERT INTO csgotrades SET ?', tradeData); } if (status == "sent") { console.log("Trade offer succesfully sent. Offer #" + offer.id); tradeData = { tradeofferid: offer.id, steamid: partner, type: type, amount: value, paid: 0, offerState: offer.state }; connection.query('INSERT INTO csgotrades SET ?', tradeData); } }); I can send trades with their items fine but with mine I just get the error if(type == "withdraw") { offer.setMessage("By acceppting this offer you will lose " + value + " Gems"); for (var a = 0; a < itemsToGive.length; a++) { offer.addMyItem({"assetid": itemsToGive[a], "appid": 730, "contextid":2}); console.log(itemsToGive[a]); } }
  2. Hello ! How should i properly handle this error ? I wrapped offer.accept into Promise and when i catch error then i get errCode and if errCode === 28 what way to re-accept this offer properly ? should i return false and then try to accept offer again ? or update somehow ?
  3. I am using steam-user for steam session on my bot. my app listening event webSession. But sometime session had been expired, but event not emit. And for every offer i get error (HTTP 401 e.g.) I wanna gather all error (401 and etc.) and if i get this error on callback for offer - to make force relogin. My way of thinking is right?
  4. Hi! I'm trying to send an offer from one account to another. I'm relative new to programming. Here is the code: var TradeOfferManager = require('steam-tradeoffer-manager'); var SteamID = TradeOfferManager.SteamID; var sid = new SteamID('[MY_STEAM_ID]'); sid.type = SteamID.Type.INDIVIDUAL; sid.instance = SteamID.Instance.DESKTOP; var SteamCommunity = require('steamcommunity'); var SteamTotp = require('steam-totp'); var SteamUser = require('steam-user'); var client = new SteamUser(); var community = new SteamCommunity(); var manager = new TradeOfferManager({ "steam": client, "domain": "MY_DOMAIN", "language": "en" }); // Steam logon options var logOnOptions = { "accountName": "MY_STEAM_USERNAME", "password": "MY_STEAM_PASSWORD", }; client.logOn(logOnOptions); client.on('loggedOn', function() { console.log("Logged into Steam as " + client.steamID.getSteam3RenderedID()); }); // Send offer var offer = manager.createOffer("https://steamcommunity.com/tradeoffer/new/?partner=MY_STEAM_PARTNER&token=MY_STEAM_TOKEN"); manager.loadUserInventory(sid, 730, 2, true, function(err, myItems) { if(err) { console.error(err); return; } console.log(myItems[3]); offer.addMyItem(myItems[3]); offer.setToken("MY_STEAM_TOKEN"); offer.setMessage("Transferring my stuff"); offer.send(function(err) { console.log(err); }); });The output is the following: Logged into Steam as [U:1:MY_STEAM_ID] CEconItem { id: '6763577968', classid: '310778073', instanceid: '302028390', amount: 1, pos: 3, assetid: '6763577968', contextid: '2', appid: '730', icon_url: '-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpovrG1eVcwg8zAaAJF_t24nZSOqPrxN7LEmyUB6pwl2r2U84-h2VG1-hA6MWimJ4GRIAU2NAmC-QLvkLjsjJftup3L1zI97T2fu0Hu', icon_url_large: '-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpovrG1eVcwg8zAaAJF_t24nZSOqPrxN7LEm1Rd6dd2j6eR99Wh2ADhrRBoYjyiJdXDIAdrYl_UqFK2lL-9hsXt7cvKwHMyvCAg-z-DyIQOpr_N', icon_drag_url: '', name: 'P2000 | Granite Marbleized', market_hash_name: 'P2000 | Granite Marbleized (Field-Tested)', market_name: 'P2000 | Granite Marbleized (Field-Tested)', name_color: 'D2D2D2', background_color: '', type: 'Industrial Grade Pistol', tradable: true, marketable: true, commodity: false, market_tradable_restriction: 7, descriptions: [ { type: 'html', value: 'Exterior: Field-Tested' }, { type: 'html', value: ' ' }, { type: 'html', value: 'Accurate and controllable, the German-made P2000 is a serviceable first-round pistol that works best against unarmored opponents. It has been painted in a marbleized pattern.' }, { type: 'html', value: ' ' }, { type: 'html', value: 'The Italy Collection', color: '9da1a9', app_data: [Object] }, { type: 'html', value: ' ' } ], actions: [ { name: 'Inspect in Game...', link: 'steam://rungame/730/76561202255233023/+csgo_econ_action_preview%20S%owner_steamid%A%assetid%D14285500353088769102' } ], market_actions: [ { name: 'Inspect in Game...', link: 'steam://rungame/730/76561202255233023/+csgo_econ_action_preview%20M%listingid%A%assetid%D14285500353088769102' } ], tags: [ { internal_name: 'CSGO_Type_Pistol', name: 'Pistol', category: 'Type', category_name: 'Type' }, { internal_name: 'weapon_hkp2000', name: 'P2000', category: 'Weapon', category_name: 'Weapon' }, { internal_name: 'set_italy', name: 'The Italy Collection', category: 'ItemSet', category_name: 'Collection' }, { internal_name: 'normal', name: 'Normal', category: 'Quality', category_name: 'Category' }, { internal_name: 'Rarity_Uncommon_Weapon', name: 'Industrial Grade', category: 'Rarity', color: '5e98d9', category_name: 'Quality' }, { internal_name: 'WearCategory2', name: 'Field-Tested', category: 'Exterior', category_name: 'Exterior' } ], is_currency: false, market_marketable_restriction: 0, fraudwarnings: [] } Error: HTTP error 401 at SteamCommunity.manager._community.httpRequestPost (/srv/SteamTrade/node_modules/steam-tradeoffer-manager/lib/classes/TradeOffer.js:477:31) at Request._callback (/srv/SteamTrade/node_modules/steamcommunity/components/http.js:62:14) at Request.self.callback (/srv/SteamTrade/node_modules/request/request.js:187:22) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7) at Request.<anonymous> (/srv/SteamTrade/node_modules/request/request.js:1044:10) at emitOne (events.js:96:13) at Request.emit (events.js:188:7) at IncomingMessage.<anonymous> (/srv/SteamTrade/node_modules/request/request.js:965:12) at emitNone (events.js:91:20)I couldn't get steam-totp to work (getAuthCode() that is), could this be the issue - that the account isn't logged in correctly? Why I suspect this might be the issue is because manager.loadInventory(730, 2, true, function(err, myItems)didn't work, while manager.loadUserInventory(sid, 730, 2, true, function(err, myItems)works. If not, what else could be the issue? Thankful for answers, Andreas
  5. Hello! I am having an error with my bot about login. I currently have this error. error: Error: RateLimitExceeded at SteamUser._handlers.(anonymous function) (C:\Users\Richard\Desktop\Steam\NodeJS\CombinedBot\node_modules\steam-user\components\logon.js:320:16) at SteamUser._handleMessage (C:\Users\Richard\Desktop\Steam\NodeJS\CombinedBot\node_modules\steam-user\components\messages.js:198:29) at emitThree (events.js:102:20) at CMClient.emit (events.js:175:7) at CMClient._netMsgReceived (C:\Users\Richard\Desktop\Steam\NodeJS\CombinedBot\node_modules\steam-user\node_modules\steam-client\lib\cm_client.js:278:8) at CMClient.handlers.(anonymous function) (C:\Users\Richard\Desktop\Steam\NodeJS\CombinedBot\node_modules\steam-user\node_modules\steam-client\lib\cm_client.js:386:8) at CMClient._netMsgReceived (C:\Users\Richard\Desktop\Steam\NodeJS\CombinedBot\node_modules\steam-user\node_modules\steam-client\lib\cm_client.js:260:24) at emitOne (events.js:77:13) at TCPConnection.emit (events.js:169:7) at TCPConnection._readPacket (C:\Users\Richard\Desktop\Steam\NodeJS\CombinedBot\node_modules\steam-user\node_modules\steam-client\lib\tcp_connection.js:73:7) Can anyone tell me what Rate Limit is ? And also, how can I avoid exceeding it in the future? Steam is not letting me login to that account from my ip, i've waited about an hour since last attempt and still got disconnected. Also, my code here could help. function LogOn() { client.setOption("promptSteamGuardCode", false); client.logOn({ "accountName": secondconfig.username, "password": secondconfig.password }); client.on("error", function(error){ logger.error(error); }); client.on("webSession", function(steamID, cookies) { community.setCookies(cookies); steamTrade.sessionID = cookies[0].split("=")[1]; cookies.forEach(function(cookie) { steamTrade.setCookie(cookie); }) SteamTotp.steamID = steamID; community.startConfirmationChecker(2500, secondconfig.identitysecret); }) client.on("steamGuard", function(domain, callback, lastCodeWrong) { if(lastCodeWrong) { logger.warn("Last Code was Wrong... trying again!"); } var shared_secret = secondconfig.sharedsecret; callback(SteamTotp.generateAuthCode(shared_secret)); }); // Bot started, set up trade offer with steam api key client.on("loggedOn", function(details){ logger.info("Logged onto Steam! With the SteamID of " + client.steamID.getSteam3RenderedID()); client.setPersona(Steam.EPersonaState.Online); client.gamesPlayed(440); //webLogOn(); }); } LogOn(); I made LogOn(); into a method, because I want to be able to restart the bot via a message from a user like !restart. You can see that code here steamFriends.on('friendMsg', function(id, msg, type) { if(type == Steam.EChatEntryType.ChatMsg){ switch(msg) { case "!help": steamFriends.sendMessage(id, "Hello! I'm an bot that buys Mann Co. Audition Reels and Mann Co. Directors Cut Reels!"); break; case "!restart": logger.info('Restarting Bot!'); steamFriends.sendMessage(id, "Restarting in 3 seconds..."); client.logOff(); setTimeout(LogOn, 3000); } } }); When I called the !restart command, the bot stopped, then attempted to login, and I got my Last Code Wrong warning about 10-15 times before the bot got the rate limit error. What can I do ?
  6. Like for example if a user sends a link with a picture trough steam chat the bot will take that picture and use it as its own [restricted to admin only ofcourse] Is something like this possible if so how?
  7. Here's a bit of my code, which works I've removed the callback as it didn't need to be there, so I can check when an offer is pending confirmation, then it gets added to the database, but when it gets added if for some reason the bot doesn't auto acceppt it (I have .checkconfirmations on but still if there's an error) so this code wouldn't be the best, so how would I check upon when the bot confirms a trade? Here's the little bit of code offer.Send(callback etc { if(status == "pending") { console.log("Trade offer Pending. Offer #" + offer.id + " Regardless, adding to database with the offer state: 9"); tradeData = { tradeofferid: offer.id, steamid: partner, type: type, amount: value, paid: 0, offerState: 7 }; connection.query('INSERT INTO csgotrades SET ?', tradeData); } });
  8. I'm using the Doctor McKay library for login and trade starting, but I am then using seishun's steam-trade to automate trading. Here's my current code. client.on("tradeRequest", function(steamID, respond) { logger.info("Incoming Trade Request from " + steamID.getSteam3RenderedID()); respond(true); }) client.on("tradeStarted", function(steamID) { steamTrade.open(JSON.stringify(steamID)); }) steamTrade.on('offerChanged', function(added, item) { console.log('they ' + (added ? 'added ' : 'removed ')); console.log(item); for(var i = 0; i < steamTrade.themAssets.length; i++) { console.log(steamTrade.themAssets[i]); } }); When I log the item , the console prints out undefined and returns an error. (I assume this means the item is undefined?) Seishun told me that the reason this happens is because the tradeStarted event returns steamID as an object, not a string? I thought the JSON.stringify would convert this object to a string, but obviously I am mistaken? C:\Users\Richard\Desktop\Steam\NodeJS\GlitchedTurtleBot\node_modules\steam-trade\index.js:208 return self._themInventories[item.appid][item.contextid][item.assetid]; ^ TypeError: Cannot read property '2' of undefined at C:\Users\Richard\Desktop\Steam\NodeJS\GlitchedTurtleBot\node_modules\steam-trade\index.js:208:47 at Array.map (native) at SteamTrade._onTradeStatusUpdate (C:\Users\Richard\Desktop\Steam\NodeJS\GlitchedTurtleBot\node_modules\steam-trade\index.js:206:72) at Request._callback (C:\Users\Richard\Desktop\Steam\NodeJS\GlitchedTurtleBot\node_modules\steam-trade\index.js:244:10) at Request.self.callback (C:\Users\Richard\Desktop\Steam\NodeJS\GlitchedTurtleBot\node_modules\steam-trade\node_modules\request\request.js:187:22) at emitTwo (events.js:87:13) at Request.emit (events.js:172:7) at Request.<anonymous> (C:\Users\Richard\Desktop\Steam\NodeJS\GlitchedTurtleBot\node_modules\steam-trade\node_modules\request\request.js:1044:10) at emitOne (events.js:77:13) at Request.emit (events.js:169:7)
  9. hello, im trying to make a steam trade bot (and im not so good with coding). i found this code to send trade offer but i don"t know how to add items var offer = manager.createOffer("https://steamcommunity.com/tradeoffer/new/?partner=0000000&token=xxxxxxx"); manager.loadInventory(730, 2, true, function(err, myItems) { if(err) { console.error(err); return; } offer.loadPartnerInventory(730, 2, function(err, theirItems) { if(err) { console.error(err); return; } offer.addMyItem(myItems[0]); offer.addTheirItem(theirItems[0]); offer.send(""); }); }); }); let's say i want to : send 2 items with id 6908727870 and id 6901768067 and recieve 2 items with id 847548541 and id 325415748 please just help me filling these ids in the code above to serve like an example for me. thank you so much
  10. Hey, I need to use a function from node-steam-user (adding friend). How can I log in on steam-user using node-steamcommunity? I don't see in the wiki any setcookie option, is there any easy option in this package or I have to log in manually?
  11. After an exchange asset_id changes. But how opskins or bitskins gets new asset_id? By original_id (GetPlayerItems) or how? They need to know what exactly this thing from this man they got...
  12. I know that getReceivedItems working with accepted offers but what I need that get the Items in the sent trade offers "not in the received trade offers" after accepted. Can I do that?how?
  13. Here is my current Code http://pastebin.com/0Ezn6rNY So far everything works, however I'm wondering, how do I check if a trade has been acceppted? I want to make it so I can do something like php code: 'socket.emit("getTrade", tradeid)' nodejs code: 'socket.on('getTrade', function(steamid, tradeid) {' GET TRADE STATUS HERE '}' But i also want it so the bot automatically polls and checks the trade status so if the trade gets acceppted/declined the node js bot will do something (I want it so this doesn't require me to send getTrade to the bot and it just automatically checks if the bot acceppts so the bot can update sql records without having to keep clicking 'check trade') so how shall I get the bot to automatically check if a trade has been acceppted after sending? I've had a look at the documentation and I still couldn't seem to get it, so help would be appreciated
  14. friends.on("friendMsg", function(user, msg, type, details){ if(type == Steam.EChatEntryType.ChatMsg){ if(msg == "invite"){ client.on("getSteamLevels", function(user, callback){ client.getSteamLevels(user, callback) callback(results); if(results >= 10){ client.inviteUserToGroup(user, "steamgroupidhere") } }); } } }); Thats my code.Whats wrong it with?
  15. Hey, I am wondering what the best way to detect for invalid cookies is. Detecting Invalid cookies: In the past I have been using node-steam-tradeoffers so if I sent a tradeoffer that returned status 403, I would get new cookies and then resend the tradeoffer. This is the code that I have at the moment: client.logOn(logOnOptions); client.on("webSession", (sessionID, cookies) => { manager.setCookies(cookies, (err) => { if (err) { console.log(err); } }); What is the best way to detect and replace invalid cookies? Thanks
  16. Any specific format this date object needs to be in? I was to set "cancelTime": 5*60*1000 Also I tried doing it manually by passing a date object set 5 minutes in the future (my timezone is GBT+3). After sending the offer and fetching offer.expires the time is correct but 14 days in the future. Any ideas what might cause this?
  17. To my understanding Steam's api's Inventory has a IP rate limit. I read this post https://dev.doctormckay.com/topic/203-using-loaduserinventory-on-1-bot/?hl=inventory and I'm not understanding how making 100 inventory calls/min results in the need for only 5 ip's? Each IP being able to make 2 requests per minute results in a maximum of 10 inventory calls. Sorry if this is obvious, I just don't understand it.
  18. Basicly the tittle says it all.Would it be possible to add this?If yes could the developer please add this? Thanks.
  19. Hello, i wanted add comment on steam profile, what's wrong? var SteamCommunity = require('../index.js'); var ReadLine = require('readline'); var fs = require('fs'); var SteamID = require('steamid'); var CEconItem = require('../classes/CEconItem.js'); var community = new SteamCommunity(); var rl = ReadLine.createInterface({ "input": process.stdin, "output": process.stdout }); rl.question("Username: ", function(accountName) { rl.question("Password: ", function(password) { doLogin(accountName, password); }); }); function doLogin(accountName, password, captcha) { community.login({ "accountName": accountName, "password": password, "captcha": captcha }, function(err, sessionID, cookies) { if(err) { if(err.message == 'CAPTCHA') { console.log(err.captchaurl); rl.question("CAPTCHA: ", function(captchaInput) { doLogin(accountName, password, captchaInput); }); return; } console.log(err); process.exit(); return; } console.log("Logged on!"); SteamCommunity.prototype.postUserComment = function(userID, message, callback) { if(typeof userID === 'string') { userID = new SteamID(userID); } var self = this; this.httpRequestPost({ "uri": "https://steamcommunity.com/comment/Profile/post/76561198015482752", "form": { "comment": message, "count": 6, "sessionid": this.getSessionID() }, "json": true }, function(err, response, body) { if(!callback) { return; } if (err) { callback(err); return; } if(body.success) { callback(null); } else if(body.error) { callback(new Error(body.error)); } else { callback(new Error("Unknown error")); } }, "steamcommunity"); }; }); }
  20. Hello, what should i do to voteup/rate screenshots via nodejs? Some hint? Where should i start, I am green
  21. It seems all csgo items have instance ids unique to their types such as all keys have the instance id of "143865972" and all R8 Revolver | Bone Mask (Well-Worn) have an instance id of 302028390. How would I get this info from a trade offer?
  22. When I send an offer from the bot to the user and the user accepts and confirms with the mobile the bot's account receives the item but no event is launched on bot. Polling Data manually every 2 seconds shows that the offer is shown in pollData in state 2 still. Also no other events seem to work for me (EG: .on("debug",console.log) ). Can I have made a mistake that crashed the events? My code looks something like this console.dir("logged"); var manager = new SteamTrades({ "community": bot.community, // Polling every 30 seconds is fine since we get notifications from Steam //"domain": "example.com", "pollInterval": 5000, "language": "en" // We want English item descriptions }); manager.on('sentOfferChanged',function(offer, oldState) { console.dir("sentOfferChanged"); console.dir(offer); }); manager.on('pollFailure',function(err){ console.log("failed to poll"); console.log(err); }); manager.on('pollData',function(pollData){ console.log("pollData ",pollData); }); manager.on('debug', console.log); live_bots[bot.index].manager = manager;
  23. How to get all CSGO items like csgostash.com? http://api.steampowered.com/IEconItems_730/GetSchema/v2/?key=APIKEY&format=json The GetSchema does not have a name and description for each item. I doubt that the csgostash.com adds each new item manually. Is there a way to obtain all automatically?
×
×
  • Create New...