Пример #1
0
        private TaskResult RunStep5(TaskContext arg)
        {
            Role role = (Role)Role;

            Delegater.WaitTrue(() => role.OpenTeshushijian(),
                               () => Dm.IsExistPic(370, 81, 595, 139, @"\bmp\特殊事件3.bmp"),
                               () => Dm.Delay(1000));
            if (Dm.FindPicAndClick(114, 142, 827, 489, @"\bmp\恭贺奖励.bmp", 30, 0))
            {
                Dm.Delay(1000);
                int count = 20;
                while (true)
                {
                    while (Dm.IsExistPic(339, 76, 577, 146, @"\bmp\恭贺.bmp") && count != 0)
                    {
                        Dm.MoveToClick(478, 477);
                        Dm.Delay(300);
                        count--;
                    }
                    Dm.Delay(1000);
                    if (!Dm.IsExistPic(339, 76, 577, 146, @"\bmp\恭贺.bmp"))
                    {
                        break;
                    }
                    if (count == 0)
                    {
                        break;
                    }
                }
            }
            role.CloseWindow();
            return(TaskResult.Success);
        }
Пример #2
0
        public ActionResult List()
        {
            string PageId = Request.Params["page"];
            string xml    = Dm.GetListXml("projects", PageId);

            List <Post> posts = Dm.ParseList(xml);

            Category category = Dm.ParseCategory(xml);

            category.Name = "projects";

            if (Request.HttpMethod.ToLower() == "post")
            {
                JsonMessage jm = new JsonMessage();

                if (posts.Count > 0)
                {
                    jm.Result = true;
                    jm.Object = posts;
                }
                else
                {
                    jm.Result = false;
                }

                return(Json(jm));
            }
            else
            {
                ViewData["Posts"]    = posts;
                ViewData["Category"] = category;
                return(View(Dm));
            }
        }
Пример #3
0
 /// <summary>
 /// Moves player.
 /// </summary>
 protected void HandleMovement()
 {
     if (Input.GetButton("Forward"))
     {
         if (MoveTo(Direction.Forward))
         {
             _didPlayerMoved = true;
             Dm.UpdateVisibleTiles(_currentI, _currentJ);
         }
     }
     else if (Input.GetButton("Backward"))
     {
         if (MoveTo(Direction.Backward))
         {
             _didPlayerMoved = true;
             Dm.UpdateVisibleTiles(_currentI, _currentJ);
         }
     }
     else if (Input.GetButton("Strafe Right"))
     {
         if (MoveTo(Direction.Right))
         {
             _didPlayerMoved = true;
             Dm.UpdateVisibleTiles(_currentI, _currentJ);
         }
     }
     else if (Input.GetButton("Strafe Left"))
     {
         if (MoveTo(Direction.Left))
         {
             _didPlayerMoved = true;
             Dm.UpdateVisibleTiles(_currentI, _currentJ);
         }
     }
 }
Пример #4
0
        private TaskResult RunStep7(TaskContext arg)
        {
            Role role = (Role)Role;

            role.GoToMap("副本");
            int count = 0;

            while (true)
            {
                if (Dm.FindPicAndClick(116, 72, 936, 351, @"\bmp\战斗.bmp") ||
                    Dm.FindMultiColorAndClick(122, 58, 318, 196, "ffb40b", "19|-17|ffb814,35|0|ffb40b-202020,34|-34|fff303-202020,25|-25|ffdd12,26|-4|ff8804,8|-7|ff9907,28|-29|ffe009", 17, 59))
                {
                    count = 0;
                    if (role.GoToFighting() == false)
                    {
                        Dm.DebugPrint("装备不够好或等级不够,提升实力再来!");
                        break;
                    }
                }
                else
                {
                    count++;
                    if (count > 5)
                    {
                        break;
                    }
                    Dm.Swipe(670, 427, 93, 427); //向右划
                    Dm.Delay(1000);
                }
                Dm.Delay(2000);
            }
            role.CloseWindow();
            return(TaskResult.Success);
        }
Пример #5
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);
        }
Пример #6
0
        private EquipmentAttrType GetEquipmentType(int x1, int y1, int x2, int y2)
        {
            int intX, intY;
            int result = Dm.FindPic(x1, y1, x2, y2, @"\bmp\攻击.bmp|\bmp\防御.bmp|\bmp\掌控.bmp|\bmp\血量.bmp|\bmp\强防.bmp|\bmp\强壮.bmp|\bmp\强攻.bmp|", "404040", 0.6, 0, out intX, out intY);

            return((EquipmentAttrType)result);
        }
Пример #7
0
 protected override int GetStepIndex(TaskContext context)
 {
     try
     {
         if (context.Settings.StepName == "自动兵器")
         {
             return(1);
         }
         if (context.Settings.StepName == "自动建筑")
         {
             return(2);
         }
         if (context.Settings.StepName == "自动洗练")
         {
             return(5);
         }
         if (context.Settings.StepName == "购买装备")
         {
             return(6);
         }
         if (context.Settings.StepName == "自动副本")
         {
             return(7);
         }
     }
     catch (Exception ex)
     {
         Dm.DebugPrint(ex.Message);
     }
     return(1);
 }
Пример #8
0
        private TaskResult RunStep4(TaskContext context)
        {
            Role role = (Role)context.Role;

            Delegater.WaitTrue(() => Dm.FindPicAndClick(856, 448, 958, 536, @"\bmp\菜单未打开.bmp"),
                               () => Dm.IsExistPic(856, 448, 958, 536, @"\bmp\菜单打开.bmp"), () => Dm.Delay(1000));
            Delegater.WaitTrue(() => role.OpenMenu("装备"),
                               () => role.OpenWindowMenu("商店"), () => Dm.Delay(1000));
            Delegater.WaitTrue(() =>
            {
                Dm.FindStrAndClick(718, 448, 857, 502, "刷新", "86.17.70-5.5.25");
                if (Dm.IsExistPic(283, 192, 668, 411, @"\bmp\金币秒CD.bmp"))
                {
                    Dm.FindPicAndClick(283, 192, 668, 411, @"\bmp\商店取消.bmp");
                    return(true);
                }
                if (Dm.IsExistPic(283, 192, 668, 411, @"\bmp\适合您的装备.bmp"))
                {
                    Dm.FindPicAndClick(283, 192, 668, 411, @"\bmp\商店确定.bmp");
                }
                if (Dm.IsExistPic(283, 192, 668, 411, @"\bmp\稀有物品.bmp"))
                {
                    Dm.FindPicAndClick(283, 192, 668, 411, @"\bmp\商店确定.bmp");
                }
                return(Dm.IsExistStr(718, 448, 857, 502, "清除", "86.17.70-5.5.25"));
            }, () => Dm.Delay(500));
            role.CloseWindow();
            return(TaskResult.Finished);
        }
Пример #9
0
        //public object RemoteSession;

        static public void CloneDependencies(object cloningObject, object targetObject)
        {
            //Console.WriteLine("---- -------- CloneDependencies");
            IList <JSoftInstance> siList = Dm.Instance.ResolveOneToManyRelation <JSoftInstance>(cloningObject);

            foreach (var si in siList)
            {
                JSoftInstance siClone = (JSoftInstance)Dm.CloneObject(si, CloneObjectType.ForNew);
                siClone.JCompDevice = targetObject as JCompDevice;
                Dm.Instance.SaveObject(siClone);

                //cloning user accounts
                IList <JUserAccount> uaList = Dm.Instance.ResolveOneToManyRelation <JUserAccount>(si);
                foreach (var ua in uaList)
                {
                    JUserAccount uaClone = (JUserAccount)Dm.CloneObject(ua, CloneObjectType.ForNew);
                    uaClone.JSoftInstance = siClone;
                    Dm.Instance.SaveObject(uaClone);
                }
            }
            IList <JCompDeviceStorage> sdsList = Dm.Instance.ResolveOneToManyRelation <JCompDeviceStorage>(cloningObject);

            foreach (var sds in sdsList)
            {
                JCompDeviceStorage sdsClone = (JCompDeviceStorage)Dm.CloneObject(sds, CloneObjectType.ForNew);
                sdsClone.JCompDevice = targetObject as JCompDevice;
                Dm.Instance.SaveObject(sdsClone);
            }
        }
Пример #10
0
 /// <summary>
 /// 设置窗口透明度
 /// </summary>
 /// <param name="trans">透明度值</param>
 /// <returns></returns>
 public bool SetTransparent(int trans)
 {
     if (!IsAlive)
     {
         return false;
     }
     return Dm.SetWindowTransparent(_hwnd, trans);
 }
Пример #11
0
 public bool SendPaste()
 {
     if (!IsAlive)
     {
         return(false);
     }
     return(Dm.SendPaste(_hwnd) == 1);
 }
Пример #12
0
 /// <summary>
 /// 向窗口发送字符串2
 /// </summary>
 /// <param name="content">要发达的内容</param>
 /// <returns></returns>
 public bool SendString2(string content)
 {
     if (!IsAlive)
     {
         return false;
     }
     return Dm.SendString2(_hwnd, content);
 }
Пример #13
0
        private ResourceType GetResourceType(int x1, int y1, int x2, int y2)
        {
            int intX, intY;
            int type = Dm.FindPic(x1, y1, x2, y2, @"\bmp\招商令.bmp|\bmp\镔铁.bmp|\bmp\粮食.bmp|\bmp\木材.bmp|\bmp\募兵令.bmp", "303030", 0.8, 0, out intX, out intY);

            // Dm.DebugPrint("资源类型:" + type.ToString());
            return((ResourceType)type);
        }
Пример #14
0
 public bool SendString2(string content)
 {
     if (!IsAlive)
     {
         return(false);
     }
     return(Dm.SendString2(_hwnd, content) == 1);
 }
Пример #15
0
 public bool SetTransparent(int trans)
 {
     if (!IsAlive)
     {
         return(false);
     }
     return(Dm.SetWindowTransparent(_hwnd, trans) == 1);
 }
Пример #16
0
 /// <summary>
 /// 向窗口执行粘贴命令
 /// </summary>
 /// <returns></returns>
 public bool SendPaste()
 {
     if (!IsAlive)
     {
         return false;
     }
     return Dm.SendPaste(_hwnd);
 }
Пример #17
0
 public bool RestoreAndActive()
 {
     if (!IsAlive)
     {
         return(false);
     }
     Dm.SetWindowState(_hwnd, 12);
     return(IsActive);
 }
Пример #18
0
 public bool Enabled()
 {
     if (!IsAlive)
     {
         return(false);
     }
     Dm.SetWindowState(_hwnd, 11);
     return(IsActive);
 }
Пример #19
0
 public bool Disable()
 {
     if (!IsAlive)
     {
         return(false);
     }
     Dm.SetWindowState(_hwnd, 10);
     return(!IsActive);
 }
Пример #20
0
 public bool CancelOnTop()
 {
     if (!IsAlive)
     {
         return(false);
     }
     Dm.SetWindowState(_hwnd, 9);
     return(!IsOnTop);
 }
Пример #21
0
 public bool Show()
 {
     if (!IsAlive)
     {
         return(false);
     }
     Dm.SetWindowState(_hwnd, 7);
     return(IsShowed);
 }
Пример #22
0
 public bool Hide()
 {
     if (!IsAlive)
     {
         return(false);
     }
     Dm.SetWindowState(_hwnd, 6);
     return(!IsShowed);
 }
Пример #23
0
 public bool Max()
 {
     if (!IsAlive)
     {
         return(false);
     }
     Dm.SetWindowState(_hwnd, 4);
     return(IsMax);
 }
Пример #24
0
 public bool MinAndClean()
 {
     if (!IsAlive)
     {
         return(false);
     }
     Dm.SetWindowState(_hwnd, 3);
     return(IsMin);
 }
Пример #25
0
 public bool Close()
 {
     if (!IsAlive)
     {
         return(true);
     }
     Dm.SetWindowState(_hwnd, 0);
     return(!IsAlive);
 }
Пример #26
0
 /// <summary>
 /// 插入一条dm
 /// </summary>
 /// <param name="dm"></param>
 /// <returns></returns>
 public static int InsertDm(Dm dm)
 {
     using (var db = new SQLiteDb())
     {
         db.Dms.Add(dm);
         int count = db.SaveChanges();
         return(count);
     }
 }
Пример #27
0
 public bool RestoreAndNotActive()
 {
     if (!IsAlive)
     {
         return(false);
     }
     Dm.SetWindowState(_hwnd, 5);
     return(!IsMin && !IsActive);
 }
Пример #28
0
 /// <summary>
 /// 更新dm
 /// </summary>
 /// <param name="dm"></param>
 /// <returns></returns>
 public static int UpdateDm(Dm dm)
 {
     using (var db = new SQLiteDb())
     {
         db.Dms.Add(dm);
         db.Entry <Dm>(dm).State = System.Data.Entity.EntityState.Modified;
         return(db.SaveChanges());
     }
 }
Пример #29
0
        //
        // GET: /Home/

        public ActionResult Index()
        {
            string      xml   = Dm.GetListXml("projects", null);
            List <Post> posts = Dm.ParseList(xml).Take(3).ToList();

            ViewData["Projects"] = posts;

            return(View(Dm));
        }
Пример #30
0
 /// <summary>
 /// 窗口置顶
 /// </summary>
 /// <returns></returns>
 public bool OnTop()
 {
     if (!IsAlive)
     {
         return false;
     }
     Dm.SetWindowState(_hwnd, 8);
     return IsOnTop;
 }