Jump to content

Recommended Posts

Posted

I am wondering if it is possible to PixelGetColor independent of the current client window resolution? For instance, I can make a script that works flawlessly at 1024x768 resolution, but if someone wants to run the game in a different res setting then the script won't work. I thought I had this licked by doing the following with my PixelGetColors:

if WinActivate("World of Warcraft","") = 1 then
        $size = WinGetClientSize("World of Warcraft")
        $clientWidth = $size[0]
        $clientHeight = $size[1]
    Else
        MsgBox(64,"Not Active","WoW does not appear to be active at this time.  Please start WoW and try again.")
        Exit(0)
    EndIf

Then in all my PixelGetColor statements I would do this:

$var = PixelGetColor(Round(($clientWidth*370)/1024), Round(($clientHeight*81)/768))

The actual x.y coord is 370,81 at 1024x768 so I figured using the ole ratio math I could find the same pixel at any other resolution. However, this does not work. The x coord works out but for some reason then y coord is off. Granted I thought this would work on any resolution that maintained the same aspect ratio but it doesn't. For instance, when I change to 800x600 the y coord is off by something like 12 pixels or so. Any ideas other than make anyone who wants to use the script use 1024x768 only?

  • Moderators
Posted

Use Client Coords and Opt('PixelCoordMode', 2).

(You're AutoInfo Tool can be changed to Client coords under options / coord mode)

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...