<?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="http://forum.script-coding.com/extern.php?action=feed&amp;tid=11118&amp;type=atom" />
	<updated>2015-12-03T14:14:14Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=11118</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Диапазон цветов]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=99502#p99502" />
			<content type="html"><![CDATA[<p>Вот так как-то:<br /></p><div class="codebox"><pre><code>#SingleInstance,Force
setbatchlines,-1
CoordMode,Pixel
CoordMode,ToolTip

colormin:=0x901020
colormax:=0xff5050
;colormin:=0x000000
;colormax:=0xffffff

f1::
if ColorsLine(100,100,colormin,colormax,&quot;x&quot;,100) ; начальная точка x=100, y=100,colormin,colormax,сканировать по x или y,сколько пикселей сканировать=100
  tooltip,Совпало
else
  tooltip,Облом.
return


ColorsLine(x,y,colormin,colormax,xy=&quot;x&quot;,count=1)
{
  loop,% count
  {
    if (a_index&gt;count)
      break
    PixelGetColor,Color,% xy=&quot;x&quot; ? x+a_index : x,% xy=&quot;y&quot; ? y+a_index : y, RGB

tooltip,% &quot;Отладка`n&quot; Color,% xy=&quot;x&quot; ? x+a_index+5 : x+5,% xy=&quot;y&quot; ? y+a_index+5 : y+5

    if !incolors(Color,colormin,colormax)
      return 0
  }
  return 1
}

incolors(Color,colormin,colormax)
{
  if (Color&amp;0xff0000&gt;(colormin&amp;0xff0000)-1 and Color&amp;0xff0000&lt;(colormax&amp;0xff0000)+1
  and Color&amp;0x00ff00&gt;(colormin&amp;0x00ff00)-1 and Color&amp;0x00ff00&lt;(colormax&amp;0x00ff00)+1
  and Color&amp;0x0000ff&gt;(colormin&amp;0x0000ff)-1 and Color&amp;0x0000ff&lt;(colormax&amp;0x0000ff)+1)
    return 1
}
</code></pre></div><p>Чтобы увеличить скорость - нужно отключить &quot;Аэро&quot;, если Win7.</p>]]></content>
			<author>
				<name><![CDATA[Alectric]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26027</uri>
			</author>
			<updated>2015-12-03T14:14:14Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=99502#p99502</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Диапазон цветов]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=99485#p99485" />
			<content type="html"><![CDATA[<p><strong>lukas_endigo_91</strong>, этот велосипед уже изобретён. Команды называются <em>PixelSearch</em> и <em>ImageSearch</em>.</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2015-12-03T06:11:52Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=99485#p99485</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Диапазон цветов]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=99478#p99478" />
			<content type="html"><![CDATA[<p><strong>Alectric</strong><br />Спасибо, работает. Подскажите пожалуйста мне еще одну вещь. Получается данный код следит за указателям, в идеале он должен проверять горизонтальную линию из пикселей от 128px по 252px (<strong>диапазон пикселей</strong>), то есть следить за определенным участком и при совпадении <strong>&quot;диапазон цветов&quot;</strong> должен выполнить код.</p>]]></content>
			<author>
				<name><![CDATA[lukas_endigo_91]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33312</uri>
			</author>
			<updated>2015-12-02T20:53:41Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=99478#p99478</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Диапазон цветов]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=99475#p99475" />
			<content type="html"><![CDATA[<p>Вроде работает...</p><p>...</p><p>Подправил:<br /></p><div class="codebox"><pre><code>#SingleInstance,Force

colormin:=0x901020
colormax:=0xff5050

loop
{
  mousegetpos,x,y
  PixelGetColor, Color, % x, % y, RGB

  if incolors(Color,colormin,colormax)
    tooltip,% Color
}

incolors(Color,colormin,colormax)
{
  if (Color&amp;0xff0000&gt;(colormin&amp;0xff0000)-1 and Color&amp;0xff0000&lt;(colormax&amp;0xff0000)+1
  and Color&amp;0x00ff00&gt;(colormin&amp;0x00ff00)-1 and Color&amp;0x00ff00&lt;(colormax&amp;0x00ff00)+1
  and Color&amp;0x0000ff&gt;(colormin&amp;0x0000ff)-1 and Color&amp;0x0000ff&lt;(colormax&amp;0x0000ff)+1)
    return 1
}
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Alectric]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26027</uri>
			</author>
			<updated>2015-12-02T17:46:32Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=99475#p99475</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Диапазон цветов]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=99471#p99471" />
			<content type="html"><![CDATA[<p>Всем доброго времени суток! Есть <strong>&quot;диапазон цветов&quot;</strong> в RGB: <br /><strong>RED = от 90 до FF;<br />GREEN = от 10 до 50;<br />BLUE = от 20 до 50.</strong><br />Получается с помощью команды:<br /></p><div class="codebox"><pre><code>PixelGetColor, dimColor, 500, 500, RGB</code></pre></div><p>Получаю цвет в переменную dimColor. К примеру в <strong>%dimColor%</strong> цвет <strong>0хA42135</strong>, это значит что он в <strong>&quot;диапазон цветов&quot;</strong> и выполняет дальше код.<br />Помогите пожалуйста как мне сделать функцию или формулу для <strong>&quot;диапазона цветов&quot;</strong>. Не обижайтесь если что не понятно и не правильно написал, объяснил как смог.</p>]]></content>
			<author>
				<name><![CDATA[lukas_endigo_91]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33312</uri>
			</author>
			<updated>2015-12-02T16:23:21Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=99471#p99471</id>
		</entry>
</feed>
