Which windows version is the best for ahk and pixelgetcolor in particular?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Noya663
Posts: 2
Joined: 21 Jan 2022, 00:20

Which windows version is the best for ahk and pixelgetcolor in particular?

Post by Noya663 » 21 Jan 2022, 00:28

Hi guys,
I'm planning on making an old laptop I have to kind of a bot station.
I built a few bots based on ahk using the chrome.ahk library.
I need to reinstall windows in the laptop so I figured I'd ask- is there any windows version that works better with ahk? Cause for me it doesn't matter what version I install.
The bot focuses on detecting pixel in a specific coordinate on the screen if it matters.

If I'm at it so I would like to ask another question-
As part of the bot's cycle I need to detect if a certain dynamic div has appeared in a webpage and if it did- I need it to do a certain action asap. So I need to be alerted that the div appeared (by class name) immediately.
Right now I'm doing it kind of dumb- infinite loop checking if the class name exists if it does, do X, if it doesn't the loop restarts.
Is there a better way I'm not familiar of?

Thank for reading! I would really appreciate help

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Which windows version is the best for ahk and pixelgetcolor in particular?

Post by swagfag » 21 Jan 2022, 00:50

  1. if u wanna be lazy about it, windows7 with DWM disabled or any other pre-vista version. otherwise, use modern pixel retrieval methods
  2. monitor the parent element of where the div is meant to appear with a MutationObserver

Noya663
Posts: 2
Joined: 21 Jan 2022, 00:20

Re: Which windows version is the best for ahk and pixelgetcolor in particular?

Post by Noya663 » 21 Jan 2022, 01:00

swagfag wrote:
21 Jan 2022, 00:50
  1. if u wanna be lazy about it, windows7 with DWM disabled or any other pre-vista version. otherwise, use modern pixel retrieval methods
  2. monitor the parent element of where the div is meant to appear with a MutationObserver
Hi!
First of all thank you very much for answering.
Regarding the first answer, what difference will disabled dwm have? And why is it lazy?
Haha I'm sorry if it was a joke, my english isn't the best.
And I'll defentely try what you suggested in the second answer, so thanks again.

Have a great day

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Which windows version is the best for ahk and pixelgetcolor in particular?

Post by swagfag » 21 Jan 2022, 12:15

read
https://docs.microsoft.com/en-us/windows/win32/learnwin32/the-desktop-window-manager
https://docs.microsoft.com/en-us/windows/win32/dwm/dwm-overview

the cost of 1 GetPixelColor call is the time taken for dwm to composite ur entire screen(the larger the resolution, the worse it gets), whereas pre-vista(and win7 with dwm disabled) can access the pixel directly. if u dont use GetPixelColor, then none of this matters. but then u have to write ur own code

Post Reply

Return to “Ask for Help (v1)”