private static void Attack() { do { BotCore.Delay(1500); VCBotScript.image = BotCore.ImageCapture(); }while (BotCore.RGBComparer(VCBotScript.image, new Point(400, 400), Color.Black, 10)); Variables.ScriptLog("Running stage!", Color.Lime); int error = 0; do { Random rnd = new Random(); VCBotScript.image = BotCore.ImageCapture(); var crop = BotCore.CropImage(VCBotScript.image, new Point(420, 360), new Point(855, 430)); Point?buttons = BotCore.FindImage(crop, Img.GreenButton, false); if (buttons != null) { ArchwitchEvent.CheckWalkEnergy(); if (ArchwitchEvent.CurrentWalkEnergy < 15) { //No energy Variables.ScriptLog("SoulWeapon Event have no energy. Exiting now! ", Color.Yellow); return; } BotCore.SendTap(buttons.Value.X + rnd.Next(430, 845), buttons.Value.Y + rnd.Next(370, 420)); BotCore.Delay(2000, 3000); continue; } buttons = BotCore.FindImage(VCBotScript.image, Img.Return, true); if (buttons != null) { BotCore.SendTap(buttons.Value); BotCore.Delay(1000, 1500); continue; } buttons = BotCore.FindImage(VCBotScript.image, Img.Close2, true); if (buttons != null) { BotCore.SendTap(buttons.Value); BotCore.Delay(1000, 1500); continue; } buttons = BotCore.FindImage(crop, Img.Red_Button, false); if (buttons != null) { ArchwitchEvent.CheckBossEnergy(); if (ArchwitchEvent.CurrentBossEnergy == 0) { Variables.ScriptLog("SoulWeapon Event have no energy. Exiting now! ", Color.Yellow); return; } BotCore.SendTap(buttons.Value.X + rnd.Next(430, 845), buttons.Value.Y + rnd.Next(370, 420)); BotCore.Delay(2000, 3000); PrivateVariable.Battling = true; VCBotScript.Battle(); continue; } buttons = BotCore.FindImage(VCBotScript.image, Img.ShopKeeper, true); if (buttons != null) { BotCore.SendTap(530, 660); BotCore.Delay(1500); continue; } if (BotCore.FindImage(VCBotScript.image, Img.SoulWeapon, true) != null) { //Stage completed return; } error++; if (error > 30) { BotCore.Decompress(VCBotScript.image).Save("Profiles\\Logs\\error.png"); UnhandledException = true; Variables.ScriptLog("Unhandled exception. Contact PoH98 for fix!", Color.Red); return; } else { BotCore.Delay(1000, 1500); } }while (true); }
private static void Attack() { do { BotCore.Delay(1500); VCBotScript.image = Screenshot.ImageCapture(); }while (BotCore.RGBComparer(new Point(400, 400), Color.Black, 10, VCBotScript.image)); Variables.ScriptLog("Running stage!", Color.Lime); int error = 0; do { Random rnd = new Random(); VCBotScript.image = Screenshot.ImageCapture(); var crop = Screenshot.CropImage(VCBotScript.image, new Point(420, 360), new Point(855, 450)); Point?buttons = BotCore.FindImage(crop, Img.GreenButton, false, 0.9); if (buttons != null) { ArchwitchEvent.CheckWalkEnergy(); if (ArchwitchEvent.CurrentWalkEnergy <= 15 || (ArchwitchEvent.CurrentBossEnergy <= 3 && ArchwitchEvent.FullBossEnergy > 0)) { //No energy Variables.ScriptLog("SoulWeapon Event have no energy. Exiting now! ", Color.Yellow); TimeSpan delay = new TimeSpan(0, ((ArchwitchEvent.FullWalkEnergy - ArchwitchEvent.CurrentWalkEnergy) * 5), 0); VCBotScript.nextOnline = DateTime.Now + delay; Variables.ScriptLog("Estimate online time is " + VCBotScript.nextOnline, Color.Lime); BotCore.KillGame(VCBotScript.game); BotCore.Delay(delay); PrivateVariable.Instance.InEventScreen = false; PrivateVariable.Instance.InMainScreen = false; PrivateVariable.Instance.Battling = false; PrivateVariable.Instance.InMap = false; ArchwitchEvent.CurrentBossEnergy = ArchwitchEvent.FullBossEnergy; ArchwitchEvent.CurrentWalkEnergy = ArchwitchEvent.FullWalkEnergy; BotCore.StartGame(VCBotScript.game + VCBotScript.activity); return; } BotCore.SendTap(buttons.Value.X + rnd.Next(430, 845), buttons.Value.Y + rnd.Next(370, 420)); BotCore.Delay(2000, 3000); continue; } buttons = BotCore.FindImage(VCBotScript.image, Img.Return, true, 0.9); if (buttons != null) { BotCore.SendTap(buttons.Value); BotCore.Delay(1000, 1500); continue; } buttons = BotCore.FindImage(VCBotScript.image, Img.Close2, true, 0.9); if (buttons != null) { BotCore.SendTap(buttons.Value); BotCore.Delay(1000, 1500); continue; } buttons = BotCore.FindImage(crop, Img.Red_Button, false, 0.87); if (buttons != null) { ArchwitchEvent.CheckBossEnergy(); BotCore.SendTap(buttons.Value.X + rnd.Next(430, 845), buttons.Value.Y + rnd.Next(370, 420)); BotCore.Delay(2000, 3000); PrivateVariable.Instance.Battling = true; VCBotScript.Battle(); continue; } buttons = BotCore.FindImage(VCBotScript.image, Img.ShopKeeper, true, 0.9); if (buttons != null) { BotCore.SendTap(770, 640); Variables.ScriptLog("Shop keeper found! Getting in and see what to buy!", Color.White); BotCore.Delay(3000); VCBotScript.image = Screenshot.ImageCapture(); if (BotCore.FindImage(VCBotScript.image, Img.MisteryBox, true, 0.9) != null) { Variables.ScriptLog("Mistory Box found! Purchasing all products!", Color.Lime); BotCore.Delay(10000); for (int x = 0; x < 3; x++) { switch (x) { case 0: Variables.ScriptLog("Purchasing First Item", Color.Wheat); BotCore.SendTap(1030, 220); break; case 1: Variables.ScriptLog("Purchasing Second Item", Color.Wheat); BotCore.SendTap(1030, 390); break; case 2: Variables.ScriptLog("Purchasing Third Item", Color.Wheat); BotCore.SendTap(1030, 550); break; } BotCore.Delay(3000); Point?greenButton; do { BotCore.SendTap(2, 2); BotCore.Delay(300); VCBotScript.image = Screenshot.ImageCapture(); greenButton = BotCore.FindImage(VCBotScript.image, Img.GreenButton, false, 0.9); }while (greenButton == null); BotCore.SendTap(greenButton.Value); for (int y = 0; y < 10; y++) { BotCore.SendTap(2, 2); BotCore.Delay(500); } BotCore.Delay(5000); } } BotCore.SendTap(1110, 875); BotCore.Delay(500); continue; } if (BotCore.FindImage(VCBotScript.image, Img.ArchwitchHunt, true, 0.9) != null) { //Stage completed return; } error++; if (error > 30) { Screenshot.Decompress(VCBotScript.image).Save("Profiles\\Logs\\error.png"); //UnhandledException = true; Variables.ScriptLog("Unhandled exception. Contact PoH98 for fix!", Color.Red); return; } else { BotCore.Delay(1000, 1500); } }while (true); }
private static void Attack() { do { BotCore.Delay(1500); VCBotScript.image = BotCore.ImageCapture(); }while (BotCore.RGBComparer(VCBotScript.image, new Point(400, 400), Color.Black, 10)); Variables.ScriptLog("Running stage!", Color.Lime); do { Variables.ScriptLog("Detecting UIs...", Color.White); Random rnd = new Random(); VCBotScript.image = BotCore.ImageCapture(); var crop = BotCore.CropImage(VCBotScript.image, new Point(420, 360), new Point(855, 430)); Point?buttons = BotCore.FindImage(crop, Img.GreenButton, false); if (buttons != null) { CheckWalkEnergy(); if (error > 10) { Variables.ScriptLog("Unable to OCR energy! Exiting Event now!", Color.Red); CurrentWalkEnergy = 0; } if (CurrentWalkEnergy < 15) { //No energy Variables.ScriptLog("Archwitch Event have no energy. Exiting now! ", Color.Yellow); return; } BotCore.SendTap(buttons.Value.X + rnd.Next(430, 845), buttons.Value.Y + rnd.Next(370, 420)); BotCore.Delay(2000, 3000); continue; } buttons = BotCore.FindImage(VCBotScript.image, Img.Close2, true); if (buttons != null) { VCBotScript.image = BotCore.ImageCapture(); if (BotCore.FindImage(VCBotScript.image, Img.NoEnergy, true) != null) { //Means we should kill it as no energy left Variables.ScriptLog("Archwitch Event have no energy. Exiting now! ", Color.Yellow); return; } BotCore.SendTap(buttons.Value); BotCore.Delay(1000, 1500); VCBotScript.image = BotCore.ImageCapture(); } crop = BotCore.CropImage(VCBotScript.image, new Point(665, 610), new Point(935, 685)); buttons = BotCore.FindImage(crop, Img.GreenButton, false); if (buttons != null) { BotCore.SendTap(buttons.Value.X + rnd.Next(675, 940), buttons.Value.Y + rnd.Next(620, 650)); BotCore.Delay(1000, 1500); continue; } crop = BotCore.CropImage(VCBotScript.image, new Point(665, 565), new Point(970, 640)); buttons = BotCore.FindImage(crop, Img.Red_Button, false); if (buttons != null) { BotCore.SendTap(buttons.Value.X + rnd.Next(675, 960), buttons.Value.Y + rnd.Next(575, 630)); BotCore.Delay(3000, 5000); do { BotCore.Delay(1500); VCBotScript.image = BotCore.ImageCapture(); }while (BotCore.RGBComparer(VCBotScript.image, new Point(400, 400), Color.Black, 10)); buttons = null; do { VCBotScript.image = BotCore.ImageCapture(); crop = BotCore.CropImage(VCBotScript.image, new Point(665, 565), new Point(970, 640)); buttons = BotCore.FindImage(crop, Img.Red_Button, false); if (buttons != null) { BotCore.SendTap(buttons.Value.X + rnd.Next(675, 960), buttons.Value.Y + rnd.Next(575, 630)); } crop = BotCore.CropImage(VCBotScript.image, new Point(420, 360), new Point(855, 430)); buttons = BotCore.FindImage(crop, Img.Red_Button, false); if (buttons != null) { CheckBossEnergy(); if (error > 10) { Variables.ScriptLog("Unable to OCR energy! Exiting Event now!", Color.Red); CurrentBossEnergy = 0; return; } CurrentBossEnergy--; BotCore.SendTap(buttons.Value.X + rnd.Next(430, 845), buttons.Value.Y + rnd.Next(370, 420)); BotCore.Delay(300, 500); BotCore.SendTap(buttons.Value.X + rnd.Next(430, 845), buttons.Value.Y + rnd.Next(370, 420)); BotCore.Delay(300, 500); BotCore.SendTap(buttons.Value.X + rnd.Next(430, 845), buttons.Value.Y + rnd.Next(370, 420)); BotCore.Delay(2000, 3000); break; } else { BotCore.Delay(1000, 1200); } }while (buttons == null); PrivateVariable.Battling = true; VCBotScript.Battle(); if (CurrentBossEnergy == 0) { Variables.ScriptLog("Archwitch Event have no energy. Exiting now! ", Color.Yellow); return; } } crop = BotCore.CropImage(VCBotScript.image, new Point(420, 360), new Point(855, 430)); buttons = BotCore.FindImage(crop, Img.Red_Button, false); if (buttons != null) { BotCore.SendTap(buttons.Value.X + rnd.Next(430, 845), buttons.Value.Y + rnd.Next(370, 420)); BotCore.Delay(2000, 3000); PrivateVariable.Battling = true; VCBotScript.Battle(); //End Event return; } BotCore.Delay(1000, 2000); BotCore.SendTap(635, 390); }while (true); }
//Guild wars private static void GuildWar(TimeSpan time) { var image = Screenshot.ImageCapture(); //Read energy var greenbutton = BotCore.FindImage(image, Img.GreenButton, false, 0.9); if (greenbutton != null) { BotCore.SendTap(greenbutton.Value); BotCore.Delay(1000); return; } VCBotScript.energy = VCBotScript.GetEnergy(); VCBotScript.runes = VCBotScript.GetRune(); if (VCBotScript.energy > 0) { if (time.Minutes < 50) { if (VCBotScript.energy < 5 && VCBotScript.runes > 3 && VCBotScript.runes < 6) { if (waittime == 0) { Variables.ScriptLog("Waiting Energy before Fever", Color.Yellow); } else if (waittime % 5 == 0) { BotCore.SendTap(797, 187); BotCore.Delay(5000); waittime = 0; } BotCore.Delay(5000); waittime++; return; } } PrivateVariable.Instance.Battling = true; var redbutton = BotCore.FindImage(image, Img.Red_Button, false, 0.9); if (redbutton != null) { BotCore.SendTap(redbutton.Value); int x = 0; do { if (BotCore.RGBComparer(new Point(247, 356), Color.Black, 10)) { break; } else { BotCore.Delay(1000); x++; } }while (x < 20); VCBotScript.Battle(); } } else { if (waittime == 0) { Variables.ScriptLog("Waiting Energy", Color.Yellow); } else if (waittime % 5 == 0) { Variables.ScriptLog("Refreshing Map", Color.Cyan); BotCore.SendTap(797, 187); BotCore.Delay(5000); waittime = 0; } BotCore.Delay(5000); waittime++; return; } }