Jump to content
McKay Development

vrtgn

Member
  • Content Count

    17
  • Joined

  • Last visited

Recent Profile Visitors

53 profile views
  1. community.on('sessionExpired', function(err) { client.webLogOn(); //relogin to Steam or refresh tradeoffer-manager cookies })
  2. You aren't friends with the other user and you didn't provide a trade token The provided trade token was wrong You are trying to send or receive an item for a game in which you or the other user can't trade (e.g. due to a VAC ban) You are trying to send an item and the other user's inventory is full for that game
  3. Your webSession must have expired. community.on('sessionExpired', function(err) { client.webLogOn(); //relogin to Steam or refresh tradeoffer-manager cookies })
  4. if (message.includes("[tradeoffer")) { return } Put this before your switch case.
  5. Adding to doc's answer, you may find this of use, with regards to where to extract the details from - created by Nicklason.
  6. vrtgn

    Sell items

    What is your code? / What are you attempting? Have you checked typos? Do you know what a error 400 response is? Although there is not much documentation, these things can easily be searched up which is fundamental for a coder. Quick google search got me these links which might be of help to you: NPM module for selling items on steam (cannot guarantee its trust - use at your own risk) Steam Community Discussion (steam community discussion about the api) SCMBot (again whether this is trustworthy or not, i can't guarantee, use at your own risk)
  7. Working out change is similar to the popular coin change problem, except you don't have infinite amount of each coin. Here's how I would do it: Convert the price to scrap. Then using the coin change problem work out the least amount of scrap needed. In this case your coins would be 1, 3, 9, and key price in scrap being scrap, rec, ref and key price in scrap respectively. Look up the coin change problem and develop a function to work out the change. It's hard but also good to develop your coding skills. I wouldn't recommend to steal someone else's code since you don't know what it's doing and at the end of the day if your bot gets scammed it is your fault for not knowing how your code works.
  8. Like I said before, what are you trying to achieve? Are you trying to simulate the friendMessage event?
  9. Maintaining many npm packages is hard. If you want it to be solved, try making your own solution.
  10. That's almost impossible, unless you have a very unique name. The reason it wouldn't work is because anyone can have the same username as anyone else. Unless you're talking about the login username. I don't think you can, because that's hidden from everyone apart from the owner of the account itself.
  11. I'm not so sure about what you're trying to achieve or how you can handle multiple events. To send an event is called 'emitting'. So you can do: this.emit('event-name', event-params) What are you making and what are you trying to achieve? Give some more description. Learn more about events here.
  12. How and where are your prices/items that you are buying or selling stored? If there in a JSON file, I would add a `maxStock` and `currentStock` in the file, so it would look something like this: "Team Captain": { "buy": ... ... "maxStock": 3, "currentStock" 1 } Then, in your process function: let amountInTrade = {} for (var i = 0; i < theirItemsNames.length; i++) { amountInTrade[theirItemsNames[i]].amount = (amountInTrade[theirItemsNames[i]] ? amountInTrade[theirItemsNames[i]] + 1 : 1) } ... if (prices[itemName].currentStock + amountInTrade[itemName] <= prices[itemName].maxStock) { // if the amount they are giving plus how much we have is smaller than or equal to maxStock // accept the offer } else { // decline }
  13. thanks for your quick reply so like this? function getID(itemname, callback) { manager.getInventoryContents(440, 2 , true, function(err, inventory) { if (err) { console.log(err) return; } else { //console.log(inventory); for (var i = 0; i < inventory.length; i++) { if (inventory.market_hash_name === itemname) { callback(inventory.id); return; } } } }) when calling :getID("The Diamondback", function logID(id) {//do something with id})
×
×
  • Create New...