Problem with colors

01/01/2016 15:45 silversky7#1
Hi, I would like to create a program that would do something like this:

Check color in x-212 y-157 and if color = white click here(x,y), but if not - click (x,y) and check again color in x-212 y-157, check color untill = white

I've got something like this but it doesn't work
:confused:
Code:
$iTargetColor = 0xFFFFFF
  $color = PixelGetColor(122, 104)
    If $iTargetColor<>$color Then
			MouseClick("primary", 686, 583)
			ExitLoop 2
	Else
	   MouseClick("primary", 755, 618)
	EndIf
01/01/2016 16:21 Moneypulation#2
I assume you confused then and else. Also why are you using Exitloop if there is no loop in your code? Or isn't that the whole code?

PHP Code:
$iTargetColor 0xFFFFFF

While True
    $color 
PixelGetColor(122104)
    If (
$iTargetColor<>$colorThen
        MouseClick
("primary"755618)
    Else
        
MouseClick("primary"686583)
        
ConsoleWrite("white color found")
        
ExitLoop
    
EndIf
WEnd 
Make sure you bind a hotkey with a function that exits your script. MouseClicks in a loop can end badly :s