p r i m e Guest
Offline
|
Posted: Tue Jul 08, 2003 10:51 am Post subject: sendmessage help |
 |
|
|
|
i'd be lucky to receive an answer, but i'd be as much grateful for some hypothesis.
ok i'm sending keypresses from my bot to the game client window to perform actions. everything works fine for ports, warps, decoys, thors, rockets and attach.
using combinations of sendmessages, postmessages and sleep(), i can perform the above actions in different predefined sequences. (e.g. set port, rocket, fire 3 thors, warp, drop decoy, etc...)
the problem is that now i'm stuck on making the following happen: forward, back, left, right, repel, bomb, gun.
using Spy++, the keypresses i send are exactly identical in every paramater available (after learning about LPARAM) as those being physically pressed and as reported by the client.
for example, i press the TAB key in-game and a bomb is fired:
WM_KEYDOWN NVIRTKEY:VK_TAB CREPEAT:1 SCANCODE:0F FEXTENDED:0 FALTDOWN;0 FREPEAT:0 FUP:0 [WPARAM: 00000009 LPARAM: 000F0001] |
the above result is exactly replicated by my code's keypress with the structure of:
LRESULT SendMessage(
HWND hWnd, // Handle of destination window
UINT Msg, // Message to send
WPARAM wParam, // First message parameter
LPARAM lParam); // Second message parameter |
using sendmessage, i get an LResult: 00000001, which i believe means the key was successfully sent.
fyi, to make sure, i tried remapping the bomb (et al.) to other keys, altered the code and still no success.
to summarize a bit:
tried combinations of sendmessage, postmessage and sleep = no effect
tried remapping keys: what consistently happens is that what WORKED before remap works, what HASN'T before still doesn't afterwards
the output of Spy++ shows exactly identical messages from keystroke and simulated keystroke, yet still no bombs and the rest
half the stuff works consistently (thors, etc..), the other half fails consistently (repels, etc..).
it confounds me that, while i am new at this, i still can't think of a reasonable explanation as to why i can't fire a bomb by simulated keypress (yes, i did try Sleep () between keyup|keydown).
any suggestions/hypothesis/help would be appreciated.
cheers |
|