Jump to content
McKay Development

Search the Community

Showing results for tags 'Question'.

  • 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. The first time you log in to your account for some reason turns on Steam-Guard. Why is this happening and can it be avoided ?I'd like to keep my account unprotected.
  2. How can i make my bot join a tf2 community server?
  3. Is it possible to family share in this library?
  4. I've been working on TF2 trade bot over the past days and as I got close to a solution for a buy/sell command, I ran into an issue. How can I calculate the amount of metal to add to a trade offer? I had a function that found the refined, reclaimed and scrap metal in a users inventory. The same way I find the keys in the bot's inventory. I had the bot calculate the key price in metal and split it up so it new what to add. However, the bot would only add specific items to do a successful trade. Meaning that if the key price was 32.22, it would add 32 ref and 2 scrap to the trade offer. But if the user dosen't have the exact amount of refined/scrap. Example, lets say they have 31 refined, 3 reclaimed and 2 scrap, (32.22 ref in total) it would cancel (return true). This function is not in the code below since I scrapped it. So I'm looking for a way that the bot can find the users metal from their inventory with getUserInventoryContents and then add the right amount of metal to the trade offer, regardless of a specific item count. As long as the users total metal count meets the key buy price in metal. If anyone can help me or come with suggetions on what I could do, I would be thankful! Below is my buy command with the matching function: //Command for buying keys client.on('friendMessage', function(steamID, message) { //If the message meets the requirements. var buyKeysCmd; if(buyKeysCmd = message.match(/^!buy (\d+)/i)) { var keysToBuy = buyKeysCmd[1]; if(keysToBuy > 0) { buyKeys(steamID, keysToBuy); client.chatMessage(steamID, 'Processing your request.'); } else { client.chatMessage(steamID, 'You can\'t buy 0 keys.'); } } }); //Function used to buy keys with metal function buyKeys(steamID, keysToBuy) { //No specific amount of keys to buy, cancel if(!keysToBuy) { return true; } //How many keys we've in our TF2 inventory var ourKeys = []; //How much the amount of keys will cost in metal. var priceInMetal = config.trading.buyKey * keysToBuy; //Display the request. console.log('User: ' + steamID + ' has requested to buy ' + keysToBuy + ' key(s) for ' + priceInMetal + ' metal.'); //Load our TF2 inventory manager.getInventoryContents(config.bot.gameID, 2, true, function(err, inventory) { if(err) { console.log('Error getting our inventory: ' + err); client.chatMessage(steamID, 'I encountered an error getting my inventory, please try again later.'); } else { //Go trough our inventory and search for accepted keys for(var n = 0; n < inventory.length; n++) { if(ourKeys.length < keysToBuy && config.acceptedKeys.indexOf(inventory[n].market_hash_name) >= 0) { ourKeys.push(inventory[n]); } } //We don't have any keys if(ourKeys.length === 0) { client.chatMessage(steamID, 'I don\'t have any keys. Please ask an admin to re-stock or wait for me to sell some keys.'); return true; //The user has requested to buy more keys than our current stock. } else if(keysToBuy > ourKeys.length) { console.log('I don\'t have ' + keysToBuy + ' key(s).'); client.chatMessage(steamID, 'I don\'t have ' + keysToBuy + ' key(s).'); return true; } //If we've the requested amount of keys console.log('Adding ' + ourKeys.length + ' key(s) to the trade offer.'); //Load their inventory manager.getUserInventoryContents(steamID, config.bot.gameID, 2, true, function(err, inventory) { if(err) { console.log('Error getting their inventory: ' + err); client.chatMessage(steamID, "An error occurred while loading your inventory. Please again try later."); } else { //This is where the users inventory is loaded //The bot should look trough the users tf2 inventory //Find the users refined metal, reclaimed metal and scrap metal //Add it all together and log it //If the user has enough metal to purchase the requested amount of keys, continue //The bot can now add the metal to the trade offer below. var offer = manager.createOffer(steamID); //Setup the trade details. offer.addMyItems(ourKeys); //offer.addTheirItems(their metal for buying x amount of keys); offer.setMessage('You\'re buying ' + ourKeys.length + ' key(s) for ' + priceInMetal); offer.send(function(err, status) { if(err) { console.log('Error sending the trade offer: ' + err); client.chatMessage(steamID, 'Something went wrong. There was an error sending you the trade offer, please contact support if this continues.'); } else if(status == 'pending') { console.log(`Trade offer #${offer.id} is validated, but awaiting confirmation.`); client.chatMessage(steamID, 'The trade offer is validated, but awaiting confirmation.'); community.acceptConfirmationForObject(config.account.identitySecret, offer.id, function(err) { if(err) { console.log('Error confirming trade offer: ' + offer.id); client.chatMessage(steamID, 'Error confirming trade offer, declining.'); offer.decline(); } else { console.log(`Trade offer #${offer.id} confirmed.`); client.chatMessage(steamID, 'The trade offer was sent successfully. You can accept it here: http://steamcommunity.com/tradeoffer/' + offer.id); } }); } }); } }); } }); }
  5. manager.loadUserInventory(steamID,753,2,true,(err,inventory,currencies) => {}) I get "Malformed response" error everytime i try to get the steam inventory and im %100 sure im logged in. I tried same code and getting tf2 and csgo inventories there is no error and i can get inventory successfully but when i try to get steam inventory i always get "Malformed response" error Any Idea how can i fix this ?
  6. Hi, I'm trying to get a user's nickname. I know I'm supposed to use getUserDetails and then getPersonas, but what's the nickname property called?
  7. I've making my bot and I need to check item market hash name within trade offer, but in offer.itemsToGive and offer.itemsToReceive contains only following information: EconItem { appid: 730, contextid: '2', assetid: '13984115215', classid: '310777179', instanceid: '302028390', amount: 1, missing: false, est_usd: '1', id: '13984115215', fraudwarnings: [], descriptions: [], owner_descriptions: [], actions: [], owner_actions: [], market_actions: [], tags: [], tradable: false, marketable: false, commodity: false, market_tradable_restriction: 0, market_marketable_restriction: 0 } So my question is: How to get market_hash_name?
  8. Are there any typescript definitions for this, or is anybody working on it?
  9. let offer = manager.createOffer(steamID); offer.addTheirItems(itemArray); offer.setMessage("Beni kullandığınız için teşekkürler / Thanks for using me") offer.send((err,status) => { }) How can i get a message when the offer successfully accepted?
  10. Hi, My bot has been working just fine up until yesterday - When it started going offline a few minutes after launch. I checked the console, and it's not an error on my part, but it says on the console "Killed" My guess is, the connection is either Killed by Valve (maybe because I send too many requests to their API?) or someone is ddosing/attacking my bot Here's a screenshot https://gyazo.com/9a73153c59359b6befddd9ce9d3a63e8 It takes more than a minute for it to shut down. Important Notes: I'm hosting my bot on DigitalOcean, and using an SSH connection using putty.
  11. Hi! Can you explain few of friend relationship statuses in details?https://github.com/DoctorMcKay/node-steam-user/blob/master/enums/EFriendRelationship.js I can`t understand what are: "Blocked", "IgnoredFriend", "SuggestedFriend" and "Max"
  12. I've cookies array like this: [ 'sessionid=7030e64a53d6f7860bc69038', 'steamLogin=76561198447561491%7c%7c3B5AF02B12EC2F367974917BC090EB7F0E6B3B91', 'steamLoginSecure=76561198447561491%7c%7c1CC92BDD67243C7E761681E40E3B8419416AA858' ]I get an error "not logged in" when I try to log in trade offer manager through cookies using setCookies method. I take cookies a minute before using setCookies method Can someone explain why i get an error?
  13. Hi, I'd like to get the lowest price of a Background/Emoteicon on the market. I already figured out how to do that, but for some reason this will ONLY work for anything but Steam items.. Code https://pastebin.com/ujkfYLLa Also, what's the optimal frequency to use this function? Just so I don't spam it too hard.
  14. Hello, What is `version` in `json_tradeoffer` from form of tradeoffer? `node-steam-tradeoffer-manager` have set on 4 (https://github.com/DoctorMcKay/node-steam-tradeoffer-manager/blob/master/lib/classes/TradeOffer.js#L297). I checked it while sending offers on steam. If I sent item for friend, `version` is equeal 2, but If I sent offer "item for item" and "nothing for their item", `version` is equeal 3. Any ideas?
  15. Hi, I'm trying to add Full Card Sets in a trade offer. Say, the command to request card sets is !set 10, the bot will send 10 Full Card Sets. I'm not sure how to tell the bot how many Cards make a Full Set. Would I need to use an API or some sort of a database with all the existing sets? I would appreciate any help, thank you!
  16. My script is an adaptation of examples but stopped randomly once with no input. How do I stop this?
  17. How can i get Account id in uint32?
  18. Hi, Thanks for making your node modules open source Doctor Mckay. I'm interested in making a tf2 trade bot. I searched the internet and your api was the only one which allowed the bot to trade ingame. I'm interested in making a bot like this but in python. I looked through the source of tf2 module and I'm having a hard time understanding what some things do. I don't have much experience in javascript or programming bots in general. Could you explain what the Game Controller is and what the protobuf things are doing. I searched online about the TF2 game controller and I didn't find any documentation. Could you link me to some sources to learn more about the game controller and how to control a bot that is ingame? Thanks, Benscar1
  19. I get this error every so often, I don't know where it's coming from so I don't know how to log in once it happens. This isn't part of the sessionExpired event, as I have this in my code: community.on("sessionExpired", function(err) { console.log("## Session Expired, relogging."); client.logOn(logOnOptions); }); help?
  20. Sup guys. I've been getting this error every once in a while when trying to confirm a trade: ``` 14|trade | Error: Could not act on confirmation 14|trade | at /root/tradingbot/node_modules/steamcommunity/components/confirmations.js:145:12 14|trade | at SteamCommunity.<anonymous> (/root/tradingbot/node_modules/steamcommunity/components/confirmations.js:276:3) 14|trade | at Request._callback (/root/tradingbot/node_modules/steamcommunity/components/http.js:67:15) 14|trade | at Request.self.callback (/root/tradingbot/node_modules/request/request.js:186:22) 14|trade | at emitTwo (events.js:125:13) 14|trade | at Request.emit (events.js:213:7) 14|trade | at Request.<anonymous> (/root/tradingbot/node_modules/request/request.js:1163:10) 14|trade | at emitOne (events.js:115:13) 14|trade | at Request.emit (events.js:210:7) 14|trade | at IncomingMessage.<anonymous> (/root/tradingbot/node_modules/request/request.js:1085:12) ``` Here is my code (it's monstrously horrendous. Ive cut too many corners to neaten it): ```js acceptOffer(offer) { return new Promise((resolve, reject) => { offer.accept((err, status) => { if (err) { if (err.message == 'Not Logged In') { this.once('managerCookies', () => { this.acceptOffer(offer) }) return } return reject(err) } this.manager.once('receivedOfferChanged', (offer, oldState) => { if (offer.state == 3) { this.pushBullet.note('Trade Offer Accepted:', `Giving: \n${offer.itemsToGive.map(item => item.market_hash_name).join('\n')} \nReceiving: \n${offer.itemsToReceive.map(item => item.market_hash_name).join('\n')}`) offer.getReceivedItems((err, items) => { this.emit('debug', 'Accepted trade offer') this.emit('debug', 'Updating inventory cache') this.backpack.loadBptfInventory() .then(() => { this.emit('debug', 'Loaded BPTF inventory') for (let item of items) { if (this.prices[item.market_hash_name]) { if (!this.prices[item.market_hash_name].isCurrency) { this.emit('debug', 'Attempting to list the item') this.backpack.createSellListing(item.id, this.backpack.scrapToRef(this.prices[item.market_hash_name].sell)) .then(res => { if (res.listings[item.id].created == 1) { this.emit('debug', 'Created Listing') } else { this.emit('debug', 'Error creating listing') } }) .catch(err => { this.emit('debug', err) }) } } } }) .catch(err => { this.emit('debug', 'Error loading my bptf Inventory...') this.emit('debug', err) }) //should do error handling here. }) return resolve(true) } }) this.community.acceptConfirmationForObject(this.logOnOptions.identitySecret, offer.id, err => { if (err) { return reject(err) } }) }) }) } ```
  21. Hi, is it possible to convert background/emotes into gems with a bot? Basically, I want the bot to scan it's inventory once a trade is completed, find Backgrounds/Emotes worth 20+ Gems and turn them into Gems. Is it possible to do?
  22. Hey, I've created a bot and when I write to him !sell [item], he displays me how much i need to pay and creates a offer - with the item and his payment. The problem is it sometimes sends me the payment and I shouldn't give him anything. I've checked it with itemsToGive ItemsToRecieve and it didn't work. Then I saw the isGlitched() method but everytime the bot sends a trade, it shows that it's glitched although sometimes it isn't..
  23. How to create script for auto remove friend after week :/ Thanks
  24. I need help with receivedOfferChanged. It don't receive offer.id and status. Below is my code and output from console. var botsManager = new BotManager(); botsManager.on('receivedOfferChanged', function(offer, oldState) { console.log('--> STATUS ' + offer.id + ':' + offer.tradeID + ': (OLD:' + oldState + ') TO (NEW:' + offer.state + ')'); }); Output: --> STATUS undefined:undefined: (OLD:[object Object]) TO (NEW:undefined)
×
×
  • Create New...