Results 1 to 1 of 1
  1. #1
    XxharCs
    XxharCs is offline
    Guest
    Join Date
    2012 Jun
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Help with SendInput()

    Hi,
    when i use the SendInput function it doesn´t work correctly. In the lobby of the game it presses normaly F5, W, and E, but when i start the match it doesn´t.

    I was thinking about that the game uses hooks for the function but i don´t think so because then it wouldn´t work in the lobby or ?

    Here is my code, i hope you can help me
    PS: i also tried it with keybd_event

    Code:
    #include <iostream>
    #include <Windows.h>
    
    
    #define WIN32_LEAN_AND_MEAN
    
    using namespace std;
    
    bool State = false;
    
    void botting()
    {
    	if(State)
    	{
    		/*
    		keybd_event(VK_F5, 0x3F, KEYEVENTF_EXTENDEDKEY, 0);
    		Sleep(1000);
    		keybd_event(0x57, 0x11, KEYEVENTF_EXTENDEDKEY, 0);
    		Sleep(1000);
    		keybd_event(0x45, 0x12, KEYEVENTF_EXTENDEDKEY, 0);
    		Sleep(1000);*/
    
    		
    		INPUT Input;
    		Input.type = INPUT_KEYBOARD;
    		Input.ki.dwFlags = KEYEVENTF_SCANCODE;
    		Input.ki.wScan = 0x3F;
    		Input.ki.time = 1000;
    		SendInput(true, &Input, sizeof(Input));
    		
    
    		INPUT Input1;
    		Input1.type = INPUT_KEYBOARD;
    		Input1.ki.dwFlags = KEYEVENTF_SCANCODE;
    		Input1.ki.wScan = 0x11;
    		Input1.ki.time = 1000;
    		SendInput(true, &Input1, sizeof(Input1));
    		
    
    		INPUT Input2;
    		Input2.type = INPUT_KEYBOARD;
    		Input2.ki.dwFlags = KEYEVENTF_SCANCODE;
    		Input2.ki.wScan = 0x12;
    		Input2.ki.time = 1000;
    		SendInput(true, &Input2, sizeof(Input2));
    		
    
    	}else{
    
    		/*
    		keybd_event(VK_F5, 0xBF, KEYEVENTF_KEYUP, 0);
    		Sleep(1000);
    		keybd_event(0x57, 0x91, KEYEVENTF_KEYUP, 0);
    		Sleep(1000);
    		keybd_event(0x45, 0x92, KEYEVENTF_KEYUP, 0);
    		Sleep(1000);*/
    
    		// -----------------------F5-------------------------
    		
    		INPUT Input;
    		Input.type = INPUT_KEYBOARD;
    		Input.ki.wScan = 0xBF;
    		
    		Input.ki.dwFlags = KEYEVENTF_KEYUP;
    
    		SendInput(true, &Input, sizeof(Input));
    
    		// -----------------------W--------------------------
    
    		INPUT Input1;
    		Input1.type = INPUT_KEYBOARD;
    		Input1.ki.wScan = 0x91;
    		
    		Input1.ki.dwFlags = KEYEVENTF_KEYUP;
    
    		SendInput(true, &Input1, sizeof(Input1));
    
    		// -----------------------E--------------------------
    		
    		INPUT Input2;
    		Input2.type = INPUT_KEYBOARD;
    		Input2.ki.wVk = 0x92;
    		
    		Input2.ki.dwFlags = KEYEVENTF_KEYUP;
    
    		SendInput(true, &Input2, sizeof(Input2));
    
    	}
    }
    
    DWORD WINAPI BotThread(LPVOID unused)
    {
    	for( ; ; ){
    
    		botting();
    		if(GetAsyncKeyState(VK_F1)&1)State =! State;
    		
    		Sleep(10);
    	}
    }
    
    BOOL WINAPI DllMain(HINSTANCE mod, DWORD DWORD_GRUND, LPVOID res)
    {
    	switch(DWORD_GRUND)
    	{
    	case DLL_PROCESS_ATTACH:
    		MessageBoxA(NULL, "Sucessfully Injected!", "Info", MB_OK);
    		CreateThread(0, 0, &BotThread , 0, 0, 0);
    		break;
    	}
    	return TRUE;
    }

Visitors found this page by searching for:

keybd_event KEYEVENTF_SCANCODE

c input_keyboard

input.ki.wscan

c input.ki

sendinput input_keyboard f5

keybd_event game

sendinput games sleep

type = input_keyboard

c sendinput not working in game

sendinput sleep

keyeventf_scancode keyeventf_keyup sendinput

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •