Be a Supporter!

AutoIt v3 - Need Help!

  • 342 Views
  • 5 Replies
New Topic Respond to this Topic
EndGuardian
EndGuardian
  • Member since: May. 10, 2008
  • Offline.
Forum Stats
Member
Level 03
Blank Slate
AutoIt v3 - Need Help! 2008-06-05 16:40:13 Reply

$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
Response to AutoIt v3 - Need Help! 2008-06-05 16:44:29 Reply

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
Response to AutoIt v3 - Need Help! 2008-06-05 17:48:30 Reply

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
Response to AutoIt v3 - Need Help! 2008-06-05 17:49:42 Reply

Does it not work, or something? Part of it work? What?


"Sit down and shut up and do as I say" -- Zeus

BBS Signature
EndGuardian
EndGuardian
  • Member since: May. 10, 2008
  • Offline.
Forum Stats
Member
Level 03
Blank Slate
Response to AutoIt v3 - Need Help! 2008-06-05 17:51:48 Reply

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
Response to AutoIt v3 - Need Help! 2008-06-05 18:07:34 Reply

Is there a way I could select the current window and work with the width/height from there instead of the entire desktop?