SteamBot
SteamBot copied to clipboard
Crafting still not working?
I've been trying to get crafting working for the past day or two, and nothing seems to be working.
Bot.GetInventory();
Bot.LaunchTF2();
try
{
foreach (var item in Bot.MyInventory.GetItemsByDefindex(5001))
{
Bot.log.Debug("Found rec... trying to craft...");
ulong[] rec = { item.Id };
TF2GC.Crafting.CraftItems(Bot, (short)TF2GC.ECraftingRecipe.SmeltReclaimed, rec);
}
}
catch
{
Bot.log.Error("Can't craft.");
}
Bot.ExitTF2();
Is what I have, and I can't understand why it isn't working.
Solved. The bot wasn't seeing itself as being in TF2. Just needed to add a Thread.Sleep() in.