Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <Windows.h>
- using namespace std;
- CONST LPCSTR League_Class_Name = "RCLIENT";
- CONST LPCSTR Client_Class_Name = "CefBrowserWindow";
- CONST LPCSTR Game_Class_Name = "RiotWindowClass";
- void Click(HWND hwnd,int x, int y, char ButtonName[10], int AddTime)
- {
- tagPOINTS Click;
- Click.x = x;
- Click.y = y;
- PostMessage(hwnd, WM_LBUTTONDOWN, MK_LBUTTON, MAKELPARAM(Click.x, Click.y));
- PostMessage(hwnd, WM_LBUTTONUP, MK_LBUTTON, MAKELPARAM(Click.x, Click.y));
- cout << "Click sul tasto " << ButtonName << " alle coordinate x = " << Click.x << " y = " << Click.y << endl;
- Sleep(1000 + AddTime);
- return;
- }
- int main()
- {
- while (!GetAsyncKeyState(VK_ESCAPE))
- {
- HWND Leaguehwnd;
- HWND Clienthwnd;
- HWND LolGame;
- CHAR TargetNameClass[100];
- int MessageBox_Value;
- bool Exit;
- do
- {
- Exit = true;
- Leaguehwnd = FindWindow(League_Class_Name, NULL);
- Clienthwnd = FindWindowEx(Leaguehwnd, NULL, Client_Class_Name, NULL);
- if (!Clienthwnd)
- {
- cout << "Finestra non trovata...\n";
- MessageBox_Value = MessageBox(NULL, "Impossibile trovare l'handle di League Of Legends...", "Errore", MB_RETRYCANCEL);
- if (MessageBox_Value == IDCANCEL) goto ExitPoint;
- else Exit = false;
- }
- else
- {
- Clienthwnd = GetWindow(Clienthwnd, GW_CHILD);
- Clienthwnd = GetWindow(Clienthwnd, GW_CHILD);
- GetClassNameA(Clienthwnd, TargetNameClass, 99);
- cout << "Nome della classe trovata: " << TargetNameClass << endl;
- }
- } while (!Exit);
- cout << "Finestra trovata...\n";
- //CLICK------------------------------------------------------------------------------------------------------------------------
- Click(Clienthwnd, 144, 40, "play", 0);
- Click(Clienthwnd, 124, 97, "coop", 0);
- Click(Clienthwnd, 378, 262, "summoner rift", 0);
- Click(Clienthwnd, 539, 686, "confirm", 1000);
- Click(Clienthwnd, 534, 676, "queue", 4000);
- do
- {
- Click(Clienthwnd, 593, 544, "tasto accept", 4000);
- Click(Clienthwnd, 384, 131, "del champ", 4000);
- Click(Clienthwnd, 626, 578, "lock in", 4000);
- LolGame = FindWindow(Game_Class_Name, NULL);
- } while (!LolGame);
- do
- {
- LolGame = FindWindow(Game_Class_Name, NULL);
- cout << "In attesa della fine della partita...\n";
- Sleep(5000);
- } while (LolGame);
- Sleep(10000);
- Click(Clienthwnd, 534, 676, "confirm", 0);
- }
- ExitPoint:
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement