<?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=12986&amp;type=atom" />
	<updated>2017-09-13T15:12:42Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=12986</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Исполнение скрипта в определенной области экрана]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=119319#p119319" />
			<content type="html"><![CDATA[<p><strong>svoboden</strong> огромное спасибо!</p>]]></content>
			<author>
				<name><![CDATA[CDLebo]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38751</uri>
			</author>
			<updated>2017-09-13T15:12:42Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=119319#p119319</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Исполнение скрипта в определенной области экрана]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=119305#p119305" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>1::
timer = 50
Global x1 := 100, y1 := 100, x2 := 450, y2 := 500

SetTimer, CheckTimeIdle, % timer
return

CheckTimeIdle:
CoordMode, Mouse
    MouseGetPos, x, y
    if !(x &lt; x1 || x &gt; x2 || y &lt; y1 || y &gt; y2)
        Send +{Click}
	    if (x &lt; x1 || x &gt; x2 || y &lt; y1 || y &gt; y2)
    SetTimer, CheckTimeIdle, off
return</code></pre></div><div class="codebox"><pre><code>1::
Loop {
    Sleep, 10
    Gosub, Label
    GetKeyState, state, 1, P
    if state = U
    break
}
return

Label:
sleep 50
CoordMode, Mouse
x1 := 100, y1 := 100, x2 := 450, y2 := 500
    MouseGetPos, x, y
    if !(x &lt; x1 || x &gt; x2 || y &lt; y1 || y &gt; y2)
        Send +{Click}
	    if (x &lt; x1 || x &gt; x2 || y &lt; y1 || y &gt; y2)
return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[svoboden]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34280</uri>
			</author>
			<updated>2017-09-13T08:00:12Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=119305#p119305</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Исполнение скрипта в определенной области экрана]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=119304#p119304" />
			<content type="html"><![CDATA[<p>Очень хороший человек помог мне и сделал скрипт, НО хотелось бы кое-что подредактировать. В Данный момент при зажатии кнопки скрипт проверяет, находится ли он в зоне действий и если находится, то начинает жать Shift+LCM. Единственное НО это то, что в момент когда он зашел в зону действий для него эта зона становится всем экраном, тобишь рамки спадают и это действие исполняется в любой части экрана, пока я не отожму кнопку и не нажму заново. Помогите сделать правильно. Спасибо.<br /></p><div class="codebox"><pre><code>#IF needcoord(1100,578,1470,1005)
$V::

Loop
{
if not GetKeyState(&quot;V&quot;, &quot;P&quot;)
break
Send +{Click}
}
return
#IF

needcoord(x1,y1,x2,y2) {
    MouseGetPos, x, y
    if !(x &lt; x1 || x &gt; x2 || y &lt; y1 || y &gt; y2)
        Return 999999 
}
esc::exitapp</code></pre></div>]]></content>
			<author>
				<name><![CDATA[CDLebo]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38751</uri>
			</author>
			<updated>2017-09-13T04:04:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=119304#p119304</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Исполнение скрипта в определенной области экрана]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=119213#p119213" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Зачем таймер, если по факту нажатия надо?</p></blockquote></div><p>Ну, это как-то совсем просто. Можно было бы пользователю не задавать такой вопрос, а самому найти ответ.</p>]]></content>
			<author>
				<name><![CDATA[svoboden]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34280</uri>
			</author>
			<updated>2017-09-09T17:55:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=119213#p119213</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Исполнение скрипта в определенной области экрана]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=119212#p119212" />
			<content type="html"><![CDATA[<p>Не знаю, я подумал, ему надо без активации на кнопку. Вот примерные координаты его вопроса Global x1 := 100, y1 := 100, x2 := 450, y2 := 500, если пользователь сам не подобрал их.</p>]]></content>
			<author>
				<name><![CDATA[svoboden]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34280</uri>
			</author>
			<updated>2017-09-09T17:53:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=119212#p119212</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Исполнение скрипта в определенной области экрана]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=119211#p119211" />
			<content type="html"><![CDATA[<p>Поиск в помощь:<br /></p><ul><li><p><a href="http://forum.script-coding.com/viewtopic.php?id=10984">AHK: Событие при клике в заданных координатах окна</a>;</p></li><li><p><a href="http://forum.script-coding.com/viewtopic.php?id=9475">AHK: Заблокировать клики мышью в определенных координатах окна</a>.</p></li></ul>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2017-09-09T17:31:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=119211#p119211</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Исполнение скрипта в определенной области экрана]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=119210#p119210" />
			<content type="html"><![CDATA[<p><a href="http://forum.script-coding.com/viewtopic.php?pid=81710#p81710">http://forum.script-coding.com/viewtopi … 710#p81710</a><br />Зачем таймер, если по факту нажатия надо?<br /></p><div class="codebox"><pre><code>#IF needcoord(0,0,100,100)
Shift::MsgBox,,,,0.1
#IF

needcoord(x1,y1,x2,y2) {
    MouseGetPos, x, y
    if !(x &lt; x1 || x &gt; x2 || y &lt; y1 || y &gt; y2)
        Return 1 
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2017-09-09T17:29:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=119210#p119210</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Исполнение скрипта в определенной области экрана]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=119203#p119203" />
			<content type="html"><![CDATA[<p>Подберите. Так Global x1 := 0, y1 := 0, x2 := 200, y2 := 200 определяет верхний левый угол.</p>]]></content>
			<author>
				<name><![CDATA[svoboden]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34280</uri>
			</author>
			<updated>2017-09-09T16:20:43Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=119203#p119203</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Исполнение скрипта в определенной области экрана]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=119201#p119201" />
			<content type="html"><![CDATA[<p><strong>svoboden</strong><br />Спасибо за помощь, попробую использовать этот скрипт. Подскажи как можно определить нужные мне координаты?</p>]]></content>
			<author>
				<name><![CDATA[CDLebo]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38751</uri>
			</author>
			<updated>2017-09-09T16:12:40Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=119201#p119201</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Исполнение скрипта в определенной области экрана]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=119197#p119197" />
			<content type="html"><![CDATA[<p>Вот вариант:<br /></p><div class="codebox"><pre><code>#Persistent
timer = 50
H = 4

SetTimer, CheckTimeIdle, % timer
SetTimer, TimeIdle, % timer
return

CheckTimeIdle:
H--
CoordMode, Mouse
Global x1 := 0, y1 := 0, x2 := 300, y2 := 300
    MouseGetPos, x, y
    if !(x &lt; x1 || x &gt; x2 || y &lt; y1 || y &gt; y2)
        send +{Click}
    if H = 0
    SetTimer, CheckTimeIdle, off
    SetTimer, CheckTimeIdle, off
return

TimeIdle:
    SetTimer, CheckTimeIdle, On
return</code></pre></div><p>Тут Global x1 := 0, y1 := 0, x2 := 300, y2 := 300 сам напиши координаты нужной области, а здесь timer = 50 устанавливаешь скорость кликов.</p>]]></content>
			<author>
				<name><![CDATA[svoboden]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34280</uri>
			</author>
			<updated>2017-09-09T15:37:09Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=119197#p119197</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Исполнение скрипта в определенной области экрана]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=119196#p119196" />
			<content type="html"><![CDATA[<p>Здравствуйте! Есть скрипт, который при зажатии определенной кнопки делает следующее: Зажать Shift и быстро нажимать ЛКМ. Хочу сделать чтоб этот скрипт действовал не во всей области экрана, а в определенно. Пример: Я зажал кнопку исполнения скрипта, скрипт начинает действие, но за определенной зоной он не делает никаких нажатий, а как только мышка зашла в зону действий он начинает зажимать Shift и быстро нажимать ЛКМ. Прошу помощи в создании такого скрипта. Всем заранее спасибо!<br /><span class="postimg"><img src="https://pp.userapi.com/c638631/v638631396/62b89/TZfG9lEPBFU.jpg" alt="https://pp.userapi.com/c638631/v638631396/62b89/TZfG9lEPBFU.jpg" /></span> Красная зона - зона, в которой будет происходить действие скрипта.<br />Сам скрипт:<br /></p><div class="codebox"><pre><code>#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

Numpad2::ExitApp

*x::
   While GetKeyState(&quot;x&quot;, &quot;P&quot;)
   {
   send {LShift down}
      Click
      Sleep, 50 
	  send {LShift up}
   }
   Return
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[CDLebo]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38751</uri>
			</author>
			<updated>2017-09-09T14:42:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=119196#p119196</id>
		</entry>
</feed>
