Discussion:
Api with a game? Need lots of help here...
(too old to reply)
j***@gmail.com
2006-11-27 01:48:51 UTC
Permalink
Raw Message
Ok, here's the situation. There is a game called MapleStory and I am
trying to make a sort of a macro for it. The things it needs to be able
to do are:
- Move the mouse to coords x and y (I was able to do this)
- Click at the specified coords (for some reason this wouldn't work...)
- Press arrow keys, enter key, and escape key (need lots of help here,
keybd_event isn't working out too well)
- (all this being done without me doing anything)

Here's a sample of what I have for the cursor position and clicking.

SetCursorPos(691,589);
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
Sleep(100);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);

I got it to MOVE, but it never clicks...

And here's what I have tried to get it to automatically press a key.
keybd_event(VK_RIGHT,0,0 , 0);
keybd_event(VK_RIGHT,0,0 , 0);


And these don't work at all..

Any help/advice you could give me would be appreciated. By the way, I'm
14, and I'm a newbie so, if possible, explain things as much as you
can.


Also, when I press the button to activate it, I have to click on the
game... Is there something I have to do with SetForegroundWindow?

I don't even know how to use that though...

And there IS a 5 second delay so it does give me time to get back in
game...

Any help would be appreciated, and thanks for reading!
ThievingSIx
2006-12-26 08:08:45 UTC
Permalink
Raw Message
Post by j***@gmail.com
Ok, here's the situation. There is a game called MapleStory and I am
trying to make a sort of a macro for it. The things it needs to be able
- Move the mouse to coords x and y (I was able to do this)
- Click at the specified coords (for some reason this wouldn't work...)
- Press arrow keys, enter key, and escape key (need lots of help here,
keybd_event isn't working out too well)
- (all this being done without me doing anything)
Here's a sample of what I have for the cursor position and clicking.
SetCursorPos(691,589);
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
Sleep(100);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
I got it to MOVE, but it never clicks...
And here's what I have tried to get it to automatically press a key.
keybd_event(VK_RIGHT,0,0 , 0);
keybd_event(VK_RIGHT,0,0 , 0);
And these don't work at all..
Any help/advice you could give me would be appreciated. By the way, I'm
14, and I'm a newbie so, if possible, explain things as much as you
can.
Also, when I press the button to activate it, I have to click on the
game... Is there something I have to do with SetForegroundWindow?
I don't even know how to use that though...
And there IS a 5 second delay so it does give me time to get back in
game...
Any help would be appreciated, and thanks for reading!
Your first step is so disable nProtect/Gameguard. They were made to
prevent this sort of thing.

Loading...