View previous topic :: View next topic |
Author |
Message |
pozzum Newbie cheater Reputation: 0
Joined: 19 Jun 2015 Posts: 22
|
Posted: Fri May 06, 2016 1:51 pm Post subject: Game not Reading Virtual Key Presses? |
|
|
Hi there so I've been trying to build a quick lua script that will press a few buttons and fill a few values in between button presses.
I seem to have some trouble with the game not reading the key presses.
I am running on a 1 second timer
Code: | keyDown(13)
sleep(50)
keyUp(13)
|
until a menu change is detected.
When I go to windows it is pressing enter every second however when I go back to the game it doesn't seem to work. Has anyone encountered an issue like this?
The Game is WWE 2K16 for reference.
|
|
Back to top |
|
|
Redouane Master Cheater Reputation: 3
Joined: 05 Sep 2013 Posts: 363 Location: Algeria
|
Posted: Sun May 08, 2016 5:26 am Post subject: Re: Game not Reading Virtual Key Presses? |
|
|
pozzum wrote: | Hi there so I've been trying to build a quick lua script that will press a few buttons and fill a few values in between button presses.
I seem to have some trouble with the game not reading the key presses.
I am running on a 1 second timer
Code: | keyDown(13)
sleep(50)
keyUp(13)
|
until a menu change is detected.
When I go to windows it is pressing enter every second however when I go back to the game it doesn't seem to work. Has anyone encountered an issue like this?
The Game is WWE 2K16 for reference. |
use doKeyPress instead.
Code: | doKeyPress(VK_RETURN) |
in a timer, something like this:
Code: | t = createTimer(false);
t.Interval,t.onTimer = 1000,function(_t)
return doKeyPress(VK_RETURN);
end |
Another way would be to use sendMessage/postMessage to send a WM_KEYDOWN + WM_KEYUP to the target process (https://msdn.microsoft.com/en-us/library/windows/desktop/ff468861%28v=vs.85%29.aspx https://msdn.microsoft.com/en-us/library/windows/desktop/ms644950%28v=vs.85%29.aspx), not sure on how these messages are handled, but I've read that applications sometimes use peekMessage to handle keyboard events.
|
|
Back to top |
|
|
pozzum Newbie cheater Reputation: 0
Joined: 19 Jun 2015 Posts: 22
|
Posted: Sun May 08, 2016 1:35 pm Post subject: Re: Game not Reading Virtual Key Presses? |
|
|
Redouane wrote: | pozzum wrote: | Hi there so I've been trying to build a quick lua script that will press a few buttons and fill a few values in between button presses.
I seem to have some trouble with the game not reading the key presses.
I am running on a 1 second timer
Code: | keyDown(13)
sleep(50)
keyUp(13)
|
until a menu change is detected.
When I go to windows it is pressing enter every second however when I go back to the game it doesn't seem to work. Has anyone encountered an issue like this?
The Game is WWE 2K16 for reference. |
use doKeyPress instead.
Code: | doKeyPress(VK_RETURN) |
in a timer, something like this:
Code: | t = createTimer(false);
t.Interval,t.onTimer = 1000,function(_t)
return doKeyPress(VK_RETURN);
end |
Another way would be to use sendMessage/postMessage to send a WM_KEYDOWN + WM_KEYUP to the target process (https://msdn.microsoft.com/en-us/library/windows/desktop/ff468861%28v=vs.85%29.aspx https://msdn.microsoft.com/en-us/library/windows/desktop/ms644950%28v=vs.85%29.aspx), not sure on how these messages are handled, but I've read that applications sometimes use peekMessage to handle keyboard events. |
So I switched from dokeypress to the keydown / keyup both actually send the key to the system (if I go to notepad it will make new lines or type the characters)
So using sendmessage/postmessage is that something doable in lua or do I have to do assembly I'm not really sure, most of the programming I see for it is in C#. I imagine there would be some differences in the syntax and how things are defined.
I have a temporary hardware fix but it's limiting the usefulness of what I'm trying to do.
|
|
Back to top |
|
|
Redouane Master Cheater Reputation: 3
Joined: 05 Sep 2013 Posts: 363 Location: Algeria
|
Posted: Mon May 09, 2016 4:41 am Post subject: Re: Game not Reading Virtual Key Presses? |
|
|
pozzum wrote: |
So I switched from dokeypress to the keydown / keyup both actually send the key to the system (if I go to notepad it will make new lines or type the characters)
So using sendmessage/postmessage is that something doable in lua or do I have to do assembly I'm not really sure, most of the programming I see for it is in C#. I imagine there would be some differences in the syntax and how things are defined.
I have a temporary hardware fix but it's limiting the usefulness of what I'm trying to do. |
Of course, SendMessage is something to do in ASM, it's not hard to translate an example that uses the Windows API to ASM, again, I've never used that function, but if you have some code in another language, then maybe I can translate.
|
|
Back to top |
|
|
|