need help in autoit

04/09/2014 14:27 sanjok082#1
Hey
Im a newb in autoit, I dont know what comand i need, so i hope you guys help me..

Soo ive got my mouse coordinants, I want to mousedown on them and mouseup again only if a pixel colour appears. So it would need to wait for this colour.
Sounds pretty easy but i dont get it ;)
04/09/2014 14:37 alpines#2
Code:
MouseMove($x, $y)
MouseDown("left")
While Not (Hex(PixelGetColor($x2, $y2)) = 0x123456)
Sleep(100)
WEnd
MouseUp("left")
Replace the variables and the color with yours.
04/10/2014 18:12 sanjok082#3
Thanks!
Now i´ve got an other problem.
I want now to exitloop if it finds a color, but if there is the second color, (0xEEE2C7), on 86, 631 it should exitloop and click 2 more times instead.What am I doing wrong? ;)
Code:
While 1
Sleep(3800)
MouseClick("left", 1208, 549, 2)
$Variable = PixelSearch(0, 0, 51, 80,0x5D5D60)
$Variable2 = PixelSearch(0, 0, 86, 631,0xEEE2C7)
if IsArray($Variable) = true Then
ExitLoop
Elseif IsArray($Variable2) = true Then
   Exitloop
   Sleep(4000)
   MouseClick("left", 86, 631)
Sleep(500)
MouseClick("left", 244, 562, 2)
EndIf
EndIf
WEnd
04/10/2014 19:38 alpines#4
Switch the MouseClick("left", 86, 631) with the ExitLoop, because you exit the loop before you run the MouseClick command.