Exemplo n.º 1
0
 private void Button3_Click(object sender, EventArgs e)
 {
     for (int i = 0; i < 59; i++)
     {
         HookCall.UseItem(player.hWnd, 0, 0);
         Thread.Sleep(20);
         HookCall.SelectLineMenu(player.hWnd, 8u, AutoClient.MenuID(player.HProcess));
         Thread.Sleep(20);
         HookCall.SelectLineMenu(player.hWnd, 3u, AutoClient.MenuID(player.HProcess));
         Thread.Sleep(20);
     }
     for (int j = 0; j < 6; j++)
     {
         for (int k = 0; k < 12; k++)
         {
             if (j != 0 || k != 0)
             {
                 HookCall.UseItem(player.hWnd, j, k);
                 Thread.Sleep(20);
                 HookCall.UseItem(player.hWnd, 0, 0);
                 Thread.Sleep(20);
                 HookCall.SelectLineMenu(player.hWnd, 8u, AutoClient.MenuID(player.HProcess));
                 Thread.Sleep(20);
                 HookCall.SelectLineMenu(player.hWnd, 3u, AutoClient.MenuID(player.HProcess));
                 Thread.Sleep(20);
             }
         }
     }
     for (int l = 0; l < 20; l++)
     {
         HookCall.CloseMenu(player.hWnd);
     }
     getMT();
 }
Exemplo n.º 2
0
 public void CloseMenu()
 {
     do
     {
         HookCall.CloseMenu(player.hWnd);
         Thread.Sleep(100);
         WinAPI.PostMessage(player.hWnd, 256u, 13u, 0u);
     }while (AutoClient.BaseMenu(player.HProcess) != 0);
 }
Exemplo n.º 3
0
        //private static void RemoveResults()
        //{
        //    //find root element
        //    var xRoot = DBFactory.GetData().Read(Constants._TYPE, "Root");
        //    var resultId = xRoot.GetAttributeValue(Constants.RESULT);
        //    var results = DBFactory.GetData().GetChildren(resultId);
        //    foreach (var kids in results.Descendants())
        //    {
        //        DBFactory.GetData().Delete(kids.GetAttributeValue(Constants._ID));
        //    }
        //}

        //private static void CleanProject()
        //{
        //    //find root element
        //    var xRoot = DBFactory.GetData().Read(Constants._TYPE, "Root");
        //    var root = DBFactory.GetData().GetChildren(xRoot.GetAttributeValue(Constants._ID));
        //    foreach (var kid in root.Descendants())
        //    {
        //        var id = kid.GetAttributeValue(Constants._ID);
        //        if (id.Equals(xRoot.GetAttributeValue(Constants._ID)))
        //            continue;
        //        foreach (var grandKid in DBFactory.GetData().GetChildren(id).Descendants())
        //        {
        //            DBFactory.GetData().Delete(grandKid.GetAttributeValue(Constants._ID));
        //        }
        //    }
        //}

        private static void TestWorkflow()
        {
            var auto             = new AutoClient();
            var workflowInstance = new WorkflowInstance(Guid.NewGuid().ToString(),
                                                        "7fdcbd7a-b30e-4c36-aa46-58ba74b02401", Configuration.Clone().GetList());
            var xCommand = workflowInstance.GetCommand();

            Console.WriteLine(xCommand.ToString());
            var xResult = auto.Execute(xCommand);

            Console.WriteLine(xResult);
            workflowInstance.SetResult(xResult);
        }
Exemplo n.º 4
0
 private void Button2_Click(object sender, EventArgs e)
 {
     for (int i = 0; i < (int)numericUpDown1.Value; i++)
     {
         Player.Item item = listItem.FirstOrDefault((Player.Item x) => x.Name == comboBox1.Text);
         HookCall.UseItem(player.hWnd, item.cot, item.hang);
         Thread.Sleep(20);
         if (comboBox2.Text != "Không Sử Dụng")
         {
             string s    = comboBox2.Text.Split(' ')[1];
             int    line = int.Parse(s) - 1;
             HookCall.SelectLineMenu(player.hWnd, (uint)line, AutoClient.MenuID(player.HProcess));
             Thread.Sleep(20);
         }
         if (comboBox3.Text != "Không Sử Dụng")
         {
             string s2    = comboBox3.Text.Split(' ')[1];
             int    line2 = int.Parse(s2) - 1;
             HookCall.SelectLineMenu(player.hWnd, (uint)line2, AutoClient.MenuID(player.HProcess));
             Thread.Sleep(20);
         }
         if (comboBox4.Text != "Không Sử Dụng")
         {
             string s3    = comboBox4.Text.Split(' ')[1];
             int    line3 = int.Parse(s3) - 1;
             HookCall.SelectLineMenu(player.hWnd, (uint)line3, AutoClient.MenuID(player.HProcess));
             Thread.Sleep(20);
         }
         if (comboBox5.Text != "Không Sử Dụng")
         {
             string s4    = comboBox5.Text.Split(' ')[1];
             int    line4 = int.Parse(s4) - 1;
             HookCall.SelectLineMenu(player.hWnd, (uint)line4, AutoClient.MenuID(player.HProcess));
             Thread.Sleep(20);
         }
         if (comboBox6.Text != "Không Sử Dụng")
         {
             string s5    = comboBox6.Text.Split(' ')[1];
             int    line5 = int.Parse(s5) - 1;
             HookCall.SelectLineMenu(player.hWnd, (uint)line5, AutoClient.MenuID(player.HProcess));
             Thread.Sleep(20);
         }
         if (comboBox7.Text != "Không Sử Dụng")
         {
             string s6    = comboBox7.Text.Split(' ')[1];
             int    line6 = int.Parse(s6) - 1;
             HookCall.SelectLineMenu(player.hWnd, (uint)line6, AutoClient.MenuID(player.HProcess));
             Thread.Sleep(20);
         }
     }
 }
Exemplo n.º 5
0
 private void GetALLToolStripMenuItem_Click(object sender, EventArgs e)
 {
     foreach (Player.NPCinfo nPC in AutoClient.GetNPCList(player.HProcess))
     {
         if (nPC.status == 5)
         {
             ListViewItem value = new ListViewItem(new string[1]
             {
                 nPC.Name
             });
             listView1.Items.Add(value);
         }
     }
 }
Exemplo n.º 6
0
 private void GetItemToolStripMenuItem_Click(object sender, EventArgs e)
 {
     listView1.Items.Clear();
     foreach (Player.Item item in AutoClient.GetItemList(player.HProcess))
     {
         if (item.type == 2 || item.type == 37)
         {
             ListViewItem value = new ListViewItem(new string[1]
             {
                 item.Name
             });
             listView1.Items.Add(value);
         }
     }
 }
Exemplo n.º 7
0
 private void Button1_Click(object sender, EventArgs e)
 {
     comboBox1.Items.Clear();
     listItem.Clear();
     foreach (Player.Item item in from x in AutoClient.GetItemList(player.HProcess)
              orderby x.id descending
              select x)
     {
         if (item.type == 2)
         {
             comboBox1.Items.Add(item.Name);
             listItem.Add(item);
         }
     }
     comboBox1.SelectedIndex = 0;
 }
        public bool doTest()
        {
            ReqDisplay.message("=============================================================");
            ReqDisplay.title("Requirement #4 & #5:The Server packages shall conduct Dependency and Strong Connected Component analysis");
            ReqDisplay.message("Send request for dependency analysis from auto client and display result on GUI client");
            ReqDisplay.message("-------------------------------------------------------------");
            AutoClient autoClient = new AutoClient(port);

            autoClient.sendDep();
            ReqDisplay.message("Send request for SCC analysis from auto client and display result on GUI client");
            ReqDisplay.message("-------------------------------------------------------------");
            autoClient.sendScc();
            autoClient.shutDown();

            return(result);
        }
        public void UpdateAuto(AutoVm vm)
        {
            // aus DB laden
            var dto = AutoClient.GetAuto(new GetAutoRequest()
            {
                AutoId = vm.Id
            });

            // properties kopieren
            dto.Marke      = vm.Name;
            dto.Tagestarif = (int)vm.Tagestarif;
            dto.AutoKlasse = (AutoKlasse)(int)vm.Autoklasse;

            // in DB schreiben
            AutoClient.UpdateAuto(dto, Metadata.Empty);
        }
Exemplo n.º 10
0
    public Client(IntPtr _hWnd, int pid)
    {
        hWnd = _hWnd;
        Pid  = pid;
        IntPtr intPtr = WinAPI.OpenProcess(ProcessAccessFlags.VirtualMemoryRead, false, pid);

        if (intPtr == IntPtr.Zero)
        {
            MessageBox.Show("Khong the doc duoc thong tin, chay lai auto voi quyen Admin", "Khong Auto duoc", MessageBoxButtons.OK);
            return;
        }
        player              = new Player(intPtr, AutoClient.AddressPlayer(intPtr));
        player.hWnd         = _hWnd;
        thread              = new Thread(ThreadRunAutoClien);
        thread.IsBackground = true;
        thread.Start();
    }
Exemplo n.º 11
0
 private void Button1_Click(object sender, EventArgs e)
 {
     comboBox1.Items.Clear();
     foreach (Player.Item item in from x in AutoClient.GetItemList(player.HProcess)
              orderby x.id descending
              select x)
     {
         if (item.type == 8 && !item.Name.Contains("Luyện Lô") && !item.Name.Contains("Tẩy Tâm"))
         {
             comboBox1.Items.Add(item.Name);
             oldKX.Name = item.Name;
             oldKX.id   = item.id;
         }
         listItemOld.Add(item);
     }
     comboBox1.SelectedIndex = 0;
 }
Exemplo n.º 12
0
 private void Button4_Click(object sender, EventArgs e)
 {
     if (button4.Text == "Auto Luyện")
     {
         button4.Text = "Stop";
         othread      = new Thread(ThreadLuyenMT);
         othread.Start();
         return;
     }
     button4.Text = "Auto Luyện";
     othread.Abort();
     do
     {
         HookCall.CloseMenu(player.hWnd);
         Thread.Sleep(100);
     }while (AutoClient.BaseMenu(player.HProcess) != 0);
 }
        public ObservableCollection <AutoVm> GetAutos()
        {
            // mit dem Grpc-Client die Autos holen (Typ AutoDto)
            var autos = AutoClient.GetAutos(new Empty(), new CallOptions()).Autos.ToList();

            // in ViewModels konvertieren
            var vms = autos.Select(x => new AutoVm()
            {
                Id         = x.Id,
                Autoklasse = (AutoklasseEnum)(int)x.AutoKlasse,
                Name       = x.Marke,
                Tagestarif = x.Tagestarif,
            }).ToList();

            // gekapselt in einer ObservableCollection zurückgeben
            return(new ObservableCollection <AutoVm>(vms));
        }
Exemplo n.º 14
0
        private void StartClient()
        {
            var hostType = Configuration.Settings("HostType", "Sauce");

            if (hostType.Equals("Sauce"))
            {
                var concurrency = int.Parse(Configuration.Settings("HostConcurrentInstances", "3"));
                for (var i = 0; i < concurrency - _instances.Count; i++)
                {
                    var instance = new AutoClient();
                    _instances.Add(instance);
                    instance.Start();
                }
            }
            else
            {
                _defaultClientInstance.Start();
            }
        }
Exemplo n.º 15
0
        private async void RunSauceTest(object sender, RoutedEventArgs e)
        {
            var saucelabFeature = new SaucelabFeature();

            if (!saucelabFeature.FeatureEnabled)
            {
                MessageBox.Show("This feature is not enabled.");
                return;
            }
            //get workflowid from project tree
            var selected = ProjectTreeView.SelectedItem as TreeViewItem;

            if (selected == null)
            {
                MessageBox.Show("Please select a test suite from the project tree!");
                return;
            }
            var selectedItem = selected.DataContext as XElement;

            if (selectedItem == null)
            {
                return;
            }
            var workflowId = selectedItem.GetAttributeValue(Constants._ID);
            var type       = selectedItem.GetAttributeValue(Constants._TYPE);
            var scriptType = selectedItem.GetAttributeValue(Constants.SCRIPT_TYPE);

            if (!type.Equals(Constants.SCRIPT) || !scriptType.Equals("TestSuite"))
            {
                MessageBox.Show("Selected Item MUST be a Test Script!");
                return;
            }
            //popup a dialog to get the browser os version
            PopupBrowsersDialogSetDefaultConfig();
            _config.Set("HostType", "Sauce");
            _autoClient = new AutoClient(_config);
            await Task.Factory.StartNew(() => RunWorkflowById(workflowId));

            //when finished, show a message
            MessageBox.Show("Your Test finished.");
        }
Exemplo n.º 16
0
    private void BanMT()
    {
        List <Player.Item> list = new List <Player.Item>();

        do
        {
            foreach (Player.Item item in listMT)
            {
                if (int.Parse(item.thanh) >= (int)numericUpDown1.Value && int.Parse(item.phuluc) >= (int)numericUpDown2.Value && int.Parse(item.MTdong1) >= (int)numericUpDown3.Value && int.Parse(item.MTdong2) >= (int)numericUpDown4.Value && int.Parse(item.MTdong3) >= (int)numericUpDown5.Value && int.Parse(item.MTdong4) >= (int)numericUpDown6.Value)
                {
                    button4.Invoke((MethodInvoker) delegate
                    {
                        button4.Text = "Auto Luyện";
                    });
                    isloop = false;
                    do
                    {
                        HookCall.CloseMenu(player.hWnd);
                        Thread.Sleep(100);
                    }while (AutoClient.BaseMenu(player.HProcess) != 0);
                    return;
                }
                list.Add(item);
            }
            foreach (Player.Item item2 in list)
            {
                HookCall.BanItem(player.hWnd, item2.id);
            }
            list.Clear();
            listMT.Clear();
            foreach (Player.Item item3 in AutoClient.GetItemList(player.HProcess))
            {
                if (int.Parse(item3.phuluc) != 0 && int.Parse(item3.phuluc) < 5 && item3.type == 2)
                {
                    listMT.Add(item3);
                }
            }
        }while (listMT.Count > 0);
    }
Exemplo n.º 17
0
 private void ThreadLuyenMT()
 {
     isloop = true;
     while (isloop)
     {
         for (int i = 0; i < 59; i++)
         {
             HookCall.UseItem(player.hWnd, 0, 0);
             Thread.Sleep(20);
             HookCall.SelectLineMenu(player.hWnd, 8, AutoClient.MenuID(player.HProcess)); //chọn dòng - 8
             Thread.Sleep(20);
             HookCall.SelectLineMenu(player.hWnd, 0, AutoClient.MenuID(player.HProcess)); // chọn dòng thứ 2 - 0
             Thread.Sleep(20);
         }
         for (int j = 0; j < 6; j++)
         {
             for (int k = 0; k < 12; k++)
             {
                 if (j != 0 || k != 0)
                 {
                     HookCall.UseItem(player.hWnd, j, k);
                     Thread.Sleep(20);
                     HookCall.UseItem(player.hWnd, 0, 0);
                     Thread.Sleep(20);
                     HookCall.SelectLineMenu(player.hWnd, 8u, AutoClient.MenuID(player.HProcess));
                     Thread.Sleep(20);
                     HookCall.SelectLineMenu(player.hWnd, 3u, AutoClient.MenuID(player.HProcess));
                     Thread.Sleep(20);
                 }
             }
         }
         listView1.Invoke((MethodInvoker) delegate
         {
             listView1.Items.Clear();
             getMT();
         });
         BanMT();
     }
 }
Exemplo n.º 18
0
 public Session(T client)
 {
     this.client = new AutoClient <T>(client ?? throw new ArgumentNullException(nameof(client)));
     this.locker = new object();
 }
Exemplo n.º 19
0
 public GameItem(IntPtr address, AutoClient client)
 {
     this.Address = address;
     this.Client  = client;
 }
Exemplo n.º 20
0
 public static void AutoClientComplete()
 {
     BasePage.validation.StringLogger.LogWrite("----Validating AutoClientCompleteSearch----");
     AutoClient.getWindow();
 }
Exemplo n.º 21
0
    private void ThreadTayKX()
    {
        isloop = true;
        string name = "";
        uint   num  = 0u;
        int    num2 = 0;

        while (isloop)
        {
            listItem.Clear();
            comboBox1.Invoke((MethodInvoker) delegate
            {
                name = comboBox1.Text;
            });
            num = ((!isLuyenLo) ? ttoffsetKX(name) : lloffsetKX(name));
            if (AutoClient.BaseMenu(player.HProcess) != 0)
            {
                do
                {
                    HookCall.CloseMenu(player.hWnd);
                    Thread.Sleep(100);
                    HookCall.CloseMenu(player.hWnd);
                }while (AutoClient.BaseMenu(player.HProcess) != 0);
            }
            HookCall.taykx5(player.hWnd, num, 78u);
            Thread.Sleep(700 - speed);
            listItem.AddRange(AutoClient.GetItemList(player.HProcess));
            if (num2 == 50)
            {
                num2 = 0;
                foreach (Player.Item item2 in listItem)
                {
                    if (item2.Name == "Thẻ Trải Nghiệm")
                    {
                        HookCall.UseItem(player.hWnd, item2.cot, item2.hang);
                        Thread.Sleep(20);
                        HookCall.SelectLineMenu(player.hWnd, 12u, AutoClient.MenuID(player.HProcess));
                        do
                        {
                            HookCall.CloseMenu(player.hWnd);
                            Thread.Sleep(10);
                            HookCall.CloseMenu(player.hWnd);
                        }while (AutoClient.BaseMenu(player.HProcess) != 0);
                    }
                }
            }
            int kxcap = GetCapKX(name);
            if (!listItem.Exists((Player.Item x) => x.Name.Contains("Tẩy Tâm Thạch cấp " + kxcap) && x.type == 2) && isTayTam)
            {
                foreach (Player.Item item3 in listItem)
                {
                    if (item3.Name == "Thẻ Trải Nghiệm")
                    {
                        for (int i = 0; i < 11; i++)
                        {
                            HookCall.UseItem(player.hWnd, item3.cot, item3.hang);
                            Thread.Sleep(20);
                            HookCall.SelectLineMenu(player.hWnd, 13u, AutoClient.MenuID(player.HProcess));
                            Thread.Sleep(20);
                            HookCall.SelectLineMenu(player.hWnd, 9u, AutoClient.MenuID(player.HProcess));
                            Thread.Sleep(20);
                        }
                        Thread.Sleep(100);
                        do
                        {
                            HookCall.CloseMenu(player.hWnd);
                            Thread.Sleep(100);
                            HookCall.CloseMenu(player.hWnd);
                        }while (AutoClient.BaseMenu(player.HProcess) != 0);
                    }
                }
            }
            if (!listItem.Exists((Player.Item x) => x.Name.Contains("Luyện Lô Thiết cấp " + kxcap) && x.type == 2) && isLuyenLo)
            {
                foreach (Player.Item item4 in listItem)
                {
                    if (item4.Name == "Thẻ Trải Nghiệm")
                    {
                        for (int j = 0; j < 11; j++)
                        {
                            HookCall.UseItem(player.hWnd, item4.cot, item4.hang);
                            Thread.Sleep(20);
                            HookCall.SelectLineMenu(player.hWnd, 13u, AutoClient.MenuID(player.HProcess));
                            Thread.Sleep(20);
                            HookCall.SelectLineMenu(player.hWnd, 9u, AutoClient.MenuID(player.HProcess));
                            Thread.Sleep(20);
                        }
                        Thread.Sleep(100);
                        do
                        {
                            HookCall.CloseMenu(player.hWnd);
                            Thread.Sleep(100);
                            HookCall.CloseMenu(player.hWnd);
                        }while (AutoClient.BaseMenu(player.HProcess) != 0);
                    }
                }
            }
            if (isTayTam && !listItem.Exists((Player.Item x) => x.Name.Contains("Tẩy Tâm Thạch cấp " + kxcap) && x.type == 8))
            {
                foreach (Player.Item item5 in listItem)
                {
                    if (item5.Name.Contains("Tẩy Tâm Thạch cấp " + kxcap) && item5.type == 2)
                    {
                        HookCall.PickNPutItem(player.hWnd, item5.type, item5.cot, item5.hang, 8u, 1u, 0u, AutoClient.AddressItemLocation(player.HProcess));
                        break;
                    }
                }
            }
            if (isLuyenLo && !listItem.Exists((Player.Item x) => x.Name.Contains("Luyện Lô Thiết cấp " + kxcap) && x.type == 8))
            {
                foreach (Player.Item item6 in listItem)
                {
                    if (item6.Name.Contains("Luyện Lô Thiết cấp " + kxcap) && item6.type == 2)
                    {
                        HookCall.PickNPutItem(player.hWnd, item6.type, item6.cot, item6.hang, 8u, 1u, 0u, AutoClient.AddressItemLocation(player.HProcess));
                        break;
                    }
                }
            }
            foreach (Player.Item item in listItem.Where((Player.Item x) => x.Name == name))
            {
                if (item.Name == name && item.type != 8 && isTayTam && !listItemOld.Exists((Player.Item x) => x.id == item.id) && item.type != 3)
                {
                    if ((item.itemdong1 == (int)numericUpDown1.Value || (int)numericUpDown1.Value == 0) && (item.itemdong2 == (int)numericUpDown2.Value || (int)numericUpDown2.Value == 0) && (item.itemdong3 == (int)numericUpDown3.Value || (int)numericUpDown3.Value == 0) && (GetOpKX(d1) == 0 || item.itemdong1_O == GetOpKX(d1)) && (GetOpKX(d2) == 0 || item.itemdong2_O == GetOpKX(d2)) && (GetOpKX(d3) == 0 || item.itemdong3_O == GetOpKX(d3)))
                    {
                        HookCall.taykx5(player.hWnd, num, 79u);
                        button2.Invoke((MethodInvoker) delegate
                        {
                            button2.Text = "Start";
                        });
                        isloop = false;
                        return;
                    }
                }
                else if (item.Name == name && item.type != 8 && isLuyenLo && !listItemOld.Exists((Player.Item x) => x.id == item.id) && item.type != 3 && (item.itemdong4 == (int)numericUpDown1.Value || (int)numericUpDown1.Value == 0) && (item.itemdong5 == (int)numericUpDown2.Value || (int)numericUpDown2.Value == 0) && (item.itemdong6 == (int)numericUpDown3.Value || (int)numericUpDown3.Value == 0) && (GetOpKX(d1) == 0 || item.itemdong4_O == GetOpKX(d1)) && (GetOpKX(d2) == 0 || item.itemdong5_O == GetOpKX(d2)) && (GetOpKX(d3) == 0 || item.itemdong6_O == GetOpKX(d3)))
                {
                    HookCall.taykx5(player.hWnd, num, 79u);
                    button2.Invoke((MethodInvoker) delegate
                    {
                        button2.Text = "Start";
                    });
                    isloop = false;
                    return;
                }
            }
            int num3 = 0;
            while (true)
            {
IL_0afe:
                HookCall.taykx5(player.hWnd, num, 80u);
                Thread.Sleep(500 - speed);
                foreach (Player.Item item7 in AutoClient.GetItemList(player.HProcess))
                {
                    if (item7.Name == name && item7.type != 1 && item7.type != 2 && item7.type != 3 && item7.type != 7 && item7.type != 8)
                    {
                        num3++;
                        goto IL_0afe;
                    }
                    if (num3 > 300)
                    {
                        button2.Invoke((MethodInvoker) delegate
                        {
                            button2.Text = "Start";
                        });
                        MessageBox.Show("LAGGGGGGGGGGGGGG!!!");
                        return;
                    }
                }
                break;
            }
            num2++;
        }
    }
Exemplo n.º 22
0
 public GameItem(AutoClient client)
 {
     this.Client = client;
 }
Exemplo n.º 23
0
    private void getMT()
    {
        int[] array = new int[4]
        {
            (int)numericUpDown3.Value,
            (int)numericUpDown4.Value,
            (int)numericUpDown5.Value,
            (int)numericUpDown6.Value
        };
        int num  = array[0];
        int num2 = 0;

        for (int i = 0; i < 4; i++)
        {
            if (array[i] > num)
            {
                num  = array[i];
                num2 = i;
            }
        }
        if (array[0] == 0 && array[1] == 0 && array[2] == 0 && array[3] == 0)
        {
            num2 = 4;
        }
        listView1.Items.Clear();
        listMT.Clear();
        List <Player.Item> list = new List <Player.Item>();

        switch (num2)
        {
        case 0:
            list.AddRange(from x in AutoClient.GetItemList(player.HProcess)
                          orderby x.MTdong1 descending
                          select x);
            break;

        case 1:
            list.AddRange(from x in AutoClient.GetItemList(player.HProcess)
                          orderby x.MTdong2 descending
                          select x);
            break;

        case 2:
            list.AddRange(from x in AutoClient.GetItemList(player.HProcess)
                          orderby x.MTdong3 descending
                          select x);
            break;

        case 3:
            list.AddRange(from x in AutoClient.GetItemList(player.HProcess)
                          orderby x.MTdong4 descending
                          select x);
            break;

        default:
            list.AddRange(from x in AutoClient.GetItemList(player.HProcess)
                          orderby x.phuluc descending
                          select x);
            break;
        }
        foreach (Player.Item item in list)
        {
            if (int.Parse(item.phuluc) != 0 && int.Parse(item.phuluc) < 5 && item.type == 2)
            {
                ListViewItem value = new ListViewItem(new string[7]
                {
                    item.Name,
                    item.thanh,
                    item.phuluc,
                    item.MTdong1,
                    item.MTdong2,
                    item.MTdong3,
                    item.MTdong4
                });
                listView1.Items.Add(value);
                listMT.Add(item);
            }
        }
    }
 public PlayerEntity(AutoClient client)
 {
     this.Address = client.EntityBaseAddress; //Address
     this.Client  = client;
 }
 public PlayerEntity(IntPtr Address, AutoClient client)
 {
     this.Address = Address;
     this.Client  = client;
 }
Exemplo n.º 26
0
 public void ThreadRunAutoClien()
 {
     while (!Exit && WinAPI.IsWindow(hWnd))
     {
         player.Address = AutoClient.AddressPlayer(player.HProcess);
         if (player.Name() != "" && player.Hp() != 0)
         {
             if (player.isSell && IsChecked && player.sellitemlist.Count > 0)
             {
                 foreach (Player.Item item in AutoClient.GetItemList(player.HProcess))
                 {
                     if (item.type != 2)
                     {
                         continue;
                     }
                     foreach (Player.Item item2 in player.sellitemlist)
                     {
                         if (item2.Name == item.Name)
                         {
                             HookCall.BanItem(hWnd, item.id);
                             break;
                         }
                     }
                 }
             }
             if (player.isBuff && IsChecked && (ulong)_time % 15uL == 0)
             {
             }
             if (IsChecked)
             {
                 HookCall.Uplvl(player.hWnd);
                 Thread.Sleep(10);
             }
             if (IsChecked && player.isKsTui)
             {
                 AutoClient.KsTui(this);
                 Thread.Sleep(10);
             }
             if (IsChecked && player.isBaoDanh)
             {
                 foreach (Player.NPCinfo nPC in AutoClient.GetNPCList(player.HProcess))
                 {
                     if (nPC.Name == player.NPCBB_Name && player.isDBCTC)
                     {
                         HookCall.ClickNpc(player.hWnd, nPC.id, player.Address);
                         Thread.Sleep(20);
                         HookCall.SelectLineMenu(player.hWnd, 0u, AutoClient.MenuID(player.HProcess));
                         Thread.Sleep(20);
                         HookCall.SelectLineMenu(player.hWnd, 0u, AutoClient.MenuID(player.HProcess));
                     }
                     if (nPC.Name == player.NPCBB_Name && !player.isDBCTC)
                     {
                         HookCall.ClickNpc(player.hWnd, nPC.id, player.Address);
                         Thread.Sleep(20);
                         if (player.CTP_Name == "Thôn Trang")
                         {
                             HookCall.SelectLineMenu(player.hWnd, 0u, AutoClient.MenuID(player.HProcess));
                             Thread.Sleep(20);
                             HookCall.SelectLineMenu(player.hWnd, 0u, AutoClient.MenuID(player.HProcess));
                         }
                         else if (player.CTP_Name == "Tài Nguyên")
                         {
                             HookCall.SelectLineMenu(player.hWnd, 1u, AutoClient.MenuID(player.HProcess));
                             Thread.Sleep(20);
                             HookCall.SelectLineMenu(player.hWnd, 1u, AutoClient.MenuID(player.HProcess));
                         }
                         else if (player.CTP_Name == "Pháo Đài")
                         {
                             HookCall.SelectLineMenu(player.hWnd, 2u, AutoClient.MenuID(player.HProcess));
                             Thread.Sleep(20);
                             HookCall.SelectLineMenu(player.hWnd, 2u, AutoClient.MenuID(player.HProcess));
                         }
                     }
                 }
             }
         }
         Thread.Sleep(100);
     }
 }
Exemplo n.º 27
0
 public void otrongcay()
 {
     while (player.isTrongCay)
     {
         List <Player.NPCinfo> nPCList = AutoClient.GetNPCList(player.HProcess);
         bool hG  = player.TrongCaylist.HG;
         bool bNN = player.TrongCaylist.BNN;
         bool bNL = player.TrongCaylist.BNL;
         if (nPCList.Exists((Player.NPCinfo x) => x.Name.Contains(player.Name() + " trồng ")))
         {
             foreach (Player.Item item in AutoClient.GetItemList(player.HProcess))
             {
                 if (item.Name == "Hạt giống" && hG)
                 {
                     HookCall.UseItem(player.hWnd, item.cot, item.hang);
                     Thread.Sleep(50);
                     HookCall.SelectLineMenu(player.hWnd, 0u, AutoClient.MenuID(player.HProcess));
                 }
                 if (item.Name == "Cây Bát Nhã nhỏ" && bNN)
                 {
                     HookCall.UseItem(player.hWnd, item.cot, item.hang);
                     Thread.Sleep(50);
                     HookCall.SelectLineMenu(player.hWnd, 0u, AutoClient.MenuID(player.HProcess));
                 }
                 if (item.Name == "Cây Bát Nhã lớn" && bNL)
                 {
                     HookCall.UseItem(player.hWnd, item.cot, item.hang);
                     Thread.Sleep(50);
                     HookCall.SelectLineMenu(player.hWnd, 0u, AutoClient.MenuID(player.HProcess));
                 }
             }
             foreach (Player.NPCinfo item2 in nPCList)
             {
                 if (item2.Name.Contains(player.Name() + " trồng "))
                 {
                     HookCall.ClickNpc(player.hWnd, item2.id, player.Address);
                     Thread.Sleep(50);
                     HookCall.SelectLineMenu(player.hWnd, 0u, AutoClient.MenuID(player.HProcess));
                 }
             }
         }
         else
         {
             foreach (Player.Item item3 in AutoClient.GetItemList(player.HProcess))
             {
                 if (item3.Name == "Hạt giống" && hG)
                 {
                     HookCall.UseItem(player.hWnd, item3.cot, item3.hang);
                     Thread.Sleep(50);
                     HookCall.SelectLineMenu(player.hWnd, 0u, AutoClient.MenuID(player.HProcess));
                 }
                 if (item3.Name == "Cây Bát Nhã nhỏ" && bNN)
                 {
                     HookCall.UseItem(player.hWnd, item3.cot, item3.hang);
                     Thread.Sleep(50);
                     HookCall.SelectLineMenu(player.hWnd, 0u, AutoClient.MenuID(player.HProcess));
                 }
                 if (item3.Name == "Cây Bát Nhã lớn" && bNL)
                 {
                     HookCall.UseItem(player.hWnd, item3.cot, item3.hang);
                     Thread.Sleep(50);
                     HookCall.SelectLineMenu(player.hWnd, 0u, AutoClient.MenuID(player.HProcess));
                 }
             }
         }
         Thread.Sleep(50);
         CloseMenu();
         Thread.Sleep(5000);
     }
 }