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. Sorry for asking for such a trivial question, but this would be my first bot for steam. But I was wondering what is the required code that I would need to start up the bot, and have the bot running? Also am wondering how would I go about calling the constructor for the methods. Again sorry for asking such a trivial question, I feel stupid asking it.
  2. Like what i'm trying to do is when someone puts !sell in the chat with an argument on it. If there isn't a argument/number on it, the bot replies with "Sorry you must put a number". Since I use discord.js a lot my arguments may be wrong so if it is, please tell me the correct argument: client.on('friendMessage', (senderID, message) => {var args = message.slice(prefix.length).trim().split(/ +/g);if(message == prefix + "sell") {if(!args.length) {client.chatMessage(senderID, 'You didn\'t provide a number');}}}); But here;'s the thing the bot doesn't reply when I didn't provide an argument. So anyways any tips and stuff would be greatly appreciated
  3. Hello, I've been using the trade offer manager for a while, and I noticed when I put the getReceivedItems the actions array is empty, but when I try to pull the same item from the inventory(which is now at my inventory) the actions array is not empty? is this a bug or am I doing something wrong? Thank you!
  4. When i receive offer . I get market_hash_name using offer.itemsToReceive[0].market_hash_name But when i using offer.getReceivedItems(function (err, items) { //Why items[0].market_hash_name !== offer.itemsToReceive[0].market_hash_name } It only happen when i received item in game PUBG (example item with market_hash_name: 'Combat Pants (camo)' ) Thanks !
  5. Hi, did anyone find out how to accept mobile confirmations without (deprecated) pooling with startConfirmationChecker and not get ratelimited after few calls of acceptConfirmationForObject? I do not want to accept that I have to wait up to 10 seconds for confirmation
  6. Hi all, So this is my code : community.on('sessionExpired', (err) =>{ console.log("Session Expired !! Logging In Again...") if (a = 1) { a = 0 login(); } }); community.on('disconnected', (err) =>{ console.log("Disconnected !! Logging In Again...") if (a = 1) { a = 0 login(); } }); So what is happening is that the sessionExpired is being called but when the bot is trying to log in, it crashes with an error stating that we are already logged in and we cannot log in again, also sometimes the bot crashes with an error saying the session was replaced or something like that, sorry I don't exactly remember, will post log when it happens again. Any help would be greatly appreciated PS: I've added that var a to make sure that the login function is called only once, I change it back to 1 once we get the webapi key from steam.
  7. When I send 2 offers at the same time (Delta of 0-2 seconds) bot SOMETIMES ignore second offer and not fire `newOffer`. Its fired later when some other event is fired (next `newOffer`, or some of `OfferChanged` events)
  8. function kick (){ community.getGroupMembers('GROUPID', function(err, members) { community.kickGroupMember('USERID', function (err) { if (err){ console.log(err); } else { console.log('Good'); } }); }); } Hello. I want to kick some member of group. But i have a this error; events.js:136 throw er; // Unhandled 'error' event ^ TypeError: steamID.getSteamID64 is not a function at SteamCommunity.kickGroupMember (C:\Users\Lenovo\Desktop\Yeni klasör\node_modules\steamcommunity\components\groups.js:431:24) at C:\Users\Lenovo\Desktop\Yeni klasör\blue.js:241:13 at C:\Users\Lenovo\Desktop\Yeni klasör\node_modules\steamcommunity\components\groups.js:63:5 at Parser.<anonymous> (C:\Users\Lenovo\Desktop\Yeni klasör\node_modules\xml2js\lib\parser.js:303:18) at Parser.emit (events.js:159:13) at SAXParser.onclosetag (C:\Users\Lenovo\Desktop\Yeni klasör\node_modules\xml2js\lib\parser.js:261:26) at emit (C:\Users\Lenovo\Desktop\Yeni klasör\node_modules\sax\lib\sax.js:624:35) at emitNode (C:\Users\Lenovo\Desktop\Yeni klasör\node_modules\sax\lib\sax.js:629:5) at closeTag (C:\Users\Lenovo\Desktop\Yeni klasör\node_modules\sax\lib\sax.js:889:7) at SAXParser.write (C:\Users\Lenovo\Desktop\Yeni klasör\node_modules\sax\lib\sax.js:1436:13) Can you tell me what i did wrong ? Greetings.
  9. I'm trying to get user details on a message. The problem is that if the user changes his profile (name,location,etc) the bot will have to reset in order to update those values.. [Here's my code](https://pastebin.com/7pq0rJqC): I get it that the bot gets the caches version of the steam profile page, but is there a way it can update it every couple of minutes? The only alternative I have my mind is logging a different bot that'll update those details & then send them to the main bot, but that's way too much to do each time I get a new message..
  10. I'm trying to make a function, which gets called when the specified command is entered. function code: function tradecases(botid, senderid) { var appid = 730; var contextid1 = 2; bots[botid].offers.loadUserInventory(senderid, appid, contextid1, true, (err, theirInv) => { if (err) { logger.error(err); } else { var theirItem = theirInv bots[botid].offers.offer.addTheirItems({ 'appid': appid, 'contextid': contextid1 }); bots[botid].offers.offer.setMessage('This is an automated tradeoffer for all your trading cards. You can change it if you want.'); bots[botid].offers.offer.send((err, status) => { if (err) { logger.error(err); } else logger.info('sent offer status: ' + status); }); } }); } Error (error shows up in CMD): verbose: [B1] Received message from non-botadmin: !casedonate F:\va\Steam bots\main.js:240 bots[botid].offers.offer.addTheirItems({ ^ TypeError: Cannot read property 'addTheirItems' of undefined at bots.(anonymous function).offers.loadUserInventory (F:\va\ Steam bots\main.js:240:44) at SteamCommunity.<anonymous> (F:\va\node_modules\steamcommun ity\components\users.js:342:5) at Request._callback (F:\va\node_modules\steamcommunity\compo nents\http.js:67:15) at Request.self.callback (F:\va\node_modules\request\request. js:186:22) at Request.emit (events.js:180:13) at Request.<anonymous> (F:\va\node_modules\request\request.js :1163:10) at Request.emit (events.js:180:13) at IncomingMessage.<anonymous> (F:\va\node_modules\request\re quest.js:1085:12) at Object.onceWrapper (events.js:272:13) at IncomingMessage.emit (events.js:185:15) Could someone maybe give me advice, help, suggestions on how to fix this error? Extra info: Bots log in perfectly, nothing goes wrong. Bots are online. There is a second command like this but that one is meant for steam trading cards. This command has the same issues. All help is appreciated <3
  11. Hi, I have a problem with writing a script to my trade bot. I decided to add a function that will send a message to all my friends, for example three hours. Unfortunately, but I do not know what I could start with. Could someone help me?
  12. Following Code which is I used. var client = new SteamUser();var manager = new TradeOfferManager({ "steam": client, // Polling every 30 seconds is fine since we get notifications from Steam "domain": "example.com", // Our domain is example.com "language": "en", // We want English item descriptions "cancelTime" : 120000 //Cancellation Time in miliseconds 1000 ms = 1 second, After 2 minute cancel trade}); var offer = manager.createOffer(trade_url);offer.data('cancelTime', null); //I written my code to remove cancellation time for this trade but do not work this codeoffer.addMyItems(inv_to_trade); offer.setMessage("My Message here");offer.send(function (err, status) { if (err) { logger.error("trade send Error",err); return true; }}); Question : I written offer.data('cancelTime', null); but this do not work so How I cancel this offer ?
  13. Hi, I'm trying to get all of the Received offers that are active. I read here about the function https://github.com/DoctorMcKay/node-steam-tradeoffer-manager/wiki/TradeOfferManager#getoffersfilterhistoricalcutoff-callback but I don't think I'm using the time object right. Here is my code: https://pastebin.com/SZcx0dwn What's the right way to do that?
  14. Hello, I'm trying to build a tradebot which creates offers with keys in it and I only want CSGO case keys, no capsule keys. Is there any other way then checking the tags on an item? The capsule and case keys both look the same there... tags: [ { internal_name: 'CSGO_Tool_WeaponCase_KeyTag', name: 'Key', category: 'Type', color: '', category_name: 'Type' }, { internal_name: 'normal', name: 'Normal', category: 'Quality', color: '', category_name: 'Category' }, { internal_name: 'Rarity_Common', name: 'Base Grade', category: 'Rarity', color: 'b0c3d9', category_name: 'Quality' } ] I can check the 'market_hash_name' if it contains 'Capsule' but that's kinda dirty ;( Any suggestion is really appreciated! Greetings
  15. Hi, so I'm making a bot that send the user a trade offer with 350 gems, but the problem is that it's my first time using JS, so I find it kinda difficult to do it... I found this online but I don't understand it at all....: manager.getUserInventoryContents(steamID, 753, 6, true, (err, inv) => { if (err) { throw err; } let gems = inv.filter(item => item.market_hash_name == "Gems"); let item = gems[0]; item.amount = 350; offer.addMyItem(item); offer.send(function(err, status) { if (err) { console.log(err); return; } //Some code }); }); But the problem is that I need: 1. Check if the user has at least 350 Gems or more in their inventory 2. Send the trade offer with the 350 gems So I basically have no idea how to do it... Anyone can help me out? Thanks.
  16. Hi, so I am making a bot and the user has a "!buy" command that also has a parameter. How do I find out what number the user enters after the command when the user enters it like this "!buy 3"? if (msg.toUpperCase() == '!BUY' && '!BUY' == msg.toUpperCase().substring(0,4)){ if(!isNaN(msg.charAt(5)) && parseInt(msg.charAt(5)) > 0){ var string_start=msg.indexOf("UY"); var nrOfSets= ""; string_start+=3; for (var i = string_start; i < msg.length; i++) { nrOfSets+= msg.charAt(i); } var sets = parseInt(nrOfSets); I tried that but it doesn't work, it just skips to the last "else" which tells the user that the command is not recognized... Thanks. ---- EDIT FIXED!
  17. Hello, dear community, I am currently trying to manage multiple bots. I have made a bot.js where I am declaring how the object of the bot has to be. In the app.js I am making, for every steam account I have, a bot object and starting each bot synchronously after the bot before has been successfully logged in before. Now my problem: Let's say I have 10 steam accounts, every account owns Counter Strike and has a minimum spent of $5 in market. If I now start all bot instances, all steam accounts are shown as 'Currently In-Game Counter-Strike: Global Offensive' as far as good. But if I now send a trade offer to one of these bots, whatever bot I send the trade offer to it never gets accepted plus in the log files it says always: "Bot #10: Accepted offer. Status: pending"(Strange because the offer wasn't accepted!). So whatever bot I send the offer to, it's always bot #10 (the last bot) that tries to accept the offer. bot.js var SteamUser = require('steam-user'); var SteamTotp = require('steam-totp'); var SteamCommunity = require('steamcommunity'); var TradeOfferManager = require('steam-tradeoffer-manager'); var client; var community; var manager; var logOnOptions; function Bot(options, loggedIn){ //loggedIn -> Callback function, fires when client logs in successfully. client = new SteamUser(); community = new SteamCommunity(); manager = new TradeOfferManager({ steam: client, community: community, language: 'en' }); logOnOptions = { accountName : options.accountName, password : options.password, twoFactorCode : SteamTotp.generateAuthCode(options.shared_secret) }; client.logOn(logOnOptions); client.on('loggedOn', () => { console.log('Bot #'+options.id+' is running...'); client.setPersona(SteamUser.Steam.EPersonaState.Online); client.gamesPlayed(730); loggedIn(); }); client.on('webSession', (sessionid, cookies) => { manager.setCookies(cookies); community.setCookies(cookies); community.startConfirmationChecker(10000, options.identity_secret); }); manager.on('newOffer', offer => { if (offer.partner.getSteamID64() === '76561198100124418') { offer.accept((err, status) => { if (err) { console.log('Bot #'+options.id+': Error while accepting. '+err); } else { console.log('Bot #'+options.id+': Accepted offer. Status: '+status); } }); } else { offer.decline(err => { if (err) { console.log(err); } else { console.log('Bot #'+options.id+': Canceled offer: No trusted SteamID.'); } }); } }); } module.exports = Bot; app.js var Bot = require('./bot.js'); var config = require('./config.json'); var bots = []; var x = 0; var loopArray = function(arr) { startBot(arr[x],function(){ x++; if(x < arr.length) { loopArray(arr); } }); } function startBot(options,loggedIn) { console.log("Starting Bot "+options.id); var bot = new Bot(options, ()=>{ bots.push(bot); loggedIn(); }); } loopArray(config); I hope someone can help me ^^ Thank you in advance for any answers! -degs
  18. Hello guys I don't know how to create new bot and anyone can help me and sent me Created bot? please very evry please if anyone can upload any wbesite and give me bot :\ (I know how to use itBut don't know how to create on github)
  19. hi Doc! i'm calling steamcommunity.acceptConfirmationForObject with the offer id and getting a 429 back. i'm also running steamcommunity.startConfirmationChecker but on a slow schedule (once every 2 minutes) - this is to catch any possibly failed confirmations. the code works in a debug environment, the 429 is only in production (not surprisingly). the weird thing is that all outstanding confirmations go through when the automatic confirmation checker runs, just not the acceptConfirmationForObject call which return 429s every time. i'm using steam-tradeoffers.makeOffer to create the offers and then call acceptConfirmationForObject in makeOffer's callback is it possible that the problem is both calls are made to the web api too quickly? should i put the acceptConfirmationForObject on a timeout? any ideas welcome! ~bp
  20. I have small dilema on my new bot what I am making. I have this communication between jackpot server and bot by REST API: Steam new incoming offer -> bot -> resend to jackpot server for validation -> jackpot server answers accept/decline -> if accept bot send to jackpot accepted offer object -> jackpot server do his work "if accept bot send to jackpot accepted offer object" - Here I have dilema.. Wait for accept callback, or use receivedOfferChanged event to get callback? I know waiting for callback is littlebit faster but is it 100% correct? Will it catch always? Same question for receivedOfferChanged. Thanks for help or suggestion how you guys (or Meredith McKey xD) do this kind of bot.
  21. My Json file looks like this: {"TotalItemsTraded": {"TotalKeys": 0} } Json is called: 'TotalSold.json' How can I update it's value? I'm trying to add an integer to 'TotalKeys' (Another function is calculating everything and im just trying to update the json file value)
  22. Using node-steam-user + node-steamcommunity + node-steam-tradeoffer-manager. At some point this happening: Calling getUserDetails is returning Not logged in. steamCommuniti'es loggedIn returns true, bot is still polling offers and gets new offers, but even after webLogOn cant make getUserDetails reqeust. What can be a problem?
  23. 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
  24. Hi guys im creator Steam Smart Bot probably first Smart bot on steam check http://steamcommunity.com/profiles/76561198428565112/
×
×
  • Create New...