示例#1
0
        public bool che()
        {
            int loop = 1;

            // Mở bảng theo cấp mật bảo cần chế
            mAuto.clickImageByGroup("mat_bao", "tieudecapmatbao", false, false, 1, 20, -20 + (mCapMB * 25));

            // Click điểm an toàn
            mAuto.clickImageByGroup("mat_bao", "clickantoan");

            // Mở bảng theo loại mật bảo cần chế
            mAuto.clickImageByGroup("mat_bao", mLoaiMB);

            // Chế mật bảo
            //!mAuto.findImageByGroup("mat_bao", "hetluotche") &&
            while (loop <= Constant.MaxLoopQ)
            {
                // Click tự đặt nguyên liệu
                mAuto.clickImageByGroup("mat_bao", "tudongdatnguyenlieu");

                // Click chế tạo
                mAuto.clickImageByGroup("mat_bao", "chetaomatbao", false, false);

                // Click điểm an toàn
                mAuto.clickImageByGroup("mat_bao", "clickantoan");
                Thread.Sleep(2000);
                loop++;
            }

            return(true);
        }
示例#2
0
        /*
         * Function: doiNangNo
         * Description: Chạy Đổi Năng Nổ
         * Author: Tử La Lan - Facebook: https://www.facebook.com/Tu.La.Lan.NT
         * Created At: 2019-11-16 - Updated At: 2019-11-16
         */
        public bool doiNangNo(int level)
        {
            if (mLoaiNL == null)
            {
                mAuto.writeStatus("Phải chọn loại nguyên liệu để đổi");
                return(false);
            }

            string npc = "thuonghoitruongbbt";

            if (level == 4)
            {
                npc = "thuonghoitruongtlt";
            }

            if (mAuto.talkToNPC(npc))
            {
                // Click vào nhiệm vụ được trả hoặc chưa nhận
                mAuto.clickImageByGroup("global", "nvunangnochuanhan" + mLoaiNL);
                mAuto.clickImageByGroup("global", "nvunangnoduoctra" + mLoaiNL);

                // Click nhận nhiệm vụ và trả nhiệm vụ
                mAuto.clickImageByGroup("global", "nhannhiemvu", false, true);
                mAuto.clickImageByGroup("global", "xong", false, true);

                if (mAuto.findImageByGroup("global", "khongxong"))
                {
                    mAuto.writeStatus("Không đủ điều kiện để đổi năng nổ bằng nguyên liệu " + mLoaiNL);
                    return(false);
                }

                mAuto.writeStatus("Đổi năng nổ bằng " + mLoaiNL + " thành công ...");
                return(true);
            }

            return(false);
        }
示例#3
0
        public void chayQ()
        {
            // Xóa ghi chép chat
            mAuto.clickImageByGroup("global", "chatclear", false, true);

            List <Bitmap> pos = new List <Bitmap>();

            int loop = 0;

            while (!checkDaDanhNhiemVu())
            {
                loop++;
                if (loop >= 5)
                {
                    Helper.showAlert(mCharacter.ID, "Nhiệm vụ phi tặc này có vấn đề");
                }

                // Mở menu phải
                mAuto.moMenuPhai();

                // Nếu vip dưới 6 thì mới chạy cái này
                if (mCharacter.VipLevel < 6 && mCharacter.VipLevel > 0)
                {
                    // Bay
                    mAuto.bay();
                }

                // Tìm tới tọa độ và gọi quái
                while (!checkDaGoiQuai())
                {
                    // Mở túi nhiệm vụ
                    mAuto.closeAllDialog();
                    mAuto.clickToImage(Constant.ImagePathGlobalTui);
                    mAuto.clickImageByGroup("global", "tui_tab_nhiemvu", true, true);

                    // Nhấp đôi vào bản đồ nhiệm vụ
                    mAuto.clickToImage(Constant.ImagePathTriAnBanDoNhiemVu, 0, -20, 2);

                    // Chờ 2s để load map
                    Thread.Sleep(2000);

                    mAuto.closeAllDialog();

                    // Nếu vip dưới 6 thì mới chạy cái này
                    if (mCharacter.VipLevel < 6 && mCharacter.VipLevel > 0)
                    {
                        do
                        {
                            // Nhấp vào tọa độ
                            mAuto.writeStatus("Nhấp vào tọa độ ...");
                            mAuto.clickToImage(Constant.ImagePathTriAnToaDo, 10, -25);
                            mAuto.clickToImage(Constant.ImagePathTriAnToaDo2, 10, -25);
                        } while (mAuto.isMoving());
                    }

                    var full_screen = CaptureHelper.CaptureWindow(mHWnd);

                    // Lưu tracking
                    Bitmap bChuyenKenh  = ImageScanOpenCV.GetImage(Constant.ImagePathGlobalChuyenKenh);
                    var    pBChuyenKenh = ImageScanOpenCV.FindOutPoint((Bitmap)full_screen, bChuyenKenh);

                    if (pBChuyenKenh != null)
                    {
                        Bitmap tracking = CaptureHelper.CropImage((Bitmap)full_screen, new Rectangle(pBChuyenKenh.Value.X, pBChuyenKenh.Value.Y, 180, 20));
                        tracking.Save("tracking/trian_" + mCharacter.ID + ".png", ImageFormat.Png);
                    }
                }

                mAuto.closeAllDialog();

                // Nếu vip dưới 6 thì mới chạy cái này
                if (mCharacter.VipLevel < 6 && mCharacter.VipLevel > 0)
                {
                    // Xuống
                    mAuto.bayXuong();
                }

                // Đóng menu phải
                mAuto.dongMenuPhai();

                // Tìm phản quân hoặc phi tặc
                int x = 0;
                while (!mAuto.findImage(Constant.ImagePathDoiThoai + "trian" + ".png") && x < lPTPQ.Count)
                {
                    if (mAuto.findImage(lPTPQ[x].imagePath))
                    {
                        mAuto.clickToImage(lPTPQ[x].imagePath, lPTPQ[x].x, lPTPQ[x].y);
                    }

                    x++;
                }

                // Đánh
                mAuto.clickToImage(Constant.ImagePathDoiThoai + "trian" + ".png");

                // Nghỉ 5s nếu nhân vật đang trong trận đấu
                while (mAuto.dangTrongTranDau())
                {
                    Thread.Sleep(5000);
                }

                if (checkDaDanhNhiemVu())
                {
                    break;
                }

                // Lưu 4 vị trí xung quanh vị trí hiện tại
                if (pos.Count <= 0)
                {
                    // Mở bảng đồ mini
                    mAuto.clickToImage(Constant.ImagePathMiniMap);

                    Thread.Sleep(1000);

                    var full_screen = CaptureHelper.CaptureWindow(mHWnd);

                    // Tắt các bảng nổi
                    mAuto.closeAllDialog();

                    // Lưu 4 vị trí
                    Bitmap iBtn = ImageScanOpenCV.GetImage(Constant.ImagePathInMapChar);
                    var    pBtn = ImageScanOpenCV.FindOutPoint((Bitmap)full_screen, iBtn);

                    if (pBtn != null)
                    {
                        pos.Add(CaptureHelper.CropImage((Bitmap)full_screen, new Rectangle(pBtn.Value.X + (-15), pBtn.Value.Y + (-30), 30, 30)));
                        pos.Add(CaptureHelper.CropImage((Bitmap)full_screen, new Rectangle(pBtn.Value.X + (11), pBtn.Value.Y + (0), 30, 30)));
                        pos.Add(CaptureHelper.CropImage((Bitmap)full_screen, new Rectangle(pBtn.Value.X + (-15), pBtn.Value.Y + (20), 30, 30)));
                        pos.Add(CaptureHelper.CropImage((Bitmap)full_screen, new Rectangle(pBtn.Value.X + (-32), pBtn.Value.Y + (0), 30, 30)));
                    }
                }

                // Di chuyển đến vị trí quanh ptpq
                int i = 0;
                while (!mAuto.findImage(Constant.ImagePathDoiThoai + "trian" + ".png") && i < pos.Count)
                {
                    // Mở menu phải
                    mAuto.moMenuPhai();

                    // Bay lên
                    mAuto.bay();

                    // Mở bảng đồ mini
                    mAuto.clickToImage(Constant.ImagePathMiniMap);

                    // Nhấp vào vị trí xung quanh ptpq
                    mAuto.clickImage(pos[i], 15, -15);

                    // Tắt các bảng nổi
                    mAuto.closeAllDialog();

                    // Đóng menu phải
                    mAuto.dongMenuPhai();

                    // Tìm phản quân hoặc phi tặc
                    int y = 0;
                    while (!mAuto.findImage(Constant.ImagePathDoiThoai + "trian" + ".png") && y < lPTPQ.Count)
                    {
                        if (mAuto.findImage(lPTPQ[y].imagePath))
                        {
                            // Mở menu phải
                            mAuto.moMenuPhai();

                            // Bay xuống
                            if (mAuto.findImage(Constant.ImagePathGlobalXuong))
                            {
                                mAuto.bayXuong();
                                Thread.Sleep(3000);
                            }

                            // Đóng menu phải
                            mAuto.dongMenuPhai();

                            mAuto.clickToImage(lPTPQ[y].imagePath, lPTPQ[y].x, lPTPQ[y].y);
                            Thread.Sleep(1000);
                        }

                        y++;
                    }

                    i++;
                }

                // Đánh
                mAuto.clickToImage(Constant.ImagePathDoiThoai + "trian" + ".png");

                // Nghỉ 5s nếu nhân vật đang trong trận đấu
                while (mAuto.dangTrongTranDau())
                {
                    Thread.Sleep(5000);
                }
            }

            if (!checkHoanThanhNhiemVu())
            {
                // Nhấn vào nhận Q Trị An
                mAuto.clickImageByGroup("tri_an", "nhiemvutrianchuanhan", false, true);
                mAuto.clickImageByGroup("tri_an", "nhiemvuphanquandaxong", false, true);
                mAuto.clickImageByGroup("tri_an", "nhiemvuphitacdaxong", false, true);
                // Trả nhiệm vụ
                mAuto.traNhiemVu();
            }
        }
示例#4
0
        public void login()
        {
            // Chưa load vào bảng login
            while (!mAuto.findImageByGroup("global", "loginbatbuoc", false, false))
            {
                Thread.Sleep(5000);
            }

            // Chưa load bảng chọn kênh
            while (!mAuto.findImageByGroup("global", "bangchonkenh", false, false))
            {
                // Click bắt buộc
                mAuto.writeStatus("Click bắt buộc");
                mAuto.clickImageByGroup("global", "loginbatbuoc", false, false);

                Thread.Sleep(5000);
            }

            // Chưa load bảng chọn nhân vật
            while (!mAuto.findImageByGroup("global", "bangchonnhanvat", false, false))
            {
                mAuto.writeStatus("Chọn kênh");
                this.chonKenh(5);

                Thread.Sleep(5000);
            }

            // Chưa load vào game
            while (!mAuto.findImageByGroup("global", "khongtrongtrandau", false, false))
            {
                mAuto.writeStatus("Chọn nhân vật");
                this.chonNhanVat();

                Thread.Sleep(5000);
            }
        }
示例#5
0
        /*
         * Function: auto
         * Description: Chạy auto
         * Author: Tử La Lan - Facebook: https://www.facebook.com/Tu.La.Lan.NT
         * Created At: 2019-11-17 - Updated At: 2019-11-17
         */
        public bool auto()
        {
            mAuto.closeAllDialog();

            while (!mAuto.findImageByGroup("phu_ban", "hoanthanhphuban_check"))
            {
                // Mở bảng auto
                mAuto.clickImageByGroup("phu_ban", "hoanthanhphuban");

                Thread.Sleep(2000);
            }

            // Nhận hoàn thành phụ bản nếu có
            for (int x = 0; x < 6; x++)
            {
                mAuto.clickImageByGroup("phu_ban", "nhanthuong");
            }

            // Chuyển trang 2
            mAuto.clickImageByGroup("phu_ban", "nextpage");

            for (int x = 0; x < 2; x++)
            {
                mAuto.clickImageByGroup("phu_ban", "nhanthuong");
            }

            // Chuyển trang 1
            mAuto.clickImageByGroup("phu_ban", "prevpage");

            int i = 0;

            while (mPhuBan[i] != null && i <= Constant.MaxLoopQ)
            {
                // Chuyển trang
                if (mPhuBan[i] == "thamhiem" || mPhuBan[i] == "thegioiso")
                {
                    mAuto.clickImageByGroup("phu_ban", "nextpage");
                }
                else
                {
                    mAuto.clickImageByGroup("phu_ban", "prevpage");
                }


                // Chọn độ khó
                if (mPhuBan[i] == "lietdiemthamuyen" ||
                    mPhuBan[i] == "trolailanghuyet" ||
                    mPhuBan[i] == "quyhutmau" ||
                    mPhuBan[i] == "thegioiso")
                {
                    mAuto.clickImageByGroup("phu_ban", "showchondokho" + mPhuBan[i], false, false, 1, 120);
                    mAuto.clickImageByGroup("phu_ban", "chonkho");
                }

                // Auto phụ bản
                mAuto.clickImageByGroup("phu_ban", "batdau" + mPhuBan[i], false, false, 1, 60, 40);
                mAuto.clickImageByGroup("global", "luachonco", false, true);
                i++;
            }

            if (i >= Constant.MaxLoopQ)
            {
                return(false);
            }

            return(true);
        }
示例#6
0
        public void findMonsterByCode(string monster_name)
        {
            string imageTalkMonster = Constant.ImagePathDoiThoai + monster_name + ".png";
            int    x = 0;
            int    y = 0;

            List <Map> maps = new List <Map>();

            maps.Add(new Map("leduongbac", 1, 30, -20));
            maps.Add(new Map("leduongnam", 1, 10, -20));
            maps.Add(new Map("laptuyetdia", 1, 30, -20));
            maps.Add(new Map("anhvucanh", 1, 60, -20));
            maps.Add(new Map("bangtuyetnguyen", 1, 10, -20));

            List <string> tmpPaths = new List <string>();

            tmpPaths.Add("resources/event/ldb1.png");
            tmpPaths.Add("resources/event/ldb2.png");
            tmpPaths.Add("resources/event/ldb3.png");
            tmpPaths.Add("resources/event/ldb4.png");
            tmpPaths.Add("resources/event/ldb5.png");
            maps[0].setPosPaths(tmpPaths);

            List <string> tmpPathsLDN = new List <string>();

            tmpPathsLDN.Add("resources/event/ldn1.png");
            tmpPathsLDN.Add("resources/event/ldn2.png");
            tmpPathsLDN.Add("resources/event/ldn3.png");
            tmpPathsLDN.Add("resources/event/ldn4.png");
            tmpPathsLDN.Add("resources/event/ldn5.png");
            maps[1].setPosPaths(tmpPathsLDN);

            List <string> tmpPathsLTD = new List <string>();

            tmpPathsLTD.Add("resources/event/ltd1.png");
            tmpPathsLTD.Add("resources/event/ltd2.png");
            tmpPathsLTD.Add("resources/event/ltd3.png");
            tmpPathsLTD.Add("resources/event/ltd4.png");
            tmpPathsLTD.Add("resources/event/ltd5.png");
            maps[2].setPosPaths(tmpPathsLTD);

            List <string> tmpPathsAVC = new List <string>();

            tmpPathsAVC.Add("resources/event/avc1.png");
            tmpPathsAVC.Add("resources/event/avc2.png");
            tmpPathsAVC.Add("resources/event/avc3.png");
            tmpPathsAVC.Add("resources/event/avc4.png");
            tmpPathsAVC.Add("resources/event/avc5.png");
            maps[3].setPosPaths(tmpPathsAVC);

            List <string> tmpPathsBTN = new List <string>();

            tmpPathsBTN.Add("resources/event/btn1.png");
            tmpPathsBTN.Add("resources/event/btn2.png");
            tmpPathsBTN.Add("resources/event/btn3.png");
            tmpPathsBTN.Add("resources/event/btn4.png");
            tmpPathsBTN.Add("resources/event/btn5.png");
            maps[4].setPosPaths(tmpPathsBTN);

            while (mCharacter.Running == 2)
            {
                x = 0;

                while (x < maps.Count)
                {
                    // Di chuyển đến Map
                    if (!mAuto.moveToMapNhom(maps[x].name, maps[x].mapIndex, maps[x].x, maps[x].y))
                    {
                        mAuto.writeStatus("Không thể di chuyển đến " + maps[x].name + ", thử lại ...");
                    }

                    y = 0;

                    while (y < maps[x].posPaths.Count)
                    {
                        // Check đang di chuyển
                        do
                        {
                            // Nhấp vào code
                            mAuto.clickToImage(maps[x].posPaths[y], -20);
                            if (mAuto.findImageByGroup("global", "movenhom"))
                            {
                                // Tắt các bảng nổi
                                mAuto.closeAllDialog();
                            }
                        } while (mAuto.isMoving());

                        Thread.Sleep(1000);

                        // Check có bảng đối thoại ko ?
                        if (mAuto.findImage(imageTalkMonster))
                        {
                            // Đánh quái
                            mAuto.clickToImage(imageTalkMonster);

                            Thread.Sleep(2000);

                            // Nghỉ 5s nếu nhân vật đang trong trận đấu
                            bool inBattle = false;
                            while (mAuto.dangTrongTranDau())
                            {
                                inBattle = true;
                                mAuto.clickImageByGroup("global", "inbattleauto");
                                Thread.Sleep(2000);
                            }

                            if (inBattle)
                            {
                                Thread.Sleep(2000);
                            }
                        }

                        y++;
                    }

                    x++;
                }
            }
        }