C++ Game Spammer Edited Code please help me resolving my problem
I made this code but it doesn't work.. i have learn C++ so i try to make this:
THis is my Problem:
#include <iostream>
#include <windows.h>
using namespace std;
int SpamNumber = 1000;
int SpamDelay = 100;
char *Game = "What Game ?";
HWND hwnd = FindWindow(0, Game);
char *Message[] = {
"\nTHE EPICLY AMAZING -- | <| -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- | <>| -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- | <><| -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- | <>< | -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- | <>< | -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- | <>< | -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- | <>< | -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- | <>< | -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- | <>< | -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- | <>< | -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- | <>< | -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- | <>< | -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- | <>< | -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- | <>< | -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- | <>< | -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- |<>< | -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- |>< | -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- |< | -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- | | -- OLYMPIC FISH!!\n"
};
void GameCheck();
void PressButton(HWND, BYTE);
void TypeText(HWND, char[]);
void SpamGame(HWND);
int main() {
while (true) {
Sleep(500);
GameCheck();
if (GetAsyncKeyState(VK_HOME)) { SpamGame(hwnd); }
if (GetAsyncKeyState(VK_END)) { break; }
}
return 0;
}
void GameCheck() {
if (!FindWindow(0, Game)) { MessageBox(0, "Game Window not found", " ", 0); exit(0); }
return;
}
void PressButton(HWND hwnd, BYTE vk) {
SendMessage(hwnd, vk, WM_KEYDOWN, 0);
PostMessage(hwnd, WM_CHAR, vk, 0);
SendMessage(hwnd, vk, WM_KEYUP, 0);
return;
}
void TypeText(HWND hwnd, char String[]) {
for (int x = 0; String[x] != 0; x++) { PressButton(hwnd, String[x]); }
return;
}
void SpamGame(HWND hwnd) {
int maxMessages = (sizeof Message) / (sizeof Message[0]);
for (int x = 0; x <= SpamNumber; x++) {
cout << "ITERATION: " << x << " out of: " << SpamNumber << endl;
if (GetAsyncKeyState(VK_INSERT)) { break; } /* Pause execution */
for (int NUMBER = 0; NUMBER < maxMessages; NUMBER++) {
if (GetAsyncKeyState(VK_END)) { return; } /* Exit prematurely */
TypeText(hwnd, Message[NUMBER]);
Sleep(SpamDelay);
}
}
return;
}
#include <windows.h>
using namespace std;
int SpamNumber = 1000;
int SpamDelay = 100;
char *Game = "What Game ?";
HWND hwnd = FindWindow(0, Game);
char *Message[] = {
"\nTHE EPICLY AMAZING -- | <| -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- | <>| -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- | <><| -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- | <>< | -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- | <>< | -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- | <>< | -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- | <>< | -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- | <>< | -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- | <>< | -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- | <>< | -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- | <>< | -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- | <>< | -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- | <>< | -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- | <>< | -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- | <>< | -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- |<>< | -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- |>< | -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- |< | -- OLYMPIC FISH!!\n",
"\nTHE EPICLY AMAZING -- | | -- OLYMPIC FISH!!\n"
};
void GameCheck();
void PressButton(HWND, BYTE);
void TypeText(HWND, char[]);
void SpamGame(HWND);
int main() {
while (true) {
Sleep(500);
GameCheck();
if (GetAsyncKeyState(VK_HOME)) { SpamGame(hwnd); }
if (GetAsyncKeyState(VK_END)) { break; }
}
return 0;
}
void GameCheck() {
if (!FindWindow(0, Game)) { MessageBox(0, "Game Window not found", " ", 0); exit(0); }
return;
}
void PressButton(HWND hwnd, BYTE vk) {
SendMessage(hwnd, vk, WM_KEYDOWN, 0);
PostMessage(hwnd, WM_CHAR, vk, 0);
SendMessage(hwnd, vk, WM_KEYUP, 0);
return;
}
void TypeText(HWND hwnd, char String[]) {
for (int x = 0; String[x] != 0; x++) { PressButton(hwnd, String[x]); }
return;
}
void SpamGame(HWND hwnd) {
int maxMessages = (sizeof Message) / (sizeof Message[0]);
for (int x = 0; x <= SpamNumber; x++) {
cout << "ITERATION: " << x << " out of: " << SpamNumber << endl;
if (GetAsyncKeyState(VK_INSERT)) { break; } /* Pause execution */
for (int NUMBER = 0; NUMBER < maxMessages; NUMBER++) {
if (GetAsyncKeyState(VK_END)) { return; } /* Exit prematurely */
TypeText(hwnd, Message[NUMBER]);
Sleep(SpamDelay);
}
}
return;
}
1>------ Build started: Project: Try Chat Spammer, Configuration: Debug Win32 ------
1>Compiling...
1>main.cpp
1>c:\documents and settings\raquel\my documents\visual studio 2008\projects\try chat spammer\try chat spammer\main.cpp(8) : error C2664: 'FindWindowW' : cannot convert parameter 2 from 'char *' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\documents and settings\raquel\my documents\visual studio 2008\projects\try chat spammer\try chat spammer\main.cpp(52) : error C2664: 'FindWindowW' : cannot convert parameter 2 from 'char *' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\documents and settings\raquel\my documents\visual studio 2008\projects\try chat spammer\try chat spammer\main.cpp(52) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [22]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>Build log was saved at "file://c:\Documents and Settings\Raquel\My Documents\Visual Studio 2008\Projects\Try Chat Spammer\Try Chat Spammer\Debug\BuildLog.htm"
1>Try Chat Spammer - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
1>Compiling...
1>main.cpp
1>c:\documents and settings\raquel\my documents\visual studio 2008\projects\try chat spammer\try chat spammer\main.cpp(8) : error C2664: 'FindWindowW' : cannot convert parameter 2 from 'char *' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\documents and settings\raquel\my documents\visual studio 2008\projects\try chat spammer\try chat spammer\main.cpp(52) : error C2664: 'FindWindowW' : cannot convert parameter 2 from 'char *' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\documents and settings\raquel\my documents\visual studio 2008\projects\try chat spammer\try chat spammer\main.cpp(52) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [22]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>Build log was saved at "file://c:\Documents and Settings\Raquel\My Documents\Visual Studio 2008\Projects\Try Chat Spammer\Try Chat Spammer\Debug\BuildLog.htm"
1>Try Chat Spammer - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========