コード例 #1
0
        private TaskResult RunStep6(TaskContext arg)
        {
            Role role = (Role)Role;

            if (Dm.GetColorNum(523, 379, 602, 450, "dc3146-303030", 0.9) > 50)
            {
                Delegater.WaitTrue(() => Dm.MoveToClick(30, 32),
                                   () => role.IsExistWindowMenu("设置"),
                                   () => Dm.Delay(1000));
                Delegater.WaitTrue(() => role.OpenWindowMenu("设置"),
                                   () => Dm.IsExistPic(507, 99, 583, 163, @"\bmp\礼包.bmp"),
                                   () => Dm.Delay(1000));
                Delegater.WaitTrue(() =>
                {
                    Dm.FindPicAndClick(507, 99, 583, 163, @"\bmp\礼包.bmp");
                    Dm.Delay(1000);
                    if (Dm.FindPicAndClick(678, 241, 811, 344, @"\bmp\宝箱.bmp"))
                    {
                        Dm.Delay(2000);
                    }
                    else
                    {
                        return(true);
                    }
                    return(false);
                }, () => Dm.Delay(1000), 10);
            }

            role.CloseWindow();
            return(TaskResult.Success);
        }
コード例 #2
0
        int[] needs = new int[] { 0, 0, 0, 0, 0, 0 };//枪甲符马袍旗

        private void GetEquipmentProperty(int x, int y, int i)
        {
            Dm.Delay(1000);
            Dm.MoveToClick(x, y);
            Dm.Delay(1000);
            int count = Dm.GetColorNum(205, 448, 264, 499, "201a19-202020", 0.9);

            if (Dm.GetColorNum(584, 76, 633, 114, "edd1a9 -202020|a49074-202020", 0.9) > 100)
            {
                if (count > 2000)
                {
                    needs[i] += 1;
                    return;
                }
                else
                {
                    Dm.MoveToClick(234, 469);
                    Dm.Delay(1000);
                    Dm.MoveToClick(x, y);
                    Dm.Delay(1000);
                }
            }

            if (IsOptimalColor() == false)
            {
                if (count > 2000)
                {
                    needs[i] += 1;
                }
                else
                {
                    Dm.MoveToClick(234, 469);
                    Dm.Delay(1000);
                    if (IsOptimalColor() == false)
                    {
                        needs[i] += 1;
                    }
                    else
                    {
                        Delegater.WaitTrue(() =>
                        {
                            if (Dm.FindPicAndClick(658, 437, 782, 491, @"\bmp\穿上装备.bmp", 0, 0, 0.7))
                            {
                                Dm.Delay(1000);
                                if (Dm.IsExistPic(537, 194, 669, 277, @"\bmp\兵力损失.bmp"))
                                {
                                    Dm.MoveToClick(415, 359);
                                }
                                return(true);
                            }
                            return(false);
                        }, () => Dm.Delay(1000));
                    }
                }
            }
        }
コード例 #3
0
        private TaskResult RunStep4(TaskContext arg)
        {
            Role role = (Role)Role;

            role.OpenMenu("资源");
            Delegater.WaitTrue(() => role.OpenWindowMenu("祭祀"),
                               () => role.IsExistWindowMenu("祭祀"),
                               () => Dm.Delay(1000));

            Dm.FindPicAndClick(699, 63, 868, 118, @"\bmp\祭祀十次.bmp");
            Dm.Delay(1000);
            Delegater.WaitTrue(() =>
            {
                if (Dm.GetColorNum(738, 500, 761, 522, "79a03b-303030", 1.0) > 20)
                {
                    Dm.MoveToClick(783, 512);
                    Dm.Delay(1000);
                    return(false);
                }
                return(true);
            }, () => Dm.Delay(50), 10);
            Dm.UseDict(1);

            Delegater.WaitTrue(() =>
            {
                if (Dm.IsExistPic(197, 59, 288, 102, @"\bmp\祭祀0.bmp", 0.7))
                {
                    if (Dm.GetColorNum(204, 61, 278, 96, "C59E00-3A2E00", 0.9) < 75)
                    {
                        return(true);
                    }
                }
                bool result = Dm.IsChangeColorNumEx(204, 61, 278, 96, "C59E00-3A2E00", () =>
                {
                    Dm.MoveToClick(322, 451); //祭祀木材
                    //Dm.MoveToClick(162, 454);//祭祀银子
                    Dm.Delay(500);
                });
                if (!result)
                {
                    Dm.DebugPrint("操作完颜色结果不变,可能已经完成!~");
                    if (Dm.FindPicAndClick(475, 315, 628, 415, @"\bmp\取消.bmp"))
                    {
                        Dm.Delay(1000);
                    }
                    return(true);
                }
                return(false);
            }, () => Dm.Delay(50), 40);
            Dm.UseDict(0);
            role.CloseWindow();
            return(TaskResult.Success);
        }
コード例 #4
0
        private void GetSelectedGeneralEquipment(int x1, int y1, int x2, int y2, int a, int b)
        {
            Role role = (Role)Role;

            if (Dm.GetColorNum(x1, y1, x2, y2, "DDDDDD-222222", 0.9, false) > 100)
            {
                //GetEquipmentProperty(465, 177, 0);//枪
                //GetEquipmentProperty(467, 250, 1);//甲
                //GetEquipmentProperty(468, 319, 2);//帅印
                //GetEquipmentProperty(535, 179, 3);//马
                //GetEquipmentProperty(536, 251, 4); //披风
                //GetEquipmentProperty(538, 322, 5);//旗子\
                Dm.MoveToClick(a, b);
                Dm.Delay(1000);
                Dm.MoveToClick(465, 177);
                Dm.Delay(1000);

                try
                {
                    var              obj           = role.GameHelper.GetData(Const.GENERAL_GET_WEAREQUIP);
                    JArray           wel           = obj.action.data.equips;
                    List <WearEquip> wearEquipList = new List <WearEquip>();

                    if (wel != null)
                    {
                        wearEquipList = JsonHelper.FromJson <List <WearEquip> >(wel.ToString());
                        foreach (var wearEquip in wearEquipList)
                        {
                            if (wearEquip.itemName.Contains("套装"))
                            {
                                Dm.DebugPrint("该武将穿套装:" + wearEquip.itemName);
                                if (!taozhuangList.Contains(wearEquip.itemName))
                                {
                                    taozhuangList.Add(wearEquip.itemName);
                                }
                            }
                        }
                    }
                    else
                    {
                        if (Dm.GetColorNum(574, 341, 702, 389, "c96be7-303030", 0.9) > 260)
                        {
                            Dm.DebugPrint("该武将穿套装,但获取失败!");
                        }
                    }
                }catch (Exception ex)
                {
                    Debug.WriteLine(ex.Message);
                }
            }
        }