public override void OnLoginCompleted() { List <Inventory.Item> itemsToTrade = new List <Inventory.Item>(); // Must get inventory here Log.Info("Getting Inventory"); Bot.GetInventory(); // Optional Crafting if (AutoCraftWeps) { AutoCraftAll(); } if (ManageCrates) { DeleteSelectedCrates(DeleteCrates); // One more break before updating inventory Thread.Sleep(500); Bot.GetInventory(); itemsToTrade = GetTradeItems(Bot.MyInventory, TransferCrates); } else { itemsToTrade = GetTradeItems(Bot.MyInventory, 0); } if (!BotItemMap.ContainsKey(mySteamID)) { BotItemMap.Add(mySteamID, itemsToTrade); Admins.Add(mySteamID); } Log.Info("[Giving] " + Bot.DisplayName + " checking in. " + BotItemMap.Count + " of " + NumberOfBots + " Bots."); if (!Bot.MyInventory.IsFreeToPlay()) { if (BotItemMap[mySteamID].Count > 0) { TradeReadyBots.Add(mySteamID); Log.Info(Bot.DisplayName + " has items. Added to list." + TradeReadyBots.Count + " Bots waiting to trade."); } else { Log.Warn(Bot.DisplayName + " did not have an item to trade."); Log.Warn("Stopping bot."); Bot.StopBot(); } } else { // Requires more info on f2p item characteristics. Log.Warn(Bot.DisplayName + " is free to play. F2P trading is not configured yet."); Bot.StopBot(); } }
public override void OnLoginCompleted() { if (!BotItemMap.ContainsKey(mySteamID)) { // Adding for complete attendance of all active bots, no need for inventory. BotItemMap.Add(mySteamID, null); Admins.Add(mySteamID); } Log.Info("[Main] SteamID: " + mySteamID + " checking in."); MainUHIsRunning = true; MainSID = Bot.SteamUser.SteamID; }
public override void OnLoginCompleted() { List <Inventory.Item> itemsToTrade = new List <Inventory.Item>(); // Optional Crafting if (AutoCraftWeps) { AutoCraftAll(); // Inventory must be up-to-date before trade Thread.Sleep(300); } // Must get inventory here Log.Info("Getting Inventory"); Bot.GetInventory(); if (ManageCrates) { Bot.SetGamePlaying(440); DeleteSelectedCrates(DeleteCrates); Bot.SetGamePlaying(0); } itemsToTrade = GetTradeItems(Bot.MyInventory, 0); if (!BotItemMap.ContainsKey(mySteamID)) { BotItemMap.Add(mySteamID, itemsToTrade); Admins.Add(mySteamID); } Log.Info("[Crate] " + Bot.DisplayName + " checking in. " + BotItemMap.Count + " of " + NumberOfBots + " Bots."); CrateUHIsRunning = true; if (BotItemMap[mySteamID].Count > 0) { Log.Info(Bot.DisplayName + " has items. Added to list." + TradeReadyBots.Count + " Bots waiting to trade."); } else { Log.Warn(Bot.DisplayName + " did not have an item to trade."); } Log.Info("Waiting for Receiving to finish."); }
public override void OnLoginCompleted() { if (!BotItemMap.ContainsKey(mySteamID)) { // Adding for complete attendance of all active bots, no need for inventory. BotItemMap.Add(mySteamID, null); Admins.Add(mySteamID); } Log.Info("[Receiving] SteamID: " + mySteamID + " checking in."); switch (BotMode) { case (int)Actions.DoNothing: Log.Info("Bot Mode DoNothing Loaded. Commencing the doing of nothing. (Use commands for custom actions)"); break; case (int)Actions.NormalHarvest: Log.Info("Bot Mode NormalHarvest Loaded. Starting sequence..."); BeginHarvesting(); break; case (int)Actions.CrateManager: Log.Info("Bot Mode CrateManager Loaded. Managing crates..."); if (ManageCrates) { DeleteSelectedCrates(DeleteCrates); if (CrateUHIsRunning) { Log.Info("Sending Crates to CUH"); BeginNextTrade(CrateSID); } else { Log.Error("CrateUserHandler not found, cannot handle crates."); } } break; default: Log.Warn("Unkown Bot Mode Loaded: " + BotMode); Log.Warn("Doing nothing instead..."); break; } }