<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Медленно посылает нажатия клавиши (Loop, PixelGetColor).]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=15075</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=15075&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Медленно посылает нажатия клавиши (Loop, PixelGetColor).».]]></description>
		<lastBuildDate>Wed, 11 Dec 2019 17:16:55 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Медленно посылает нажатия клавиши (Loop, PixelGetColor).]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=136806#p136806</link>
			<description><![CDATA[<p><strong>imsialroma</strong>, команда PixelGetColor состоит из двух операций: взятия снимка экрана (времязатратная) и взятия значения пикселя из снимка. Вам нужно разнести эти операции, взять снимок один раз перед циклом, а внутри брать разные пиксели.<br /><a href="http://forum.script-coding.com/viewtopic.php?pid=133330#p133330">Подробнее тут.</a></p>]]></description>
			<author><![CDATA[null@example.com (stealzy)]]></author>
			<pubDate>Wed, 11 Dec 2019 17:16:55 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=136806#p136806</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Медленно посылает нажатия клавиши (Loop, PixelGetColor).]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=136801#p136801</link>
			<description><![CDATA[<p>Если каждый раз нужно в разных точках проверять цвет, тогда последний вариант не имеет смысла.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Wed, 11 Dec 2019 15:17:09 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=136801#p136801</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Медленно посылает нажатия клавиши (Loop, PixelGetColor).]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=136793#p136793</link>
			<description><![CDATA[<p>Возник еще небольшой вопрос.</p><div class="codebox"><pre><code>obj := [ {get_x: 17, get_y: 1040, clr: 0xe100ff, key: &quot;1&quot;}
       , {get_x: 25, get_y: 1040, clr: 0x0011ff, key: &quot;3&quot;} 
       , {get_x: 33, get_y: 1040, clr: 0x00ff02, key: &quot;3&quot;} ] </code></pre></div><p>Я сделал из get_x и get_y переменные и записывал в Loop </p><div class="codebox"><pre><code>PixelGetColor, Color, v.get_x, v.get_y</code></pre></div><p>.<br />Но сейчас они находятся перед for и так уже не работает, как это можно исправить?</p>]]></description>
			<author><![CDATA[null@example.com (imsialroma)]]></author>
			<pubDate>Tue, 10 Dec 2019 16:38:56 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=136793#p136793</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Медленно посылает нажатия клавиши (Loop, PixelGetColor).]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=136792#p136792</link>
			<description><![CDATA[<p><strong>teadrinker, Phoenixxx_Czar</strong>, спасибо вам большое за решение!</p>]]></description>
			<author><![CDATA[null@example.com (imsialroma)]]></author>
			<pubDate>Tue, 10 Dec 2019 16:01:53 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=136792#p136792</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Медленно посылает нажатия клавиши (Loop, PixelGetColor).]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=136787#p136787</link>
			<description><![CDATA[<p><strong>Phoenixxx_Czar</strong>, похоже вы правы, я что-то ступил слегка.<br /></p><div class="codebox"><pre><code>obj := [ {clr: 0xe100ff, key: &quot;1&quot;}
       , {clr: 0x0011ff, key: &quot;3&quot;}
       , {clr: 0x00ff02, key: &quot;3&quot;}
       , {clr: 0x00aeff, key: &quot;4&quot;}
       , {clr: 0x0004FF, key: &quot;8&quot;}
       , {clr: 0xff3a00, key: &quot;2&quot;}
       , {clr: 0x0004FF, key: &quot;g&quot;}
       , {clr: 0x00b3ff, key: &quot;v&quot;}
       , {clr: 0xff4100, key: &quot;7&quot;}
       , {clr: 0x00FF9C, key: &quot;F6&quot;}
       , {clr: 0x51FF00, key: &quot;F7&quot;} ]

Loop {
   PixelGetColor, Color, get_x, get_y
   for k, v in obj {
      if (Color = v.clr) {
         Send, % &quot;{&quot; . v.key . &quot;}&quot;
         break
      }
   }
   Sleep, 10
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sun, 08 Dec 2019 21:09:44 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=136787#p136787</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Медленно посылает нажатия клавиши (Loop, PixelGetColor).]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=136786#p136786</link>
			<description><![CDATA[<p>Может получение цвета вынести перед for?</p>]]></description>
			<author><![CDATA[null@example.com (Phoenixxx_Czar)]]></author>
			<pubDate>Sun, 08 Dec 2019 19:50:51 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=136786#p136786</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Медленно посылает нажатия клавиши (Loop, PixelGetColor).]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=136785#p136785</link>
			<description><![CDATA[<p>А в чём вопрос-то? Так и должно быть. На получение цвета требуется время.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sun, 08 Dec 2019 16:25:12 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=136785#p136785</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Медленно посылает нажатия клавиши (Loop, PixelGetColor).]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=136784#p136784</link>
			<description><![CDATA[<p>Акутально. С каждым добавленным новым цветом, увеличивается задержка (стоит Sleep 10).</p>]]></description>
			<author><![CDATA[null@example.com (imsialroma)]]></author>
			<pubDate>Sun, 08 Dec 2019 16:08:11 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=136784#p136784</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Медленно посылает нажатия клавиши (Loop, PixelGetColor).]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=136744#p136744</link>
			<description><![CDATA[<p>Sleep в любом случае столько, сколько написано, но не менее 10-15 мс.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 02 Dec 2019 17:03:21 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=136744#p136744</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Медленно посылает нажатия клавиши (Loop, PixelGetColor).]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=136741#p136741</link>
			<description><![CDATA[<p><strong>teadrinker</strong> Для 2ух цветов 30-60 мс и там сразу видно что Sleep, 10</p>]]></description>
			<author><![CDATA[null@example.com (imsialroma)]]></author>
			<pubDate>Mon, 02 Dec 2019 16:40:43 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=136741#p136741</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Медленно посылает нажатия клавиши (Loop, PixelGetColor).]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=136740#p136740</link>
			<description><![CDATA[<p>Наверно, это нормально для 11 точек, у меня так же без нахождения цветов и посыла клавиш.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 02 Dec 2019 16:22:07 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=136740#p136740</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Медленно посылает нажатия клавиши (Loop, PixelGetColor).]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=136739#p136739</link>
			<description><![CDATA[<p><strong>teadrinker</strong> 189-250 мс</p>]]></description>
			<author><![CDATA[null@example.com (imsialroma)]]></author>
			<pubDate>Mon, 02 Dec 2019 16:11:28 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=136739#p136739</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Медленно посылает нажатия клавиши (Loop, PixelGetColor).]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=136737#p136737</link>
			<description><![CDATA[<p>Такого не может быть, проблема в чём-то другом. Сколько занимает времени весь цикл, можно так проверить:<br /></p><div class="codebox"><pre><code>Loop {
   start := A_TickCount
   for k, v in obj {
      PixelGetColor, Color, get_x, get_y
      if (Color = v.clr)
         Send, % &quot;{&quot; . v.key . &quot;}&quot;
   }
   Sleep, 10
   ToolTip % A_TickCount - start
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 02 Dec 2019 15:22:14 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=136737#p136737</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Медленно посылает нажатия клавиши (Loop, PixelGetColor).]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=136736#p136736</link>
			<description><![CDATA[<p><strong>teadrinker</strong> Спасибо, за решение, код стал более оптимизирован. Но, к сожалению, проблему это не решило. Такое ощущение что Sleep, 10 = Sleep, 100</p>]]></description>
			<author><![CDATA[null@example.com (imsialroma)]]></author>
			<pubDate>Mon, 02 Dec 2019 15:03:49 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=136736#p136736</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Медленно посылает нажатия клавиши (Loop, PixelGetColor).]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=136735#p136735</link>
			<description><![CDATA[<p>Если всё, как вы описали, то так:<br /></p><div class="codebox"><pre><code>obj := [ {clr: 0xe100ff, key: &quot;1&quot;}
       , {clr: 0x0011ff, key: &quot;3&quot;}
       , {clr: 0x00ff02, key: &quot;3&quot;}
       , {clr: 0x00aeff, key: &quot;4&quot;}
       , {clr: 0x0004FF, key: &quot;8&quot;}
       , {clr: 0xff3a00, key: &quot;2&quot;}
       , {clr: 0x0004FF, key: &quot;g&quot;}
       , {clr: 0x00b3ff, key: &quot;v&quot;}
       , {clr: 0xff4100, key: &quot;7&quot;}
       , {clr: 0x00FF9C, key: &quot;F6&quot;}
       , {clr: 0x51FF00, key: &quot;F7&quot;} ]

Loop {
   for k, v in obj {
      PixelGetColor, Color, get_x, get_y
      if (Color = v.clr)
         Send, % &quot;{&quot; . v.key . &quot;}&quot;
   }
   Sleep, 10
}</code></pre></div><p>Но в начале ещё должно быть установлено <a href="https://www.autohotkey.com/docs/commands/CoordMode.htm">CoordMode</a> (чтобы задать, относительно чего координаты), а также, возможно, опция RGB в PixelGetColor (если цвета в RGB).</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 02 Dec 2019 13:51:04 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=136735#p136735</guid>
		</item>
	</channel>
</rss>
