public void AddTrader(bool isChecked, int delayed_launch) { if (isChecked) { if (Trader == null) { Trader = new AutoTrading(Cvrt.ToSeconds(2, 24) * 2, delayed_launch); Trader.AddSellingType(Trading.TAB_RESOURCES_4, 2); Trader.AddSellingType(Trading.TAB_BANQUET_8, null); Trader.AddSellingType(Trading.TAB_FOOD_7, null); Trader.AddTargets(7, 4, 6, 3, 5, 1, 2, 0, 9); commands.Add(Trader); } } else { if (Trader != null) { commands.Remove(Trader); Trader = null; } } }
public void Start() { Random rand = new Random(); List <BaseInstruction> list = new List <BaseInstruction>(); AutoTrading trader = new AutoTrading(Cvrt.ToSeconds(2, 24) * 2); AutoScout scout = new AutoScout(0, 100); AutoAttack attack = new AutoAttack(0, 100); attack.AddTarget(AIName.Rat, 0, 1); attack.AddTarget(AIName.Rat, 1, 1); attack.AddTarget(AIName.Rat, 2, 3); trader.AddSellingType(Trading.TAB_RESOURCES_4, 3); trader.AddSellingType(Trading.TAB_BANQUET_8, null); trader.AddSellingType(Trading.TAB_FOOD_7, null); trader.AddTargets(0); scout.AddTarget(Resource.Swords); scout.AddTarget(Resource.Stack); scout.AddTarget(Resource.Pitch); scout.AddTarget(Resource.Iron); scout.AddTarget(Resource.Catapults); scout.AddTarget(Resource.Bows); scout.AddTarget(Resource.Armor); scout.AddTarget(Resource.Pickes); scout.AddTarget(Resource.Wine); scout.AddTarget(Resource.Salt); scout.AddTarget(Resource.Spice); scout.AddTarget(Resource.Silk); scout.AddTarget(Resource.Venison); scout.AddTarget(Resource.Furniture); scout.AddTarget(Resource.Clothes); scout.AddTarget(Resource.MetalWare); scout.AddTarget(Resource.Fish); scout.AddTarget(Resource.Vegetables); scout.AddTarget(Resource.Ale); scout.AddTarget(Resource.Bread); scout.AddTarget(Resource.Meat); scout.AddTarget(Resource.Cheese); scout.AddTarget(Resource.Apples); scout.AddTarget(Resource.Stone); scout.AddTarget(Resource.Wood); //scout.ActivateCard(2, new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 19, 00, 00)); list.Add(scout); //list.Add(attack); //list.Add(trader); //list.Add(new Instruction<Coords, int>(ExecuteMode.EveryTime, Cvrt.ToSeconds(60, 0), Commands.ArmyBuy, Army.BUY_CATAPULT_1, 4)); while (true) { foreach (var item in list) { item.Execute(); } Commands.DoSomething(); Thread.Sleep(rand.Next(2000, 5000)); } }