Beispiel #1
0
        public static List <Abdiv> DispatcherAbdiv(string id)
        {
            List <Abdiv> newAbdivsList = new List <Abdiv>();

            foreach (Abdiv abdiv in SearchAbdiv(id))
            {
                Abdiv newAbdiv = new Abdiv();
                newAbdiv.Image   = abdiv.Image;
                newAbdiv.Id      = abdiv.Id;
                newAbdiv.Explore = true;
                Rectangle rect = Template.Image(new ImageData(abdiv.Image), new ImageData("Images/minus.bmp"));
                if (rect.Location.X > 0)
                {
                    BotFunc.AddLog("Сканирование:" + abdiv.Id + " плохой сундук #1");
                    newAbdiv.Explore = false;
                }
                rect = Template.Image(new ImageData(abdiv.Image), new ImageData("Images/nol.bmp"));
                if (rect.Location.X > 0)
                {
                    BotFunc.AddLog("Сканирование:" + abdiv.Id + " плохой сундук #2");
                    newAbdiv.Explore = false;
                }
                newAbdivsList.Add(newAbdiv);
            }
            return(newAbdivsList);
        }
Beispiel #2
0
        public static List <Abdiv> SearchAbdiv(string id)
        {
            List <Abdiv> tempAbdivsList    = new List <Abdiv>();
            string       AttackMobResponse =
                Requests.GetResponseHtml("http://atlantida-o.ru/attack.php?bot=" + id + "&0." +
                                         BotFunc.GetRandomNumbers(16));
            string PatternAbdiv = @"url\((.*?)\)";
            Regex  SearchAbdiv  = new Regex(PatternAbdiv);

            foreach (Match match in SearchAbdiv.Matches(AttackMobResponse))
            {
                Abdiv  abdiv       = new Abdiv();
                string url         = match.Groups[1].Value;
                Bitmap abdivBitmap = BotFunc.LoadPicture(BotBase.GameUrl + url);
                Regex  NumAbdiv    = new Regex(@"n=(\d)");
                int    num         = Convert.ToInt32(NumAbdiv.Match(url).Groups[1].Value);
                abdiv.Id      = num;
                abdiv.Image   = abdivBitmap;
                abdiv.Explore = true;
                tempAbdivsList.Add(abdiv);
            }
            return(tempAbdivsList);
        }