Esempio n. 1
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();
    }
Esempio n. 2
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);
     }
 }