0
I would like to know how to compile this code (and in what language it was written)?
I found him in a Tibia Forum (Game) where the goal is to make an Automatic Login whenever you open the game.
I have no idea how to compile a code.
Code:
#include <iostream>
#include <Windows.h>
#include <string>
//Tibia 600 x 500 client default size
//Enter Game = 80x,300y
//OK button = 400, 350
int width = 0;
int height = 0;
RECT rect;
std::string login = "seulogin";
std::string password = "suasenha";
int main()
{
std::cout << "Searching Tibia..." << std::endl;
HWND hwndTibia = NULL;
while (hwndTibia == NULL)
{
hwndTibia = ::FindWindow(NULL, "Tibia");
}
if (hwndTibia)
{
std::cout << "Tibia found." << std::endl;
GetClientRect(hwndTibia, &rect);
width = rect.left - rect.right;
height = rect.bottom - rect.top;
std::cout << "Resolution : Width: " << width << " Height: " << height << std::endl;
//click Enter Game
SendMessage(hwndTibia, WM_LBUTTONDOWN, MK_LBUTTON, MAKELPARAM(80, 300));
Sleep(25);
SendMessage(hwndTibia, WM_LBUTTONUP, MK_LBUTTON, MAKELPARAM(80, 300));
Sleep(100);
////type login info, username/tab/password
if (login.size() > 0 && password.size() > 0)
{
for (char& l : login)
{
SendMessage(hwndTibia, WM_CHAR, (int)l, NULL);
}
SendMessage(hwndTibia, WM_CHAR, 9, NULL);
for (char& p : password)
{
SendMessage(hwndTibia, WM_CHAR, (int)p, NULL);
}
}
////click ok
Sleep(50);
SendMessage(hwndTibia, WM_LBUTTONDOWN, MK_LBUTTON, MAKELPARAM(320, 345));
Sleep(25);
SendMessage(hwndTibia, WM_LBUTTONUP, MK_LBUTTON, MAKELPARAM(320, 345));
}
return 0;
}