d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Postmessage To A Game
Add Reply New Topic New Poll
Member
Posts: 37,344
Joined: Mar 31 2011
Gold: 1,333.33
Sep 22 2015 02:28pm
its a basketball game

to take a shot you press "d" and hold it down for ~ a sec to get in the green bar to make it more sucessfull

so i press "D"

spy++ tells me this

003D0A80 P WM_KEYDOWN nVirtKey'D'
003D0A80 P WM_CHAR chCharCode'100' (100)
003D0A80 P WM_KEYDOWN nVirtKey'D'
003D0A80 P WM_CHAR chCharCode'100' (100)
003D0A80 P WM_KEYDOWN nVirtKey'D'
003D0A80 P WM_CHAR chCharCode'100' (100)
003D0A80 P WM_KEYUP nVirtKey'D'


Code
[DllImport("user32.dll")] static extern bool PostMessage(IntPtr hWnd, uint Msg, int wParam, int lParam);



-->
Code
PostMessage(gHandle, 0x0100, 0x44, 0x200001);
PostMessage(gHandle, 0x0101, 0x44, 0x200001);
PostMessage(gHandle, 0x0102, 0x44, 0x200001);



this works in chat but not to take the shot

halp

This post was edited by Numberwanx on Sep 22 2015 02:44pm
Member
Posts: 37,344
Joined: Mar 31 2011
Gold: 1,333.33
Sep 22 2015 06:05pm
Code
PostMessage(gHandle, 0x0100, 0x44, 0x200001);

System.Threading.Thread.Sleep(31);
PostMessage(gHandle, 0x0100, 0x44, 0x200001);

System.Threading.Thread.Sleep(31);
PostMessage(gHandle, 0x0100, 0x44, 0x200001);

System.Threading.Thread.Sleep(31);
PostMessage(gHandle, 0x0100, 0x44, 0x200001);

System.Threading.Thread.Sleep(31);
PostMessage(gHandle, 0x0101, 0x44, 0x200001);


this generates the same spy++ messages as me holding "d" ingame

but my character doenst shoot

when i open the chatbox tho it writes "ddddd" in it

Go Back To Programming & Development Topic List
Add Reply New Topic New Poll