Advertisement Jump to content


This topic is now archived and is closed to further replies.


Tell me your colour, pixel...

This topic is 5342 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

OK. Im gonna use diablo 2 as an example again(as those who helped me on transparencies would know). Many of you would have already seen on of these Diablo 2 LOD bots, the kind that(for example) does rushes for you. The one im using, works like makes D2 run in an window, and moves the window in the upper left corner or my screen. After creating an game, it moves ur char around and kils monsters for you(very simply put).Here comes the clever needs to have an way to know where your char is, so it replaced some of d2''s tiles with green ones. When running the bot, it tests the pixels colours, and when it finds an green one, it knows roughly where it is. If this all sounds a little unclear to u, let me just ask my q. and get it over with.If i would wanna write an bot like this: 1) How would i test the colours of pixels outside my own prog.(lets say my prog uses either gdi''s getpixel or my own memory reading functionn and that it runs in widowed-mode ,next to the program of wich i will be testing the pixel colours). 2) How do i feed in keystrokes (or even mouseclicks) into this other program??

Share this post

Link to post
Share on other sites
1. GetPixel will work outside your window. (At least on 9x/ME, it''s possible that they limited it to the current window for 2000/XP)
2. For key presses, I use this code:

void SendKey(unsigned char key){

Mouse stuff:

void MoveMouse(int x,int y){
//Note that this only works at 1024x768.
//You can A. Get the res and plug it in here or
//B. Find another way to do this.
//(I''m pretty sure there is one, I just didn''t bother looking for too long)
float rx=x/1024.0f;
float ry=y/768.0f;
void ClickAt(int x,int y){

Hope this helps.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!