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

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
mexican scientist
Posts: 33
Joined: 02 Jul 2020, 21:55

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

Post by mexican scientist » 01 Feb 2023, 02:27

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.

User avatar
boiler
Posts: 16926
Joined: 21 Dec 2014, 02:44

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

Post by boiler » 01 Feb 2023, 03:12

@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.

Locked

Return to “Ask for Help (v1)”