001
05.12.2011, 16:25 Uhr
Napsta
|
Vielleicht habe ich mich falsch ausgedrückt, wenn ich auf Numpad4 drücke, dann greift er auf wörter() zu...
Ich weiß nicht ob das Hilft...
Hier der Ganze Quelltext:
C++: |
#include <iostream> #include <Windows.h> #include <conio.h> #include <fstream> #include <string> #include <ctime>
using namespace std;
fstream datei;
string eingelesen[20]; char einlesen[100]; int n = 0; short zufallszahl = 0;
void wörter() { srand((unsigned)time(NULL)); datei.open(L"wörter.cfg", ios_base::in);
while(!datei.eof()) { datei.get(einlesen, 100, '|'); eingelesen[n] = einlesen; datei.getline(einlesen, 0); n++; } zufallszahl = rand() % 4; eingelesen[zufallszahl] = einlesen; datei.close();
for(int i = 0; i == eingelesen[zufallszahl].length(); i++) { keybd_event((BYTE)VkKeyScan(einlesen[i]), 0, 0, 0); keybd_event((BYTE)VkKeyScan(einlesen[i]), 0, KEYEVENTF_KEYUP, 0); Sleep(40); } keybd_event(VK_RETURN, 0, 0, 0); }
void hello(const char hello[] = "THey Guys") { for(int i = 0; i <= 8; i++) { keybd_event((BYTE)VkKeyScan(hello[i]), 0, 0, 0); keybd_event((BYTE)VkKeyScan(hello[i]), 0, KEYEVENTF_KEYUP, 0); Sleep(40); } keybd_event(VK_RETURN, 0, 0, 0); }
void tun(const char tun[] = "TWas macht ihr gerade?") { for(int i = 0; i == 20; i++) { keybd_event((BYTE)VkKeyScan(tun[i]), 0, 0, 0); keybd_event((BYTE)VkKeyScan(tun[i]), 0, KEYEVENTF_KEYUP, 0); Sleep(25); } keybd_event(VK_RETURN, 0, 0, 0); }
void xd(const char xd[] = "TXD") { for(int i = 0; i == 2; i++) { keybd_event((BYTE)VkKeyScan(xd[i]), 0, 0, 0); keybd_event((BYTE)VkKeyScan(xd[i]), 0, KEYEVENTF_KEYUP, 0); Sleep(50); } keybd_event(VK_RETURN, 0, 0, 0); }
void lol(const char lol[] = "Tlol") { for(int i = 0; i == 3; i++) { keybd_event((BYTE)VkKeyScan(lol[i]), 0, 0, 0); keybd_event((BYTE)VkKeyScan(lol[i]), 0, KEYEVENTF_KEYUP, 0); Sleep(50); } keybd_event(VK_RETURN, 0, 0, 0); }
void bye(const char bye[] = "TBin Off") { for(int i = 0; i == 7; i++) { keybd_event((BYTE)VkKeyScan(bye[i]), 0, 0, 0); keybd_event((BYTE)VkKeyScan(bye[i]), 0, KEYEVENTF_KEYUP, 0); Sleep(30); } keybd_event(VK_RETURN, 0, 0, 0); }
int main() { cout << " \\|||/\n" << " (o o)\n" << ",~~~ooO~~(_)~~~~~~~~~,\n" << "| Napstas |\n" << "| Keybinder 2011 |\n" << "| v.1.0 |\n" << "'~~~~~~~~~~~~~~ooO~~~'\n" << " |__|__|\n" << " || ||\n" << " ooO Ooo\n";
cout << "Numpad1 = Hey guys\n" << "Numpad2 = Was macht ihr gerade?\n" << "Numpad3 = Bin off" << "/ = xd\n" << "* = lol\n" << "Ende = Keybinder Aktivieren/deactivieren";
bool active = true; const char activated[] = "TEasy Keybinding has been turned off"; // 36 const char deactivated[] = "TEasy Keybinding has been turned on"; //35
labelA:
while(!active) { if(GetKeyState(VK_END) & (0x8000)) { active = true; for(int i = 0; i <= 34; i++) { keybd_event((BYTE)VkKeyScan(deactivated[i]), 0, 0, 0); keybd_event((BYTE)VkKeyScan(deactivated[i]), 0, KEYEVENTF_KEYUP, 0); Sleep(10); } keybd_event(VK_RETURN, 0, 0, 0); } }
while(active) { if(GetKeyState(VK_NUMPAD1) & (0x8000)) { hello(); } else if(GetKeyState(VK_NUMPAD2) & (0x8000)) { tun(); } else if(GetKeyState(VK_DIVIDE) & (0x8000)) { xd(); } else if(GetKeyState(VK_MULTIPLY) & (0x8000)) { lol(); } else if(GetKeyState(VK_NUMPAD3) & (0x8000)) { bye(); } else if(GetKeyState(VK_END) & (0x8000)) { active = false; for(int i = 0; i <= 35; i++) { keybd_event((BYTE)VkKeyScan(activated[i]), 0, 0, 0); keybd_event((BYTE)VkKeyScan(activated[i]), 0, KEYEVENTF_KEYUP, 0); Sleep(10); } keybd_event(VK_RETURN, 0, 0, 0); goto labelA; } else if(GetKeyState(VK_NUMPAD4) & (0x8000)) { wörter(); } else { Sleep(10); } } }
|
|