Sending keys to the game

02/20/2020 00:28 koefficiens#1
Hey guys, I just want to make a auto potion and item grabbing system.
I put the potions to the first slot (1) but when i try to send an input it does nothing...
I have tried keybd_event
like this in an infinite while
Code:
 keybd_event(0x31, 0, 0, 0);              // press the 1 key
            Sleep(100);
            keybd_event(0x31, 0, KEYEVENTF_KEYUP, 0); // let up the 1 key
And even SendInput but neither works for me... any suggestions? Thanks for the help <3
02/28/2020 11:30 Benhero#2
Already tried to run the programm as administrator?

Greetings