<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Счетчик изображений в GUI]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=13107</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=13107&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Счетчик изображений в GUI».]]></description>
		<lastBuildDate>Sun, 29 Oct 2017 13:54:00 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Счетчик изображений в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=120562#p120562</link>
			<description><![CDATA[<p>О спасибо.<br />А не подскажите, функцию BlockInput можно использовать для блокировки отдельных клавишь в таком виде:</p><div class="codebox"><pre><code>BlockInput {A}, {D}</code></pre></div><p>или эта функция блокирует сразу все клавиши?</p><p>Просто решил еще маленький скрипт написать для блокировки нажатия определенных клавиш пока на экране монитора находится определенная картинка</p><p>А все, нашел вашу же тему на форуме с подобным скриптом.</p>]]></description>
			<author><![CDATA[null@example.com (IIoToII)]]></author>
			<pubDate>Sun, 29 Oct 2017 13:54:00 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=120562#p120562</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Счетчик изображений в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=120531#p120531</link>
			<description><![CDATA[<p>Чтобы не нагружало вставьте в цикл sleep 50.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Sat, 28 Oct 2017 22:06:02 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=120531#p120531</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Счетчик изображений в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=120529#p120529</link>
			<description><![CDATA[<p>1 Это я такое кривое присвоение сделал и ведь работает и выводит правильное значение)<br />2 Хз, но работает)<br />3 Да тут я неправильно понял значение функции. Удалил ее из скрипта, хотя что так что так работает)</p><p>Еще раз спасибо огромное, проблема решена, решил остановиться на варианте поиск по хоткею, тк непрерывный поиск на 20 % нагружает ЦП.</p>]]></description>
			<author><![CDATA[null@example.com (IIoToII)]]></author>
			<pubDate>Sat, 28 Oct 2017 19:13:56 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=120529#p120529</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Счетчик изображений в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=120521#p120521</link>
			<description><![CDATA[<p>Зачем 2 раза код ищет картинку?<br />Почему функция находится в середине?<br />Зачем нужен GuiControlGet?<br />Почему не ищет не знаю.<br />Чтобы не мелькало можно попробовать добавить опцию BackgroundTrans к мелькающему контролу.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Sat, 28 Oct 2017 11:44:25 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=120521#p120521</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Счетчик изображений в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=120519#p120519</link>
			<description><![CDATA[<p>Спасибо большое за ваше терпение, разобрался c gui, все работает, в gui окно результат выводится.</p><div class="codebox"><pre><code>#SingleInstance ignore
Gui, +ToolWindow +AlwaysOnTop
Gui, Font, S10 CDefault, Verdana
Gui, Font, S12 CDefault, Verdana
Gui, Font, S10 CDefault, Verdana
Gui, Font, S12 CDefault, Verdana
Gui, Font, S10 CDefault, Verdana
Gui, Font, S9 CDefault, Verdana
Gui, Font, S9 CDefault, Verdana
Gui, Font, S12 CDefault, Verdana

Gui, Add, Text, x6 y7 w50 h20 , Units
Gui, Add, Text, vCounter x60 y7 w30 h17 , 0
Gui, Show, x380 y257 h38 w95, Checker v1.0E 

mylabel:

  GuiControlGet, Counter
 Counter := SeveralSearch(0, 0, 1920, 1080, &quot;Image_0.bmp&quot;)   
GuiControl,, Counter, %Counter%    


SetBatchLines -1
SeveralSearch(0, 0, 1920, 1080, &quot;Image_0.bmp&quot;) 

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.MaxIndex()
}

goto mylabel




F1:: Reload
F2:: ExitApp
</code></pre></div><p>Осталась не решенной только проблема поиска картинок, почему то не хочет искать картинки разрешением больше 8x8 пикселей, не знаете с чем это связано?<br />PS При использовании вывода результата без хоткея, в режиме постоянного вывода, результат очень быстро моргает, можно ли убрать этот эффект, чтобы цифры сменялись плавно без эффекта моргания.</p>]]></description>
			<author><![CDATA[null@example.com (IIoToII)]]></author>
			<pubDate>Sat, 28 Oct 2017 09:18:49 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=120519#p120519</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Счетчик изображений в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=120513#p120513</link>
			<description><![CDATA[<p>ААА понял.))<br /></p><div class="codebox"><pre><code>#SingleInstance ignore
Gui, +ToolWindow +AlwaysOnTop
Gui, Font, S10 CDefault, Verdana
Gui, Font, S12 CDefault, Verdana
Gui, Font, S10 CDefault, Verdana
Gui, Font, S12 CDefault, Verdana
Gui, Font, S10 CDefault, Verdana
Gui, Font, S9 CDefault, Verdana
Gui, Font, S9 CDefault, Verdana
Gui, Font, S12 CDefault, Verdana

Gui, Add, Text, x6 y7 w50 h20 , SCSC
Gui, Add, Text, vCounter x60 y7 w30 h17 , 0
Gui, Show, x380 y257 h38 w95, Checker v1.0E 


Space::
    

SetBatchLines -1
msgbox % SeveralSearch(0, 0, 1920, 1080, &quot;Image_0.bmp&quot;)

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.MaxIndex()
}


Return



F1:: Reload
F2:: ExitApp</code></pre></div><p>Спасибо большое, все заработало, только вот&nbsp; количество совпадений выводится отдельным окошком msgbox, а как здесь<br /></p><div class="codebox"><pre><code>msgbox % SeveralSearch(0, 0, 1920, 1080, &quot;Image_0.bmp&quot;)</code></pre></div><p>вместо msgbox сделать вывод в gui ?<br />И правильно ли я понимаю что в режиме реального времени(так чтобы счетчик сам пересчитывал кол-во совпадений в gui) вывод не сделать, только по хоткею?<br />PS Наткнулся на еще одну проблему, почему то не находит совпадения если искомая картинка больше 8х8 пикселей.</p>]]></description>
			<author><![CDATA[null@example.com (IIoToII)]]></author>
			<pubDate>Fri, 27 Oct 2017 20:18:04 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=120513#p120513</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Счетчик изображений в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=120512#p120512</link>
			<description><![CDATA[<p>Я вам дал функцию, которое возвращает количество найденных совпадений.<br />Вы это значение можете присуждать переменной и вставлять в гуи.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Fri, 27 Oct 2017 19:45:02 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=120512#p120512</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Счетчик изображений в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=120511#p120511</link>
			<description><![CDATA[<p>То есть тот скрипт что вы мне дали ранее не подходит сюда?</p>]]></description>
			<author><![CDATA[null@example.com (IIoToII)]]></author>
			<pubDate>Fri, 27 Oct 2017 19:40:05 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=120511#p120511</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Счетчик изображений в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=120510#p120510</link>
			<description><![CDATA[<p>Помочь, это одно.<br />А скрипт за вас писать мне не хочется.<br />Вам надо понять, что такое функция, как ее вызвать и что она возвращает.<br />Это есть в справке.<br />Работа с гуи тоже там описана.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Fri, 27 Oct 2017 19:37:45 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=120510#p120510</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Счетчик изображений в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=120509#p120509</link>
			<description><![CDATA[<div class="codebox"><pre><code>#SingleInstance ignore
Gui, Font, S10 CDefault, Verdana
Gui, Font, S12 CDefault, Verdana
Gui, Font, S10 CDefault, Verdana
Gui, Font, S12 CDefault, Verdana
Gui, Font, S10 CDefault, Verdana
Gui, Font, S9 CDefault, Verdana
Gui, Font, S9 CDefault, Verdana
Gui, Font, S12 CDefault, Verdana

Gui, Add, Text, x6 y7 w50 h20 , SCSC
Gui, Add, Text, vx1 x60 y7 w30 h17 , 0
Gui, Show, x380 y257 h38 w95, SCE 

 


Start:

SetBatchLines -1
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, %A_WorkingDir%\Image_0.bmp
		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.MaxIndex()
}

Return

GuiClose:
ExitApp </code></pre></div><p>Поставил в конце, но все равно не ищет.<br />Где моя следующая ошибка?<br />Я ведь правильно понимаю что найденное значение совпадений записывается в переменной x1?<br />Я тут ее добавил,<br /></p><div class="codebox"><pre><code>Gui, Add, Text, vx1 x60 y7 w30 h17 , 0</code></pre></div><p>но это не помогло.<br />PS Спасибо что не плюнули и решили помочь разобраться.</p>]]></description>
			<author><![CDATA[null@example.com (IIoToII)]]></author>
			<pubDate>Fri, 27 Oct 2017 19:08:32 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=120509#p120509</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Счетчик изображений в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=120507#p120507</link>
			<description><![CDATA[<p>У вас скрипт загружается, но до счетчика не доходит из-за return и ExitApp.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Fri, 27 Oct 2017 18:42:58 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=120507#p120507</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Счетчик изображений в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=120506#p120506</link>
			<description><![CDATA[<p>MsgBox, 0, qw, qwerty, 10</p><p>Но причем тут это ведь мне в&nbsp; gui надо такой счетчик сделать и чтобы значение постоянно менялось в зависимости от того сколько в данный момент искомых копий картинки находится на экране?</p>]]></description>
			<author><![CDATA[null@example.com (IIoToII)]]></author>
			<pubDate>Fri, 27 Oct 2017 18:20:00 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=120506#p120506</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Счетчик изображений в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=120505#p120505</link>
			<description><![CDATA[<div class="quotebox"><cite>IIoToII пишет:</cite><blockquote><p>Про какой 10 скрипт идет речь</p></blockquote></div><p>Скрипт из 10 поста.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Fri, 27 Oct 2017 18:05:13 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=120505#p120505</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Счетчик изображений в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=120504#p120504</link>
			<description><![CDATA[<p>Про какой 10 скрипт идет речь и что за SeveralSearch? Так и не нашел описания этой функции.</p><p>Если про msgbox, то&nbsp; так тоже не работает.<br /></p><div class="codebox"><pre><code>#SingleInstance ignore
Gui, Font, S10 CDefault, Verdana
Gui, Font, S12 CDefault, Verdana
Gui, Font, S10 CDefault, Verdana
Gui, Font, S12 CDefault, Verdana
Gui, Font, S10 CDefault, Verdana
Gui, Font, S9 CDefault, Verdana
Gui, Font, S9 CDefault, Verdana
Gui, Font, S12 CDefault, Verdana

Gui, Add, Text, x6 y7 w50 h20 , SCSC
Gui, Add, Text, vx1 x60 y9 w30 h17 , 0
Gui, Show, x380 y257 h38 w95, SC 

Return

GuiClose:
ExitApp  


Start:

SetBatchLines -1
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, %A_WorkingDir%\Image_0.bmp
		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.MaxIndex()
}


Return</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (IIoToII)]]></author>
			<pubDate>Fri, 27 Oct 2017 17:55:42 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=120504#p120504</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Счетчик изображений в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=120503#p120503</link>
			<description><![CDATA[<p>Ну и что по-вашему нужно закомментировать в 10 скрипте чтоб сообщение появилось?</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Fri, 27 Oct 2017 17:39:03 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=120503#p120503</guid>
		</item>
	</channel>
</rss>
