Page 1 of 1

I need help with a Radar code to search the Color of a pixel

Posted: 01 Feb 2023, 02:27
by mexican scientist
I asked ChatGpt AI this question:
is it possible to make a code in AHK that acts like a radar to search a pixel with color 0xFF0000 in a circle that changes radius and whose center is (108,521)
The AI answer yes and gave me this code

Code: Select all

Loop
{
  for (radius = 1; radius <= 100; radius++)
  {
    for (angle = 0; angle < 360; angle++)
    {
      x := 108 + radius * Cos(angle)
      y := 521 + radius * Sin(angle)
      color := PixelGetColor(x, y)
      if (color = 0xFF0000)
      {
        MsgBox Pixel found!
        break 2
      }
    }
  }
  Sleep, 1000
}

The syntax is all messed up and everytime I ask the AI does not understand me. I cannot ask the AI more questions now as I got a 1hr suspension for "asking too much"

Perhaps someone here can help me with this problem.

Re: I need help with a Radar code to search the Color of a pixel

Posted: 01 Feb 2023, 03:12
by boiler
@mexican scientist — Please do not post ChatGPT-generated code or that created by any other AI bot. Further occurrences will result in a loss of posting privileges. From the Forum Rules:
Currently, posts that are answering or asking for help that contain AI-generated code (such as ChatGPT) will not be accepted. The reasoning behind this is essentially the same as with StackOverflow.
This thread is locked.