Jump to content
McKay Development

craftingComplete sometimes not firing


apibot

Recommended Posts

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. 


 

Link to comment
Share on other sites

4 hours ago, apibot said:

Yes, I load my inventory via getInventoryContents everytime before crafting to make sure I have the correct item.ids. 

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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...