<?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=10362&amp;type=atom" />
	<updated>2015-01-31T16:35:47Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=10362</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Движение мышки стрелками и остановка перед белым цветом]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=91129#p91129" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Irbis пишет:</cite><blockquote><p>Переделал для двух цветов, по умолчанию - белый и черный. В paint.net работает.<br />&quot;Подгонка&quot; 3-мя ступенями, сначала с шагом s2 (25 пикселей), затем с шагом s1 (5 пикселей), и потом с точностью до 1 точки, так должно чуть быстрей.</p></blockquote></div><p>Спасибо,работает 1 вариант намного быстрее. Второй вариант универсальней но если фон не одного цвета то кпд падает, поскольку много огрешностей, но мне и 2 цветов хватит. </p><div class="quotebox"><blockquote><p>Насчет &quot;одновременно искать в 4-х направлениях&quot;, в теории возможно с запуском одновременно 4-х копий, с передачей им параметров и приемом результатов, на практике все будет более громоздко и не гарантирует большого прироста к скорости.</p></blockquote></div><p>Понял что больше проблем будет нежели плюсовой результат.</p>]]></content>
			<author>
				<name><![CDATA[HideGenius]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32783</uri>
			</author>
			<updated>2015-01-31T16:35:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=91129#p91129</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Движение мышки стрелками и остановка перед белым цветом]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=91053#p91053" />
			<content type="html"><![CDATA[<p>Переделал для двух цветов, по умолчанию - белый и черный. В paint.net работает.<br />&quot;Подгонка&quot; 3-мя ступенями, сначала с шагом s2 (25 пикселей), затем с шагом s1 (5 пикселей), и потом с точностью до 1 точки, так должно чуть быстрей.</p><p>Насчет &quot;одновременно искать в 4-х направлениях&quot;, в теории возможно с запуском одновременно 4-х копий, с передачей им параметров и приемом результатов, на практике все будет более громоздко и не гарантирует большого прироста к скорости.<br /></p><div class="codebox"><pre><code>SetBatchLines -1
s2 := 25, s1 := 5

!lbutton::
keywait,lbutton,t
MouseGetPos,x,y
x1:=f(f(f(x,y,&quot;x&quot;,-s2),y,&quot;x&quot;,-s1),y,&quot;x&quot;,-1)
y1:=f(x,f(x,f(x,y,&quot;y&quot;,-s2),&quot;y&quot;,-s1),&quot;y&quot;,-1)
x2:=f(f(f(x,y,&quot;x&quot;,s2),y,&quot;x&quot;,s1),y,&quot;x&quot;)
y2:=f(x,f(x,f(x,y,&quot;y&quot;,s2),&quot;y&quot;,s1),&quot;y&quot;)
MouseClickDrag,Left,x1,y1,x2,y2,0
return

f(x:=0,y:=0,o:=&quot;x&quot;,d:=1,c1:=0xffffff,c2:=0x000000)
{
   dx := (o=&quot;x&quot;) ? d : 0, dy := (o=&quot;y&quot;) ? d : 0
   while (color!=c1) &amp;&amp; (color!=c2)  &amp;&amp; (x &gt; 0) &amp;&amp; (x &lt; A_ScreenWidth)&amp;&amp; (y &gt; 0) &amp;&amp; (y &lt; A_ScreenHeight) {
      x+=dx, y+=dy
      PixelGetColor,color,x,y
      tooltip,O,x+5,y+5
   }
   tooltip
   return (o=&quot;x&quot;) ? x-dx : y-dy
}</code></pre></div><p>Со сменой цвета (цветов):<br /></p><div class="codebox"><pre><code>SetBatchLines -1
s2 := 25, s1 := 5
c1:=0xffffff,c2:=0x000000
Return

!lbutton::
keywait,lbutton,t
MouseGetPos,x,y
x1:=f(f(f(x,y,&quot;x&quot;,-s2,c1,c2),y,&quot;x&quot;,-s1,c1,c2),y,&quot;x&quot;,-1,c1,c2)
y1:=f(x,f(x,f(x,y,&quot;y&quot;,-s2,c1,c2),&quot;y&quot;,-s1,c1,c2),&quot;y&quot;,-1,c1,c2)
x2:=f(f(f(x,y,&quot;x&quot;,s2,c1,c2),y,&quot;x&quot;,s1,c1,c2),y,&quot;x&quot;,1,c1,c2)
y2:=f(x,f(x,f(x,y,&quot;y&quot;,s2,c1,c2),&quot;y&quot;,s1,c1,c2),&quot;y&quot;,1,c1,c2)
MouseClickDrag,Left,x1,y1,x2,y2,10
return

#1:: ; Смена 1 цвета 
   MouseGetPos,x,y
   PixelGetColor,c1,x,y
Return

#2:: ; Смена 2 цвета
   MouseGetPos,x,y
   PixelGetColor,c2,x,y
Return

f(x:=0,y:=0,o:=&quot;x&quot;,d:=1,c1:=0xffffff,c2:=0x000000)
{
   dx := (o=&quot;x&quot;) ? d : 0, dy := (o=&quot;y&quot;) ? d : 0
   while (color!=c1) &amp;&amp; (color!=c2)  &amp;&amp; (x &gt; 0) &amp;&amp; (x &lt; A_ScreenWidth)&amp;&amp; (y &gt; 0) &amp;&amp; (y &lt; A_ScreenHeight) {
      x+=dx, y+=dy
      PixelGetColor,color,x,y
      tooltip,O,x+5,y+5
   }
   tooltip
   return (o=&quot;x&quot;) ? x-dx : y-dy
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Irbis]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27384</uri>
			</author>
			<updated>2015-01-30T10:37:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=91053#p91053</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Движение мышки стрелками и остановка перед белым цветом]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=91045#p91045" />
			<content type="html"><![CDATA[<p>А что нужно написать чтобы скрипт мог распознавать несколько цветов например если нет 0хFFFFFF а нашло 0х000000 то будет считать 2 как за рамку?<br /></p><div class="codebox"><pre><code>color:=0xFFFFFF,0x000000, s=25</code></pre></div><p>Так не получается.</p>]]></content>
			<author>
				<name><![CDATA[HideGenius]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32783</uri>
			</author>
			<updated>2015-01-30T02:33:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=91045#p91045</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Движение мышки стрелками и остановка перед белым цветом]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=90995#p90995" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Irbis пишет:</cite><blockquote><p>Можно для обеих координат использовать общий цикл поиска:</p></blockquote></div><p>Немного добавил в ваш код свои правки, работает быстро иногда бывают погрешности, но это компенсируется скоростью работы. Видел тему на форуме о <a href="http://forum.script-coding.com/viewtopic.php?id=10343">скриншотах</a>, можете предложить добавить в его программу свой код.<br />Была еще идея добавить в ваш код функцию распознавания фона, то есть когда запущен скрипт при нажманни на горячую клавишу берется цвет под мышкой и ставится его как фон то есть вместо белого как сейчас, а если это действие не сделана то по умолчанию будет белый.</p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header"><strong>+</strong>&nbsp;ваш код с моими правками</div><div class="fancy_spoiler"><div class="codebox"><pre><code>color:=0xffffff, s := 25   ; увеличил скорость, как на больше увиличить не знаю

!d::                                      ; при alt+tab мешает
keywait,d,t
MouseGetPos,x,y
MouseMove 5, -5, , r            ; как и писал у Snagit 2 полоски как у прицела, отводит  &quot;цель&quot; от точки где идет распознавание.
DllCall(&quot;Dwmapi\DwmEnableComposition&quot;, &quot;UInt&quot;, 0)
x1:=find(find(x,y,&quot;x&quot;,-s,color)+s,y,&quot;x&quot;,-1,color)
y1:=find(x,find(x,y,&quot;y&quot;,-s,color)+s,&quot;y&quot;,-1,color)
x2:=find(find(x,y,&quot;x&quot;,s,color)-s,y,&quot;x&quot;,1,color)
y2:=find(x,find(x,y,&quot;y&quot;,s,color)-s,&quot;y&quot;,1,color)
DllCall(&quot;Dwmapi\DwmEnableComposition&quot;, &quot;UInt&quot;, 1)
MouseClickDrag,Left,x1+1,y1+1,x2-1,y2-1,0     ; увеличил скорость, теперь все мгновенно делаеться
return

find(x=0,y=0,o=&quot;x&quot;,d=1,c=0)
{
   dx := (o=&quot;x&quot;) ? d : 0, dy := (o=&quot;y&quot;) ? d : 0
   while (color!=c)  &amp;&amp; (x &gt; 0) &amp;&amp; (x &lt; A_ScreenWidth)&amp;&amp; (y &gt; 0) &amp;&amp; (y &lt; A_ScreenHeight) {
      x+=dx, y+=dy
      PixelGetColor,color,x,y
      ;tooltip,%x% %y%,x+5,y+5     ; забирает ефект ожидания 
   }
   tooltip
   return (o=&quot;x&quot;) ? x : y
}</code></pre></div></div></div><p>А если для ускорения этого кода сделать чтобы оно не поочередно вычисляли лево, верх, право, низ, а одновременно запускало исследование цвета вверх вправо влево низ. Возможно такое?</p>]]></content>
			<author>
				<name><![CDATA[HideGenius]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32783</uri>
			</author>
			<updated>2015-01-27T15:19:13Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=90995#p90995</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Движение мышки стрелками и остановка перед белым цветом]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=90982#p90982" />
			<content type="html"><![CDATA[<p>Можно для обеих координат использовать общий цикл поиска:<br /></p><div class="codebox"><pre><code>; &lt;...&gt; остальной код

find(x=0,y=0,o=&quot;x&quot;,d=1,c=0)
{
   dx := (o=&quot;x&quot;) ? d : 0, dy := (o=&quot;y&quot;) ? d : 0
   while (color!=c)  &amp;&amp; (x &gt; 0) &amp;&amp; (x &lt; A_ScreenWidth)&amp;&amp; (y &gt; 0) &amp;&amp; (y &lt; A_ScreenHeight) {
      x+=dx, y+=dy
      PixelGetColor,color,x,y
      tooltip,%x% %y%,x+5,y+5
   }
   tooltip
   return (o=&quot;x&quot;) ? x : y
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Irbis]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27384</uri>
			</author>
			<updated>2015-01-26T16:10:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=90982#p90982</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Движение мышки стрелками и остановка перед белым цветом]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=90979#p90979" />
			<content type="html"><![CDATA[<p>На win8 никакой разницы. А вот с &quot;подгонкой&quot; скорость вырастает, особенно если s увеличить.<br /></p><div class="codebox"><pre><code>color:=0xffffff, s := 15

!lbutton::
keywait,lbutton,t
MouseGetPos,x,y
DllCall(&quot;Dwmapi\DwmEnableComposition&quot;, &quot;UInt&quot;, 0)
x1:=find(find(x,y,&quot;x&quot;,-s,color)+s,y,&quot;x&quot;,-1,color)
y1:=find(x,find(x,y,&quot;y&quot;,-s,color)+s,&quot;y&quot;,-1,color)
x2:=find(find(x,y,&quot;x&quot;,s,color)-s,y,&quot;x&quot;,1,color)
y2:=find(x,find(x,y,&quot;y&quot;,s,color)-s,&quot;y&quot;,1,color)
DllCall(&quot;Dwmapi\DwmEnableComposition&quot;, &quot;UInt&quot;, 1)
MouseClickDrag,Left,x1+1,y1+1,x2-1,y2-1,10
return


find(x=0,y=0,o=&quot;x&quot;,d=1,c=0)
{
  if o=x
  {
    while color!=c  &amp;&amp; (x &gt; 0) &amp;&amp; (x &lt; A_ScreenWidth)
    {
      x+=d
      PixelGetColor,color,x,y
      tooltip,%x% %y%,x+5,y+5
    }
    tooltip
    return x
  }
  else if o=y
  {
    while (color!=c) &amp;&amp; (y &gt; 0) &amp;&amp; (y &lt; A_ScreenHeight)
    {
      y+=d
      PixelGetColor,color,x,y
      tooltip,%x% %y%,x+5,y+5
    }
    tooltip
    return y
  }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Irbis]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27384</uri>
			</author>
			<updated>2015-01-26T14:31:43Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=90979#p90979</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Движение мышки стрелками и остановка перед белым цветом]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=90978#p90978" />
			<content type="html"><![CDATA[<p>Вариант с временным отключением композиции рабочего стола:<br /></p><div class="codebox"><pre><code>
color=0xffffff

!lbutton::
keywait,lbutton,t
MouseGetPos,x,y
DllCall(&quot;Dwmapi\DwmEnableComposition&quot;, &quot;UInt&quot;, 0)
x1:=find(x,y,&quot;x&quot;,-1,color)
y1:=find(x,y,&quot;y&quot;,-1,color)
x2:=find(x,y,&quot;x&quot;,1,color)
y2:=find(x,y,&quot;y&quot;,1,color)
DllCall(&quot;Dwmapi\DwmEnableComposition&quot;, &quot;UInt&quot;, 1)
sleep,1000
MouseClickDrag,Left,x1+1,y1+1,x2-1,y2-1,10
return

find(x=0,y=0,o=&quot;x&quot;,d=1,c=0)
{
  if o=x
  {
    while color!=c
    {
      xx:= d&gt;0 ? x+a_index : x-a_index
      if (xx&lt;0 or xx&gt;a_screenwidth)
        break
      PixelGetColor,color,xx,y
      tooltip,%xx% %y%,xx+5,y+5
    }
    tooltip
    return xx
  }
  else if o=y
  {
    while color!=c
    {
      yy:= d&gt;0 ? y+a_index : y-a_index
      if (yy&lt;0 or yy&gt;a_screenheight)
        break
      PixelGetColor,color,x,yy
      tooltip,%x% %yy%,x+5,yy+5
    }
    tooltip
    return yy
  }
}

</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Alectric]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26027</uri>
			</author>
			<updated>2015-01-26T13:54:07Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=90978#p90978</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Движение мышки стрелками и остановка перед белым цветом]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=90977#p90977" />
			<content type="html"><![CDATA[<p>Думаю, <strong>PixelSearch</strong> примерно так и работает в режиме <strong>Slow</strong>.<br />Для ускорения в данном случае можно &quot;шагать&quot; не по-пиксельно, а с шагом (например 20 пикселей), уповая на то, что белая рамка вокруг картинки имеет некую толщину, превышающую 1 пиксель. Затем произвести более точную подгонку.</p>]]></content>
			<author>
				<name><![CDATA[Irbis]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27384</uri>
			</author>
			<updated>2015-01-26T13:33:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=90977#p90977</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Движение мышки стрелками и остановка перед белым цветом]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=90975#p90975" />
			<content type="html"><![CDATA[<p>Alt+Левая кнопка в центр картинки:<br /></p><div class="codebox"><pre><code>color=0xffffff

!lbutton::
keywait,lbutton,t
MouseGetPos,x,y

x1:=find(x,y,&quot;x&quot;,-1,color)
y1:=find(x,y,&quot;y&quot;,-1,color)

x2:=find(x,y,&quot;x&quot;,1,color)
y2:=find(x,y,&quot;y&quot;,1,color)

MouseClickDrag,Left,x1+1,y1+1,x2-1,y2-1,10
return


find(x=0,y=0,o=&quot;x&quot;,d=1,c=0)
{
  if o=x
  {
    while color!=c
    {
      xx:= d&gt;0 ? x+a_index : x-a_index
      PixelGetColor,color,xx,y
      tooltip,%xx% %y%,xx+5,y+5
    }
    tooltip
    return xx
  }
  else if o=y
  {
    while color!=c
    {
      yy:= d&gt;0 ? y+a_index : y-a_index
      PixelGetColor,color,x,yy
      tooltip,%x% %yy%,x+5,yy+5
    }
    tooltip
    return yy
  }
}
</code></pre></div><p>Но работает очень медленно в любом варианте...</p>]]></content>
			<author>
				<name><![CDATA[Alectric]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26027</uri>
			</author>
			<updated>2015-01-26T13:14:54Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=90975#p90975</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Движение мышки стрелками и остановка перед белым цветом]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=90974#p90974" />
			<content type="html"><![CDATA[<p>Значит, надо изменить сам способ получения границ картинки. Не двигать курсор, а сначала найти координаты прямоугольника, ограниченного белым цветом, затем произвести выделение.<br />Например, так можно при нажатии хоткея получить координаты левого верхнего и правого нижнего угла картинки в массив Rect, затем выделить регион при помощи ЛКМ. Ввиду ограничения PixelSearch на поиск влево и вверх от текущей позиции, режим <em>fast</em> в этих направлениях не работает, поэтому курсор лучше подвести ближе к левому верхнему краю картинки.</p><div class="codebox"><pre><code>Rect:= [0,0,0,0]
F11:: ; Заменить на используемый в Snagit хоткей, не забыв про &quot;~&quot;
   if FindBorder(Rect) ; границы найдены
      MouseClickDrag, Left, Rect[1], Rect[2],Rect[3],Rect[4], 10 ; 0 - мнгновенное выделение
   else
      MsgBox Границы не найдены.
Return

FindBorder(Rect, c := 0xffffff) ; по умолчанию белый цвет
{
   MouseGetPos, x, y
   PixelSearch, x0,, x, y, 0, y, c
   PixelSearch, x1,, x, y, A_ScreenWidth, y, c,, fast
   PixelSearch,,y0, x, y, x, 0, c
   PixelSearch,,y1, x, y, x, A_ScreenHeight, c,, fast
   if  x0&amp;&amp;x1&amp;&amp;y0&amp;&amp;y1 {
      Rect[1] := x0, Rect[2] := y0, Rect[3] := x1, Rect[4] := y1
      Return 1
   }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Irbis]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27384</uri>
			</author>
			<updated>2015-01-26T10:44:13Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=90974#p90974</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Движение мышки стрелками и остановка перед белым цветом]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=90970#p90970" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Irbis пишет:</cite><blockquote><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><p>Но есть идеи использовать такой способ для защиты алгоритма скрипта от стороннего вмешательства, привязки к железу/ключу и проч.</p></div></div><p>Оценил.</p><div class="codebox"><pre><code>N = 5    ; коэффициент ускорения, можно менять 0-20
s = 3    ; коэффициент скорости, можно менять 1-20
F:= &quot;GetKeyState&quot;, Dir:= {R: &quot;vk66&quot;, L:&quot;vk64&quot;, U:&quot;vk68&quot;, D:&quot;vk65&quot;}
for k in Dir
   HotKey, % Dir[k], HK
Return
HK:
While %F%(A_ThisHotkey) || %F%(A_PriorHotkey) {
   shift := N = 0 ? s : a_index*s*N/40
   x := shift*(%F%(Dir[&quot;R&quot;])-%F%(Dir[&quot;L&quot;])), y := shift*(%F%(Dir[&quot;D&quot;])-%F%(Dir[&quot;U&quot;]))
   mousegetpos,mx,my
   PixelGetColor,color,mx+x,my+y
   if (color&lt;&gt;0xffffff) {
      MouseMove, x,y, 0, R
      tooltip,% color
   }
}
Return
</code></pre></div></blockquote></div><p>Спасибо, но проблема та же. У Snagit при вырезании появляеться вместо курсора круг в центре&nbsp; цель и скрипт &quot;видит&quot; только цвет пикселя Snagit, а не цвет под курсором.</p>]]></content>
			<author>
				<name><![CDATA[HideGenius]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32783</uri>
			</author>
			<updated>2015-01-26T09:34:20Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=90970#p90970</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Движение мышки стрелками и остановка перед белым цветом]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=90968#p90968" />
			<content type="html"><![CDATA[<p>Подумал: &quot;А зачем жесткая привязка к клавишам?&quot;, и вот что получилось.<br />В данном примере список <strong>Dir</strong> прописан в скрипте, можно переделать для чтения из INI-файла или определения клавиши в пользовательском GUI,&nbsp; в зависимости от фантазии и потребностей. Хоть из имени файла - переименовал &quot;wasd.ahk&quot; в &quot;8456.ahk&quot;, хоткеи при новом старте будут другие. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /><br />Переменная <strong>F</strong> введена только для сокращения кода.</p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><p>Но есть идеи использовать такой способ для защиты алгоритма скрипта от стороннего вмешательства, привязки к железу/ключу и проч.</p></div></div><div class="codebox"><pre><code>N = 5    ; коэффициент ускорения, можно менять 0-20
s = 3    ; коэффициент скорости, можно менять 1-20
F:= &quot;GetKeyState&quot;, Dir:= {R: &quot;vk66&quot;, L:&quot;vk64&quot;, U:&quot;vk68&quot;, D:&quot;vk65&quot;}
for k in Dir
   HotKey, % Dir[k], HK
Return
HK:
While %F%(A_ThisHotkey) || %F%(A_PriorHotkey) {
   shift := N = 0 ? s : a_index*s*N/40
   x := shift*(%F%(Dir[&quot;R&quot;])-%F%(Dir[&quot;L&quot;])), y := shift*(%F%(Dir[&quot;D&quot;])-%F%(Dir[&quot;U&quot;]))
   mousegetpos,mx,my
   PixelGetColor,color,mx+x,my+y
   if (color&lt;&gt;0xffffff) {
      MouseMove, x,y, 0, R
      tooltip,% color
   }
}
Return
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Irbis]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27384</uri>
			</author>
			<updated>2015-01-26T08:00:10Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=90968#p90968</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Движение мышки стрелками и остановка перед белым цветом]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=90957#p90957" />
			<content type="html"><![CDATA[<p>Зачем результат выражения в переменной, если оно возможно не пригодится?<br /></p><div class="codebox"><pre><code>   k := a_index*s*N/40
   shift := N = 0 ? s : k</code></pre></div><p>может?<br /></p><div class="codebox"><pre><code>shift := N = 0 ? s : a_index*s*N/40</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2015-01-25T18:07:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=90957#p90957</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Движение мышки стрелками и остановка перед белым цветом]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=90954#p90954" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Alectric пишет:</cite><blockquote><p>Я лиш взял код из ссылки и подправил (тот код 2009 года). Не стал продумывать все.</p><p>Лентяй я.</p></blockquote></div><p>Ваш скрипт больше работает если поставить скорость и ускорение на 20 то в вашем скрипте курсор не улетает за границы белого, а <strong>Irbis</strong>-а код просто летает и не останавливаеться. Код я хотел для вырезания картинок но в программе Snagit код не работает. Спасибо всем.</p>]]></content>
			<author>
				<name><![CDATA[HideGenius]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32783</uri>
			</author>
			<updated>2015-01-25T14:13:23Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=90954#p90954</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Движение мышки стрелками и остановка перед белым цветом]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=90946#p90946" />
			<content type="html"><![CDATA[<p>Я лиш взял код из ссылки и подправил (тот код 2009 года). Не стал продумывать все.</p><p>Лентяй я.</p>]]></content>
			<author>
				<name><![CDATA[Alectric]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26027</uri>
			</author>
			<updated>2015-01-25T08:59:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=90946#p90946</id>
		</entry>
</feed>
