<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: SetTimer, Loop, PixelSearch]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=13266&amp;type=atom" />
	<updated>2017-12-03T11:35:35Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=13266</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: SetTimer, Loop, PixelSearch]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=121908#p121908" />
			<content type="html"><![CDATA[<p>Спасибо, разобрался.</p>]]></content>
			<author>
				<name><![CDATA[solitarydemiurg]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38911</uri>
			</author>
			<updated>2017-12-03T11:35:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=121908#p121908</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: SetTimer, Loop, PixelSearch]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=121903#p121903" />
			<content type="html"><![CDATA[<p>Здравствуйте.<br />Есть следующий код (ищет черный пиксель по заданным координатам)<br /></p><div class="codebox"><pre><code>
CoordMode, Screen, Pixel
loop
{
Strt:
PixelSearch, Px, Py, 1055, 740, 1056, 740, 0x000000, 0
if ErrorLevel
{
Send {sc41} ;нажатие F7
goto Strt
}
else
Send {sc42} ;нажатие F8
}
</code></pre></div><p>Очень хочется, что бы выполнение скрипта начиналось и завершалось одной и той же клавишей, т.е. я нажимаю правый Alt (sc138) и до момента повторного нажатия в зависимости от наличия черного пикселя спамится либо F7, либо F8</p><p>На форуме нашёл вот такую конструкцию<br /></p><div class="codebox"><pre><code>
~*sc138:: SetTimer, Strt, % GetKeyState(&quot;sc138&quot;, &quot;T&quot;) ? -1 : &quot;Off&quot;
 
Strt:
	;тут должен быть PixelSearch
	SetTimer, Strt, % GetKeyState(&quot;sc138&quot;, &quot;T&quot;) ? -1 : &quot;Off&quot;
	Return
</code></pre></div><p>Но как бы не пробовал я совместить ничего не получается <img src="//forum.script-coding.com/img/smilies/sad.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[solitarydemiurg]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38911</uri>
			</author>
			<updated>2017-12-03T04:28:21Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=121903#p121903</id>
		</entry>
</feed>
