<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Функция не возвращает ErrorLevel отличный от нуля.]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=14930&amp;type=atom" />
	<updated>2019-08-18T08:52:23Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=14930</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Функция не возвращает ErrorLevel отличный от нуля.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=135692#p135692" />
			<content type="html"><![CDATA[<p>Спасибо большое, исправил, все работает с:</p>]]></content>
			<author>
				<name><![CDATA[guildkafra]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40126</uri>
			</author>
			<updated>2019-08-18T08:52:23Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=135692#p135692</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Функция не возвращает ErrorLevel отличный от нуля.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=135691#p135691" />
			<content type="html"><![CDATA[<p><strong>guildkafra</strong>, ничего не понятно. Вижу функцию, но так, как тут, она работать не может, между названием и круглыми скобками пробела быть не должно.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-08-18T08:41:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=135691#p135691</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Функция не возвращает ErrorLevel отличный от нуля.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=135689#p135689" />
			<content type="html"><![CDATA[<p>При отсутствии изображения на экране, функция должна выполнить условие, но она возвращает только ErrorLevel = 0 (все остальные ErrorLevel отличные от нуля он игнорирует)<br />До этого использовал &quot; #Include functions.ahk &quot;, встретился точно с такой же проблемой, пришлось поэтапно разбирать что не так. (Могу скинуть предыдущие попытки, чтобы мне смогли их также разъяснить)</p><div class="codebox"><pre><code>#SingleInstance, Force
SetWorkingDir, %A_ScriptDir%

$!q::
    ifWinActive, ahk_class TestWindow ; (Наименование класса не важно, должно подходить любое окно по желанию)
        Loop
        {    
        Sleep, 15    
        IfWinNotActive, ahk_class TestWindow ; (Наименование класса не важно, должно подходить любое окно по желанию)
            break   
        
        Sleep, 100
        if GetKeyState(&quot;=&quot;, &quot;P&quot;) 
            break
        
        CoordMode, Pixel, Screen
        CoordMode, Mouse, Screen
        
        imagepath = D:\AHK\Test\TestImage.png
        SearchImage (imagepath)
            if (ErrorLevel = 2)
                MsgBox Could not conduct the search.
            else if (ErrorLevel = 1)
                {
                    Send, {F8}
                    Sleep, 25
                }  
        
        setkeydelay 0 
        #MaxHotKeysPerInterval 2500 
        }
    return
return

SearchImage (imagepath)
{
    
ImageSearch, FoundX, FoundY, 1855, 187, 1950, 1024, *50 %imagepath% ; Ищет изображение в правой части экрана.
return Errorlevel

}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[guildkafra]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40126</uri>
			</author>
			<updated>2019-08-18T08:18:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=135689#p135689</id>
		</entry>
</feed>
