Exemple #1
0
        /// <summary>
        /// 获得商城龙币数
        /// </summary>
        /// <returns></returns>
        private uint GetMallLB()
        {
            DmPlugin dm   = Window.Dm;
            int      hwnd = Window.Hwnd;
            int      val  = dm.ReadInt(hwnd, "[16D208C]+238", 0);

            return((uint)val);
        }
Exemple #2
0
        public TeleportViewModel()
        {
            this.CurrentPoint = new Point("当前坐标", 0, 0, 0);
            this.NewPoint     = new Point("添加坐标", 0, 0, 0);
            this.Points       = new ObservableCollection <Point>();
            this.Files        = new ObservableCollection <File>();
            UpdateFiles();

            this.AddCurrentPointCommand = new RelayCommand(() => this.AddPoint(CurrentPoint));
            this.AddNewPointCommand     = new RelayCommand(() => this.AddPoint(NewPoint));
            this.ClearCommand           = new RelayCommand(() => this.Clear());
            this.DeleteCommand          = new RelayCommand <Point>((p) => this.DeletePoint(p));
            this.TeleportCommand        = new RelayCommand <Point>((p) => this.Teleport(p));
            this.SaveCommand            = new RelayCommand(() => this.SaveList());
            this.SaveAsCommand          = new RelayCommand(() => this.SaveAs());
            this.CreateCommand          = new RelayCommand(() => this.Create());
            this.ImportCommand          = new RelayCommand(() => this.Import());
            this.SetXiaohaoCommand      = new RelayCommand(() =>
            {
                new ViewModelLocator().SetXiaohao.IsOpen = true;
            });
            timer.Tick += (s, e) =>
            {
                if (SoftContext.Role == null)
                {
                    return;
                }
                DmPlugin dm   = SoftContext.Role.Window.Dm;
                int      hwnd = SoftContext.Role.Window.Hwnd;
                if (SoftContext.Role.Window.IsAlive)
                {
                    CurrentPoint.X = IntToFloat(dm.ReadInt(hwnd, "[1221740]+a5c", 0));
                    CurrentPoint.Y = IntToFloat(dm.ReadInt(hwnd, "[1221740]+a64", 0));
                    CurrentPoint.Z = IntToFloat(dm.ReadInt(hwnd, "[1221740]+a60", 0));
                }
                else
                {
                    CurrentPoint.X = 0;
                    CurrentPoint.Y = 0;
                    CurrentPoint.Z = 0;
                }
            };
            timer.Interval = TimeSpan.FromMilliseconds(500);
            timer.Start();
        }
Exemple #3
0
        /// <summary>
        /// 获取仓库金钱
        /// </summary>
        /// <returns></returns>
        private Money GetRepertoryMoney()
        {
            DmPlugin dm    = Window.Dm;
            int      hwnd  = Window.Hwnd;
            int      val   = dm.ReadInt(hwnd, "[16D1E50]+70", 0);
            Money    money = new Money();

            money.Gold   = (uint)val / 10000;
            money.Silver = (uint)val % 10000 / 100;
            money.Copper = (uint)val % 10000 % 100;
            return(money);
        }
Exemple #4
0
        /// <summary>
        /// 清理指定页背包
        /// </summary>
        /// <param name="role"></param>
        /// <param name="page">背包页(1-5)</param>
        /// <param name="begin">开始格数(1-30)</param>
        /// <param name="stop">结束格数(1-30)</param>
        public static void BagCleanup(this IRole role, int page, int begin, int stop)
        {
            DmPlugin dm   = role.Window.Dm;
            int      hwnd = role.Window.Hwnd;

            dm.MoveToClick(796 + 65 * (page - 1), 217);  //点击背包页
            dm.Delay(100);
            dm.MoveToClick(796 + 65 * (page - 1), 217);  //点击背包页
            dm.Delay(300);
            //5-28格
            for (int i = begin; i <= stop; i++)
            {
                dm.MoveTo(800 + 65 * ((i - 1) % 5), 274 + 65 * ((i - 1) / 5));
                dm.Delay(200);
                int num = dm.ReadInt(hwnd, "[16cbc90]+314", 0);
                Debug.WriteLine("格子数量为:" + num);
                if (num == 0)
                {
                    continue;
                }

                Debug.WriteLine(800 + 65 * ((i - 1) % 5) + "   " + (274 + 65 * ((i - 1) / 5)));
                Delegater.WaitTrue(() =>
                {
                    dm.MoveTo(573, 493);
                    dm.Delay(100);
                    string content = dm.ReadString(hwnd, "[16cbc90]+30", 1, 10);
                    //  Debug.WriteLine(content);
                    if (content.Contains("是"))
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                },
                                   () =>
                {
                    dm.MoveToClick(800 + 65 * ((i - 1) % 5), 274 + 65 * ((i - 1) / 5)); //点击格子
                    dm.MoveToClick(748, 687);                                           //点击丢弃
                    dm.Delay(300);
                });
                dm.MoveToClick(574, 496);                   //点击确认
                dm.Delay(500);
            }
        }