Vb.Net bot for a 2d game

11/24/2008 05:12 jaketheking1020#1
Hello. A friend and I are working on a Vb.net bot for a 2d game. We can make the bot fine but we are stuck on how exactly we would be able to detect the colors. If someone could tell me how I could detect colors on the entire screen it would really help us out. Thank you.
11/24/2008 10:25 wurstbrot123#2
Quote:
Originally Posted by jaketheking1020 View Post
Hello. A friend and I are working on a Vb.net bot for a 2d game. We can make the bot fine but we are stuck on how exactly we would be able to detect the colors. If someone could tell me how I could detect colors on the entire screen it would really help us out. Thank you.
You want the R G B of every Pixel ?
have you tryed a loop with getpixel and check if the R G B is the color ur searching ? :P
11/24/2008 20:25 mondesser#3
If you know the location of the pixel, call Winapi GetPixel.

If you want to find a certain pixel on the screen:
  1. Take screenshot, store it in a bitmap object.
  2. Use Lockbits on that bitmap.
  3. Run through the byte array using unsafe code and compare the colors...

[Only registered and activated users can see links. Click Here To Register...] is a good tutorial on Lockbits.