<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; Клики по очереди]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=9741&amp;type=atom" />
	<updated>2017-01-18T00:47:03Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=9741</id>
		<entry>
			<title type="html"><![CDATA[Re: Клики по очереди]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=111204#p111204" />
			<content type="html"><![CDATA[<p><strong>serzh82saratov</strong>, подскажите, пожалуйста, как в Вашем сценарии добавить к поиску ряд изображений вместо одного?</p>]]></content>
			<author>
				<name><![CDATA[becauseim]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33149</uri>
			</author>
			<updated>2017-01-18T00:47:03Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=111204#p111204</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Клики по очереди]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=84582#p84582" />
			<content type="html"><![CDATA[<p><a href="http://ahkscript.org/download/ahk-install.exe">http://ahkscript.org/download/ahk-install.exe</a></p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2014-07-06T20:06:48Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=84582#p84582</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Клики по очереди]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=84580#p84580" />
			<content type="html"><![CDATA[<p>Последний код&nbsp; ругается на </p><div class="quotebox"><blockquote><p>For k, v in SeveralSearch(0, 0, 1366, 768, &quot;*49 D:\Search.png&quot;)</p></blockquote></div><p>и предпоследний тоже ... не нонятна=(</p>]]></content>
			<author>
				<name><![CDATA[ignor31]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32386</uri>
			</author>
			<updated>2014-07-06T19:18:47Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=84580#p84580</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Клики по очереди]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=84567#p84567" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>Вы уверены что оно будет в принципе находить все такие зелёные пятна, обратите внимание что они все неоднородны.</p></blockquote></div><p>Вообщем с такой картинкой, на вашей находит.</p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header"><strong>+</strong>&nbsp;code</div><div class="fancy_spoiler"><div class="codebox"><pre><code>
#SingleInstance Force
#Persistent
#NoEnv
ListLines Off
SetBatchLines -1
CoordMode, Pixel
CoordMode, Mouse

Gui -DPIScale -Caption +HWNDhGui
Gui Margin, 0, 0
Gui Add, Picture, vPicture, Новый точечный рисунок.png
Gui Show, x100 y100 w1300 h725

1:: 
	For k, v in SeveralSearch(100, 100, 1300, 725, &quot;*49 tz.bmp&quot;)
		Click % v[1]+10 &quot; &quot; v[2]+5
	Return

SeveralSearch(ix1, iy1, w, h, file)  {
	StartTime := A_TickCount
	x1 := ix1, y1 := iy1, x2 := ix1 + w - 1, y2 := iy1 + h - 1
	prY := y2, ErrorCount := 0, Coords := []
	Loop
	{
		ImageSearch, mX, mY, x1, y1, x2, y2, %file%
		If (ErrorLevel &amp;&amp; ++ErrorCount &gt; 1)
			Break
		If (mY = &quot;&quot; || mY &gt; prY)
			x1 := ix1, y1 += 1, prY := y2
		Else
			x1 := mX + 1, ErrorCount := 0, y1 := mY, prY := mY, Coords.Push([mX, mY])
	}
	MsgBox % &quot;Найдено: &quot; coords.MaxIndex()
        . &quot;`nЗа: &quot; A_TickCount - StartTime &quot;msec&quot;
	Return Coords
}
 
Esc::
	ExitApp
</code></pre></div></div></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2014-07-06T08:35:04Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=84567#p84567</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Клики по очереди]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=84560#p84560" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>не вижу другого способа, кроме как &quot;прикрывать&quot; найденные картинки для поиска следующей.</p></blockquote></div><p>Хотя нет, появилась такая идея:<br /></p><div class="codebox"><pre><code>
#SingleInstance Force
#Persistent
#NoEnv
ListLines Off
SetBatchLines -1
CoordMode, Pixel
CoordMode, Mouse

Gui -DPIScale -Caption +HWNDhGui
Gui Margin, 0, 0
Gui Add, Picture, vPicture, Новый точечный рисунок.png
Gui Show, x100 y100 w1300 h725

1:: 
	For k, v in SeveralSearch(100, 100, 1300, 725, &quot;tz.bmp&quot;)
		Click % v[1]+10 &quot; &quot; v[2]+5
	Return

SeveralSearch(ix1, iy1, w, h, file)  {
	x1 := ix1, y1 := iy1, x2 := ix1 + w - 1, y2 := iy1 + h - 1
	prY := y2, ErrorCount := 0, Coords := []
	Loop
	{
		ImageSearch, mX, mY, x1, y1, x2, y2, %file%
		If (ErrorLevel &amp;&amp; ++ErrorCount &gt; 1)
			Break
		If (mY = &quot;&quot; || mY &gt; prY)
			x1 := ix1, y1 += 1, prY := y2
		Else
			x1 := mX + 1, ErrorCount := 0, y1 := mY, prY := mY, Coords.Push([mX, mY])
	}
	Return Coords
}
 
Esc::
	ExitApp
</code></pre></div><p>Картинки с предыдущего поста.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2014-07-05T14:44:26Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=84560#p84560</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Клики по очереди]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=84553#p84553" />
			<content type="html"><![CDATA[<p>Если представить что картинки всё же одинаковые, то Я например, в такой казалось бы тривиальной задаче, не вижу другого способа, кроме как &quot;прикрывать&quot; найденные картинки для поиска следующей.<br />Необходимые для работы кода картинки, в аттаче.<br /></p><div class="codebox"><pre><code>
Gui -DPIScale -Caption +HWNDhGui
Gui Margin, 0, 0
Gui Add, Picture, vPicture, C:\Users\sergey\Desktop\Новый точечный рисунок.bmp
Gui Show, x0 y0

1::
    Gui 2: -Caption +AlwaysOnTop +E0x08000000 +E0x20 +Lastfound -DPIScale 
    DllCall(&quot;Dwmapi\DwmIsCompositionEnabled&quot;, &quot;UInt*&quot;, isEnabled)
    If isEnabled
    {
        Gui 2: Color, 000000
        WinSet, TransColor, 000000 250
    }
    Gui 2: Show, NA x0 y0 w%A_ScreenWidth% h%A_ScreenHeight%
    coords := [], prY := y1 := 0 
    Loop
    {
        ImageSearch, mX, mY, 0, y1, A_ScreenWidth, A_ScreenHeight, C:\Users\sergey\Desktop\tz.bmp
        If ErrorLevel
            Break
        Gui 2: Add, Progress, % &quot;x&quot; mX &quot; y&quot; mY &quot; h&quot; 11 &quot; w&quot; 20 &quot; BackgroundD27429F&quot;
        coords[A_Index] := [mX, mY], y1 := mY &gt; prY ? mY : y1, prY := mY 
        Sleep -1 
    } 
    Gui 2: Destroy 
    For k, v in coords
        Click % v[1]+10 &quot; &quot; v[2]+5
    Return
</code></pre></div><p> АП:<br />На Win 7 работает только с включенным Аеро, пока сам не знаю почему так. </p><p> АП:<br />С выключенным Аеро работает, если, как ни странно, удалить эти строки </p><div class="codebox"><pre><code>    Gui 2: Color, 000000
    WinSet, TransColor, 000000 250</code></pre></div><p> АП:<br />Поправил код, чтобы учитывалось Аеро. </p><p> АП:<br /></p><div class="quotebox"><blockquote><p>&quot;прикрывать&quot; найденные картинки</p></blockquote></div><p>Но лучше наверное, такие &quot;нашлёпки&quot; делать с помощью GDI.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2014-07-05T08:29:14Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=84553#p84553</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Клики по очереди]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=84545#p84545" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>ignor31 пишет:</cite><blockquote><p>Дело в том что после клика объект не пропадает..</p></blockquote></div><div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>Во втором посте уже осуществлена.</p></blockquote></div><p>Сомневаюсь что этот код как то может решить вопрос.<br /></p><div class="codebox"><pre><code>x::
ErrorLevel = 0
n = 1
while (!ErrorLevel)
{
   PixelSearch, Px%n%, Py%n%, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, 0x01CD01, 0, fast
   n++
}
while (A_index &lt; n)
   Click, % Px%A_index% &quot;, &quot; Py%A_index%
return</code></pre></div><div class="quotebox"><cite>ignor31 пишет:</cite><blockquote><p>Написал код используя ImageSearch</p></blockquote></div><p>Вы уверены что оно будет в принципе находить все такие зелёные пятна, обратите внимание что они все неоднородны.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2014-07-05T04:48:27Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=84545#p84545</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Клики по очереди]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=84543#p84543" />
			<content type="html"><![CDATA[<p>Значит что-то неправильно делаете.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2014-07-04T22:49:18Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=84543#p84543</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Клики по очереди]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=84523#p84523" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>Во втором посте уже осуществлена.</p></blockquote></div><p>Возможно, но не 2ой пост не тот же код с ImageSearch не дают результата..</p>]]></content>
			<author>
				<name><![CDATA[ignor31]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32386</uri>
			</author>
			<updated>2014-07-04T17:21:18Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=84523#p84523</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Клики по очереди]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=84497#p84497" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>пока писал это , пришла в голову мысль.. Сканирования&nbsp; экрана на наличие искомого изображения , запись кординат далее клики по ним. Помогите Осуществить</p></blockquote></div><p>Во втором посте уже осуществлена.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2014-07-04T08:13:33Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=84497#p84497</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Клики по очереди]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=84489#p84489" />
			<content type="html"><![CDATA[<p>Доброго времени суток еще раз.<br />Написал код используя ImageSearch, но мне не как не приходит в голову как написать последовательность кликов по результатам. Дело в том что после клика объект не пропадает..&nbsp; пока писал это , пришла в голову мысль.. Сканирования&nbsp; экрана на наличие искомого изображения , запись кординат далее клики по ним. Помогите Осуществить</p>]]></content>
			<author>
				<name><![CDATA[ignor31]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32386</uri>
			</author>
			<updated>2014-07-04T02:22:49Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=84489#p84489</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Клики по очереди]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=84332#p84332" />
			<content type="html"><![CDATA[<p>Возможно, находит слишком много совпадений.<br />Посмотрел на картинку - используйте ImageSearch.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2014-06-28T11:07:07Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=84332#p84332</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Клики по очереди]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=84326#p84326" />
			<content type="html"><![CDATA[<p>Malcev .<br />Ваш код не помог .. делает тоже самое только еще и зависает... может я вас не правильно понял и должен был что-то дописать .. но код в таком виде не робит.&nbsp; прошу помощи...</p>]]></content>
			<author>
				<name><![CDATA[ignor31]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32386</uri>
			</author>
			<updated>2014-06-27T21:15:07Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=84326#p84326</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Клики по очереди]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=84267#p84267" />
			<content type="html"><![CDATA[<p>Используйте цикл.<br /></p><div class="codebox"><pre><code>x::
ErrorLevel = 0
n = 1
while (!ErrorLevel)
{
   PixelSearch, Px%n%, Py%n%, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, 0x01CD01, 0, fast
   n++
}
while (A_index &lt; n)
   Click, % Px%A_index% &quot;, &quot; Py%A_index%
return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2014-06-27T07:02:44Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=84267#p84267</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Клики по очереди]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=84258#p84258" />
			<content type="html"><![CDATA[<p>Доброго времени суток, подскажите пожалуйста использую код&nbsp; </p><div class="codebox"><pre><code>


x::
        {
        PixelSearch, Px, Py, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, 0x01CD01, 0, fast
        Click, %Px%, %Py%
        
        }
return</code></pre></div><p>все работает . но на экране несколько пикселей данного цвета, помогите сделать так что бы после клика по первому найденному пикселю&nbsp; кликал по остальным&nbsp; по очереди. </p><p>ps: делать надо клики по зеленым лужам на скриншоте .</p>]]></content>
			<author>
				<name><![CDATA[ignor31]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32386</uri>
			</author>
			<updated>2014-06-27T01:36:16Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=84258#p84258</id>
		</entry>
</feed>
