public Order AcceptCustomer() { Log.AddMessage("Accepting order...", Log.LoggingLevel.Debug); //current ticket window needs to be empty! FlashAutomation.Click(171, 179); Order o; do { Bitmap screen = FlashAutomation.ScreenShot(); Bitmap orderPart = Order.GetOrderPart(screen); System.Threading.Thread.Sleep(100); o = new Order(orderPart); orderPart.Dispose(); screen.Dispose(); } while (!o.IsValid); ActiveSlot.Order = o; ActiveSlot.Used = true; Log.AddMessage("Wating for customer to shut up", Log.LoggingLevel.Debug); System.Threading.Thread.Sleep(3000); Log.AddMessage("Accepted new Order", Log.LoggingLevel.Debug); return o; }
void BuildBurger(Order o) { Log.AddMessage("Building burger...", Log.LoggingLevel.Debug); for(int i = 0;i < o.Ingredients.Length;i++) { Point loc = Point.Empty; switch (o.Ingredients[i]) { case Ingredient.BottomBun: loc = new Point(60, 400); break; case Ingredient.Cheese: loc = new Point(60, 360); break; case Ingredient.Pickle: loc = new Point(60, 300); break; case Ingredient.Onion: loc = new Point(60, 260); break; case Ingredient.Cabbage: loc = new Point(60, 210); break; case Ingredient.Tomato: loc = new Point(60, 160); break; case Ingredient.TopBun: loc = new Point(60, 110); break; case Ingredient.Ketchup: loc = new Point(445, 370); break; case Ingredient.Mustard: loc = new Point(500, 370); break; case Ingredient.Mayo: loc = new Point(550, 370); break; case Ingredient.BBQ: loc = new Point(600, 370); break; case Ingredient.RareMeat: loc = GetMeat(CookingDegrees.Rare); break; case Ingredient.MediumMeat: loc = GetMeat(CookingDegrees.Medium); break; case Ingredient.WellDoneMeat: loc = GetMeat(CookingDegrees.WellDone); break; } if (o.Ingredients[i] != Ingredient.None) { Log.AddMessage("Adding ingredient" + i + ":" + Enum.GetName(typeof (Ingredient), o.Ingredients[i]), Log.LoggingLevel.Debug); FlashAutomation.DragDrop(loc.X, loc.Y, 329, 100); System.Threading.Thread.Sleep(100); //condiments and meat need additional wait due to return and stack dropping animations if (o.Ingredients[i] != Ingredient.TopBun && i < 8) { if (o.Ingredients[i + 1] == Ingredient.Ketchup || o.Ingredients[i + 1] == Ingredient.Mayo || o.Ingredients[i + 1] == Ingredient.BBQ || o.Ingredients[i + 1] == Ingredient.Mustard) System.Threading.Thread.Sleep(500); } if ((o.Ingredients[i] == Ingredient.RareMeat || o.Ingredients[i] == Ingredient.MediumMeat || o.Ingredients[i] == Ingredient.WellDoneMeat) && (o.Ingredients[i+1] == Ingredient.RareMeat || o.Ingredients[i+1] == Ingredient.MediumMeat || o.Ingredients[i+1] == Ingredient.WellDoneMeat)) { System.Threading.Thread.Sleep(500); } } } System.Threading.Thread.Sleep(1000); Log.AddMessage("Burger built", Log.LoggingLevel.Debug); }