Jump to content
McKay Development

apibot

Member
  • Posts

    29
  • Joined

  • Last visited

Posts posted by apibot

  1. After successful smelting/crafting, tf2.backpack is not getting updated. 

    let scraps = inventory.filter(item => item.name == "Scrap Metal")
    let recs = inventory.filter(item => item.name == "Reclaimed Metal")
    //I have to use inventory from getInventoryContents because tf.backpack is not updated
    
    if (scraps.length > 12) {
    	let craft = Math.floor((scraps.length - 12) / 3)
    
    	for (let i = craft; i > 0; i--) tf.craft(scraps.slice(0, 3))
    }

    also this only craft 1 reclaimed

  2. My bot listens for sentOfferChanged event.
    Sometimes an offer is accepted, it fires with the state: 3.
    Then after a few seconds, sentOfferChanged fires again with the same offer but now with state: 9, and fires the same offer with state: 3 again. Causing some issues in my end since I rely on state: 3 when deducting credits from user's balance.

  3. community.getMarketItem(753, "753-Sack of Gems", (error, key) => {
          if (error) return console.log(error)
          setTimeout(() => {
            key.updatePrice((error) => {
              if (error) return console.log(error)
              console.log(key.lowestPrice)
            })
          }, 1000 * 15)
        })
    community.getMarketItem(753, "753-Sack of Gems", (error, key) => {
          if (error) return console.log(error)
          setTimeout(() => {
            key.updatePrice()
            console.log(key.lowestPrice)
          }, 1000 * 15)
        })

    both throw "TypeError: callback is not a function" error

    node_modules/steamcommunity/classes/CMarketItem.js:113:4

  4. I am using community.httpRequestGet to fetch Mann Co. Supply Crate Key and Sack of Gems for prices via "https://steamcommunity.com/market/priceoverview/" link and everything's doing great.

    Any advice to avoid rate-limits and possible ban? I am planning to use it regularly say, less than a hundred request per "hour" for other items. 

  5. On 1/28/2022 at 3:43 PM, Dr. McKay said:

    This is not the best way to make sure you have the correct item IDs when crafting items. Just use node-tf2's backpack property, which contains an always-up-to-date copy of your backpack. To find metal, just check the defindexes. If memory serves, 5000 is scrap metal, 5001 is reclaimed, and 5002 is refined.

    just got back. tried it your way and it is so much better and effective. thanks!

  6. My bot automatically craft/smelt metals according to my bot's stock

    flow:

    gamesPlayed(440) if haveGCSession is false > wait for connectedToGC to fire > craft > wait for craftingComplete to fire > gamesPlayed() to exit tf2 > reload inventory.

     

    Sometimes it completes the flow but I am stucked with the same number of metals. Sometimes it is stucked waiting for craftingComplete to be emitted. Sometimes it is successful especially when I restart my bot. Yes, I load my inventory via getInventoryContents everytime before crafting to make sure I have the correct item.ids. 


     

  7. On 10/27/2021 at 1:52 PM, Dr. McKay said:

    The first argument to the webSession callback is sessionID, not cookies. My guess would be that you have a handler for SteamCommunity's sessionExpired event that calls client.webLogOn(), which it's continually doing because it never receives valid cookies.

    that's exactly what it was

  8. 
    client.on("webSession", set_cookies)
    client.on("loggedOn", online)
    
      
    function online() {
      log("logged on")
    }
    function set_cookies(cookies) {
      log("cookies set")
      community.setCookies(cookies);
    }
    


    24 Oct 14:28:58 - test: logged on
    24 Oct 14:28:59 - test: cookies set
    24 Oct 14:29:01 - test: cookies set
    24 Oct 14:29:04 - test: cookies set
    24 Oct 14:29:08 - test: cookies set
    24 Oct 14:29:17 - test: cookies set

  9. On 2/22/2020 at 7:12 AM, HelloWorld said:

    How do I get the direct detection of the bot when I change the content of the /message file.  I do not want to close and open the bot and enter the guard code.

    is your /message file a .json or .js.

    Listen for file changes, it it's a .json you can just re-require it. I'm not sure if it works with .js file.

  10. On 6/3/2021 at 2:26 PM, tf2forever said:

    I only get the error when the "clanid" is a number, probably because it doesn't pass the if statement which turns it into a steamID object.

    When "clanid" is a string, I don't get an error but it doesn't comment.

     

    Edit:

    config.clanid doesn't turn up as undefined.

    I'm suspecting that somewhere in your code, clanid gets manipulated like parsing it as an integer.

    Know that:

    parseInt(103582791470169702) != 103582791470169702

    parseInt("103582791470169702") != "103582791470169702"

    parseInt(103582791470169702) == parseInt(103582791470169702)

     

  11. is there a way to determine if the item is non-craftable or not using node-tf2 or inventories from trade-offer-manager?

    I guess I found it. Is it safe to assume the "not usable in crafting" in descriptions?

  12. So, my bot cancels trade-offers after 30 minutes(now set to two hours).

    How do I check if the trade is already being accepted but not fully processed yet(for large trades like buying sets of cards).

    Yesterday, my bot cancelled a trade that was already accepted but not marked as accepted yet bc it consists atleast 300 or more cards and it usually takes a few minutes to process. It ended with some of my cards missing and my client's keys are missing too. I checked my bot's inventory history(not trade history) and it showed that some of the cards were traded, just traded without a name to whom it was traded to. 

    Possible workaround is to remove automatic cancellation of trades

  13. On 12/22/2020 at 2:46 PM, Dr. McKay said:

    You would need to also bind the local address on node-steamcommunity and additionally pass that community instance to the steam-tradeoffer-manager instance in the constructor.

    Client is for polling and community for requests, right?

  14. Hi, i have a server with 5 public IPs,

    1 for pihole dns/vpn

    1 for my tradebot

    and the rest for other stuffs

     

    now, I use all three packages(user-tradeoffer-community) in my tradebot, and as I read in doc for user and community that you can pass a local address.

    If I pass one of my public ip(the one intended for tradebot) to my bot instance, will it use the IP too in trade-offer-manager requests? I'm passing steam-user instance to trade-offer-manager constructor.

    If I decided to host other people's bot using my extra public IPs, are the requests separate from each ip? Talking about rate-limits

  15. if I decided to make a counter-offer and call getPartnerInventoryContents, do I get inventory contents without the items in offer window?

    example scenario would be, in his offer window he placed 1000 steam gems and he got 1200 steam gems total, if I loop his steam inventory which is retrieved from getPartnerInventoryContents, will i get amount as 1200 or 200?

×
×
  • Create New...