Advertisement
Guest User

Lol Auto Queuer

a guest
Jul 4th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <Windows.h>
  3. using namespace std;
  4.  
  5. CONST LPCSTR League_Class_Name = "RCLIENT";  
  6. CONST LPCSTR Client_Class_Name = "CefBrowserWindow";
  7. CONST LPCSTR Game_Class_Name = "RiotWindowClass";
  8.  
  9.  
  10. void Click(HWND hwnd,int x, int y, char ButtonName[10], int AddTime)
  11. {
  12.     tagPOINTS Click;
  13.  
  14.     Click.x = x;
  15.     Click.y = y;
  16.  
  17.     PostMessage(hwnd, WM_LBUTTONDOWN, MK_LBUTTON, MAKELPARAM(Click.x, Click.y));
  18.     PostMessage(hwnd, WM_LBUTTONUP, MK_LBUTTON, MAKELPARAM(Click.x, Click.y));
  19.  
  20.     cout << "Click sul tasto " << ButtonName << " alle coordinate x = " << Click.x << " y = " << Click.y << endl;
  21.    
  22.     Sleep(1000 + AddTime);
  23.  
  24.     return;
  25. }
  26.  
  27.  
  28. int main()
  29. {
  30.     while (!GetAsyncKeyState(VK_ESCAPE))
  31.     {
  32.  
  33.  
  34.         HWND Leaguehwnd;
  35.         HWND Clienthwnd;
  36.         HWND LolGame;
  37.         CHAR TargetNameClass[100];
  38.         int MessageBox_Value;
  39.         bool Exit;
  40.  
  41.         do
  42.         {
  43.             Exit = true;
  44.  
  45.  
  46.             Leaguehwnd = FindWindow(League_Class_Name, NULL);
  47.             Clienthwnd = FindWindowEx(Leaguehwnd, NULL, Client_Class_Name, NULL);
  48.  
  49.             if (!Clienthwnd)
  50.             {
  51.                 cout << "Finestra non trovata...\n";
  52.                 MessageBox_Value = MessageBox(NULL, "Impossibile trovare l'handle di League Of Legends...", "Errore", MB_RETRYCANCEL);
  53.  
  54.                 if (MessageBox_Value == IDCANCEL) goto ExitPoint;
  55.                 else Exit = false;
  56.             }
  57.             else
  58.             {
  59.                 Clienthwnd = GetWindow(Clienthwnd, GW_CHILD);
  60.                 Clienthwnd = GetWindow(Clienthwnd, GW_CHILD);
  61.                 GetClassNameA(Clienthwnd, TargetNameClass, 99);
  62.                 cout << "Nome della classe trovata: " << TargetNameClass << endl;
  63.             }
  64.  
  65.         } while (!Exit);
  66.  
  67.         cout << "Finestra trovata...\n";
  68.  
  69.         //CLICK------------------------------------------------------------------------------------------------------------------------
  70.  
  71.         Click(Clienthwnd, 144, 40, "play", 0);
  72.  
  73.         Click(Clienthwnd, 124, 97, "coop", 0);
  74.  
  75.         Click(Clienthwnd, 378, 262, "summoner rift", 0);
  76.  
  77.         Click(Clienthwnd, 539, 686, "confirm", 1000);
  78.  
  79.         Click(Clienthwnd, 534, 676, "queue", 4000);
  80.  
  81.         do
  82.         {
  83.             Click(Clienthwnd, 593, 544, "tasto accept", 4000);
  84.  
  85.             Click(Clienthwnd, 384, 131, "del champ", 4000);
  86.  
  87.             Click(Clienthwnd, 626, 578, "lock in", 4000);
  88.  
  89.             LolGame = FindWindow(Game_Class_Name, NULL);
  90.  
  91.         } while (!LolGame);
  92.  
  93.         do
  94.         {
  95.             LolGame = FindWindow(Game_Class_Name, NULL);
  96.  
  97.             cout << "In attesa della fine della partita...\n";
  98.             Sleep(5000);
  99.  
  100.         } while (LolGame);
  101.  
  102.         Sleep(10000);
  103.        
  104.         Click(Clienthwnd, 534, 676, "confirm", 0);
  105.     }
  106.  
  107. ExitPoint:
  108.  
  109.     system("PAUSE");
  110.     return 0;
  111. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement