<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Синтаксическая проблема PixelSearch]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=10766</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=10766&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Синтаксическая проблема PixelSearch».]]></description>
		<lastBuildDate>Thu, 09 Jul 2015 21:14:49 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[AHK: Синтаксическая проблема PixelSearch]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=95201#p95201</link>
			<description><![CDATA[<div class="codebox"><pre><code>#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
Top := 538
Bot := 907
x2 := 499
x2_Var := x2
x2_Var_Numer := 1

Loop
{
        if x2_Var_Numer = 24
                {
                x2_Var = %x2%                                    
                x2_Var_Numer = 1                                
                }

        PixelSearch, Outx, Outy, x2_Var, Top, x2_Var, Bot, 0x0000FF,, fast                          ; red
        if ErrorLevel = 1
            {
            PixelSearch,,, x2_Var, Top, x2_Var, Bot, 0xFF0000,, fast                    ; blue
            if ErrorLevel = 0
                MsgBox, Ура
            }
        if ErrorLevel = 0
            {
            if x2_Var_Numer &lt; 24
            {
            x2_Var--                                    
            x2_Var_Numer++                                    
            }
            }


sleep, 150
}
Return</code></pre></div><p>Напрочь не хочет искать синий цвет, хотя отсутствие красного цвета обнаруживает. Подскажите как обойти это недоразумение.</p><p>Пока нашел решение такое:<br /></p><div class="codebox"><pre><code>Loop
{
        if x2_Var_Numer &gt; 24
                {
                x2_Var = %x2%                                    ; Установить координаты по X в начальное состояние
                x2_Var_Numer = 1                                ; Установить счетчик в исходное состояние (в начальные координаты, т.е. x2)
                }

        PixelSearch, Outx, Outy, x2_Var, Top, x2_Var, Bot, 0x0000FF,, fast                          ; red
        if ErrorLevel = 1
            {
            PixelSearch,,, x2_Var, Top, x2_Var, Bot, 0xFF0000,, fast                    ; blue
            if ErrorLevel = 0
                MsgBox, Ура
            }


            x2_Var--                                    ; Отнять координаты, чтобы ось X сдвинулась влево
            x2_Var_Numer++                                    ; Счетчик +1



sleep, 150
}
Return</code></pre></div><p>Но не понятно почему из-за ErrorLevel = 0 перестает работать корректно ErrorLevel = 1.</p><p>Добавлено:<br />Кстати, с Else все нормально работает!</p>]]></description>
			<author><![CDATA[null@example.com (Странникх)]]></author>
			<pubDate>Thu, 09 Jul 2015 21:14:49 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=95201#p95201</guid>
		</item>
	</channel>
</rss>
