<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Поиск пикселя в активном и не активном окне одновременно]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=6697&amp;type=atom" />
	<updated>2012-01-20T19:46:06Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=6697</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск пикселя в активном и не активном окне одновременно]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=55845#p55845" />
			<content type="html"><![CDATA[<p>Спасибо за помощь <img src="//forum.script-coding.com/img/smilies/wink.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[lprooo]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27411</uri>
			</author>
			<updated>2012-01-20T19:46:06Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=55845#p55845</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск пикселя в активном и не активном окне одновременно]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=55843#p55843" />
			<content type="html"><![CDATA[<p>В общем после некоторых тестов, конечные варианты выполнения данной задачи у меня выглядят так:<br /></p><div class="codebox"><pre><code>CoordMode, Pixel
SetTimer, GetPixel, 100

GetPixel:
   PixelSearch,,, 69, 150, 563, 626, 0x08000E
   If !ErrorLevel
   {
      SoundPlay, % A_WinDir &quot;\Media\tada.wav&quot;
      Sleep, 750
   }
   PixelSearch,,, 719, 113, 1305, 626, 0x08000E
   If !ErrorLevel
   {
      SoundPlay, % A_WinDir &quot;\Media\ring.wav&quot;
      Sleep, 750
   }
   Return

F5::Reload
Esc::ExitApp</code></pre></div><div class="codebox"><pre><code>CoordMode, Pixel

Loop
{
   PixelSearch,,, 69, 150, 563, 626, 0x08000E
   If ErrorLevel=0
   {
      SoundPlay, %A_WinDir%\Media\tada.wav
      Sleep, 750
   }
   PixelSearch,,, 719, 113, 1305, 626, 0x08000E
   If ErrorLevel=0
   {
      SoundPlay, %A_WinDir%\Media\ring.wav
      Sleep, 750
   }
}
Return</code></pre></div><p>2 <strong>creature.ws</strong><br /></p><div class="quotebox"><cite>creature.ws пишет:</cite><blockquote><div class="codebox"><pre><code>#Persistent
...</code></pre></div></blockquote></div><p>В процессе работы в редакторе, предпочитаю использовать многострочный комментарий, отделяя ненужное от нужного, но всегда две последние строки у меня заканчиваются <em>хоткеями</em>:</p><div class="codebox"><pre><code>/*
...
*/

/*
...
*/

;/*
SetTimer, Lbl, 500

Lbl:
   TrayTip,, Hello world!
   Sleep, 250
   TrayTip
   Return
*/

/*
...
*/

/*
...
*/

/*
...
*/

/*
...
*/

F5::Reload
Esc::ExitApp</code></pre></div><p>По этому, могу сие и упустить. <img src="//forum.script-coding.com/img/smilies/wink.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[Grey]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25792</uri>
			</author>
			<updated>2012-01-20T18:11:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=55843#p55843</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск пикселя в активном и не активном окне одновременно]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=55833#p55833" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>
#Persistent
SetTimer, GetPixel, 100
 
GetPixel:
   CoordMode, Pixel, Relative
   PixelSearch,,, 69, 150, 563, 626, 0x08000E
   If !ErrorLevel
      SoundPlay, % A_WinDir &quot;\Media\tada.wav&quot;
   CoordMode, Pixel
   PixelSearch,,, 719, 113, 1305, 626, 0x08000E
   If !ErrorLevel
      SoundPlay, % A_WinDir &quot;\Media\ring.wav&quot;
   Return</code></pre></div><p><a href="http://www.script-coding.com/AutoHotkeyTranslation.html">AutoHotkeyTranslation</a></p>]]></content>
			<author>
				<name><![CDATA[creature.ws]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26105</uri>
			</author>
			<updated>2012-01-20T15:16:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=55833#p55833</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск пикселя в активном и не активном окне одновременно]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=55820#p55820" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>loop
{
CoordMode, Relative
pixelsearch, px, py, 69, 150, 563, 626, 0x08000e
if errorlevel = 0
SoundPlay, %A_WinDir%\Media\tada.wav
CoordMode, screen
pixelsearch, px, py, 719, 113, 1305, 626, 0x08000e
if errorlevel = 0
SoundPlay, %A_WinDir%\Media\ring.wav
}</code></pre></div><p>вот так вот работает просто их соединив. </p><p>А ваш способ работает один раз и потом выключается, а мне необходимо бесконечный поиск пока самому не выключить скрипт.</p>]]></content>
			<author>
				<name><![CDATA[lprooo]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27411</uri>
			</author>
			<updated>2012-01-20T06:36:55Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=55820#p55820</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск пикселя в активном и не активном окне одновременно]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=55813#p55813" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>SetTimer, GetPixel, 100

GetPixel:
   CoordMode, Pixel, Relative
   PixelSearch,,, 69, 150, 563, 626, 0x08000E
   If !ErrorLevel
      SoundPlay, % A_WinDir &quot;\Media\tada.wav&quot;
   CoordMode, Pixel
   PixelSearch,,, 719, 113, 1305, 626, 0x08000E
   If !ErrorLevel
      SoundPlay, % A_WinDir &quot;\Media\ring.wav&quot;
   Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Grey]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25792</uri>
			</author>
			<updated>2012-01-19T21:16:55Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=55813#p55813</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Поиск пикселя в активном и не активном окне одновременно]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=55807#p55807" />
			<content type="html"><![CDATA[<p>Вообщем имеется два окна(одно из них всегда активно другое нет) в обоих периодически появляется&nbsp; пиксел 0x08000e.Если пиксел найдется в активном окне то играет мелодия1(tada.wav) если пиксел найден в неактивном окне то мелодия2. У меня получилось найти пиксель в активном окне:</p><div class="codebox"><pre><code>loop
{
CoordMode, Relative
pixelsearch, px, py, 69, 150, 563, 626, 0x08000e
if errorlevel = 0
SoundPlay, %A_WinDir%\Media\tada.wav
}</code></pre></div><p>Подскажите как сделать чтобы он искал в двух окнах?<br />Эти два окна одинаковы и находятся рядом с друг другом одно с лева другое с права они не перекрывают друг друга.</p><p>Вот еще и в не активном сделал:</p><div class="codebox"><pre><code>loop
{
CoordMode, screen
pixelsearch, px, py, 719, 113, 1305, 626, 0x08000e

if errorlevel = 0

SoundPlay, %A_WinDir%\Media\ring.wav</code></pre></div><p>Осталось одна проблема как соединить их в один скрипт?</p>]]></content>
			<author>
				<name><![CDATA[lprooo]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27411</uri>
			</author>
			<updated>2012-01-19T16:18:54Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=55807#p55807</id>
		</entry>
</feed>
