AutoIt v3 - Need Help!
- EndGuardian
-
EndGuardian
- Member since: May. 10, 2008
- Offline.
-
- Forum Stats
- Member
- Level 03
- Blank Slate
$width = @DesktopWidth/2.0645161
$height = @DesktopHeight/1.4457831
$pixel = PixelGetColor ($width, $height)
Do
$pixel = PixelGetColor($width, $height)
Until $pixel = 0x4F4F4F OR 0x4E4E4E
MouseClick("primary", $width, $height, 1)
Is there any reason that this script wouldn't detect the set pixel and then click once located?
- EndGuardian
-
EndGuardian
- Member since: May. 10, 2008
- Offline.
-
- Forum Stats
- Member
- Level 03
- Blank Slate
This is wrapped around my code, but from what I can tell there shouldn't be anything else messing with the $pixel code; yes $pixel is defined in Local.
#include <GUIConstantsEx.au3>
#include <EditConstants.au3>
Opt ("MouseClickDelay", 100)
Process()
Func Process()
Omiting for Security
EndFunc
- EndGuardian
-
EndGuardian
- Member since: May. 10, 2008
- Offline.
-
- Forum Stats
- Member
- Level 03
- Blank Slate
I've changed around the Do .. Until command to a While .. WEnd command, as well as changed the color code/type, but I still can't get it to detect the pixel. I'm trying to detect a pixel on (what I believe to be) a Java or SWF coded loading screen (for an application).
This is my current code.
#include <GUIConstantsEx.au3>
#include <EditConstants.au3>
Opt ("MouseClickDelay", 100)
Process()
Func Process()
$width = StringLeft (@DesktopWidth/2.1052631, 3)
$height = StringLeft (@DesktopHeight/1.4457831, 3)
$pixel = PixelGetColor($width, $height)
While $pixel <> 4802889
$pixel = PixelGetColor($width, $height)
WEnd
EndFunc
Any help would be greatly appreciated.
- OneWhoListens
-
OneWhoListens
- Member since: Aug. 23, 2006
- Offline.
-
- Forum Stats
- Member
- Level 27
- Blank Slate
Does it not work, or something? Part of it work? What?
- EndGuardian
-
EndGuardian
- Member since: May. 10, 2008
- Offline.
-
- Forum Stats
- Member
- Level 03
- Blank Slate
At 6/5/08 05:49 PM, OneWhoListens wrote: Does it not work, or something? Part of it work? What?
It won't detect the pixel color on the Java/SWF (or whatever it is) window. I think it's detecting the pixel directly behind the opened window (or in my case, my desktop).
I had it working yesterday, but I've jumbled the $pixel section which I've posted around a ton and now I've forgotten what I had originally.
- EndGuardian
-
EndGuardian
- Member since: May. 10, 2008
- Offline.
-
- Forum Stats
- Member
- Level 03
- Blank Slate
Is there a way I could select the current window and work with the width/height from there instead of the entire desktop?


