<?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 залип*]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=14138</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=14138&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Loop залип*».]]></description>
		<lastBuildDate>Sun, 16 Sep 2018 08:32:44 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Loop залип*]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=128714#p128714</link>
			<description><![CDATA[<p><strong>slavafedora</strong>, почитайте тут (<a href="http://www.script-coding.com/AutoHotkey/Hotkeys.html">Rus</a>/<a href="https://autohotkey.com/docs_1.0/Hotkeys.htm">Eng</a>).</p>]]></description>
			<author><![CDATA[null@example.com (Gutalin)]]></author>
			<pubDate>Sun, 16 Sep 2018 08:32:44 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=128714#p128714</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Loop залип*]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=128709#p128709</link>
			<description><![CDATA[<p>Для чего нужна звёздочка перед биндом? <br />Что она выполняет? Не встречал раньше.<br /></p><div class="codebox"><pre><code>
*~vk01::
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (slavafedora)]]></author>
			<pubDate>Sun, 16 Sep 2018 05:39:54 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=128709#p128709</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Loop залип*]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=128524#p128524</link>
			<description><![CDATA[<div class="quotebox"><cite>romzes96 пишет:</cite><blockquote><p>MouseClickDrag</p></blockquote></div><p>Хрен редьки не слаще, Send / мышиным командам приходится отжимать зажатый вами LButton, который вы непонятно вообще с какой целью посылаете насквозь.<br />Либо не отправляйте нажатие самого хоткея насквозь, либо используйте аналоги мышиных команд через Send с опцией {Blind}.</p>]]></description>
			<author><![CDATA[null@example.com (stealzy)]]></author>
			<pubDate>Thu, 06 Sep 2018 15:46:00 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=128524#p128524</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Loop залип*]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=128519#p128519</link>
			<description><![CDATA[<p><strong>stealzy</strong> на вряд ли в этом проблема так как имеется еще 1 код а точнее еще одна часть 1-ого кода где тоже происходит &quot;залипание loop&quot;, но там бинд сам себя не отправляет. В общем вот как это выглядит вместе:</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.
#UseHook
#NoEnv
#Persistent
#KeyHistory, 0
#HotKeyInterval -1
#MaxHotkeysPerInterval 200
#InstallKeybdHook
#SingleInstance, Force
SetKeyDelay,  -1
SetMouseDelay, -1

#InstallMouseHook
SetBatchLines, -1
SetTimer, CheckKey, On
SetTimer, CheckKey, 1

x1 := A_ScreenWidth // 100
y1 := A_ScreenHeight // 50
x2 := A_ScreenWidth // 2
y2 := A_ScreenHeight // 4

#If WinActive(&quot;ahk_class xxx&quot;)

*~MButton::
Send, {scF}
Sleep, 10 ; Задержка
Loop ; Цикл
{
	Sleep, 1
	MouseClickDrag, Left, %x1%, %y1%, %x2%, %y2% , 0 ; Передвижение мыши
	GetKeyState, state, MButton, P
	if state = U  ; Клавиша отпущена, поэтому выйти из цикла.
		break
}
Send, {scF} ; Закрыть инвентарь
KeyWait MButton
return


vk5B &amp; vk52::return

vk5B::return

~F6::Suspend

*~End::ExitApp

CheckKey:
GetKeyState, state, LButton 
GetKeyState, state, MButton
Return


*~LButton::
Loop ; Цикл
{
	Sleep, 5
	Send, {LButton}
	moveAmount := (moveAmount = 2) ? 3 : 0
	mouseXY(moveAmount,4.7)
	GetKeyState, state, LButton, P
	if state = U  ; Клавиша отпущена, поэтому выйти из цикла.
		break
}
mouseXY(x,y)
{
	DllCall(&quot;mouse_event&quot;,int,1,int,x,int,y,uint,0,uint,0)
}
; _____________________________________________

KeyWait, LButton
Return
; _____________________________________________

*~XButton2::
Send, 2
Send, 1
Return

*XButton1::
Send, {LButton Down}
KeyWait, XButton1
Send, {LButton Up}
KeyWait, XButton1
Return</code></pre></div><p>Оба лупа <strong>ИНОГДА</strong> зацикливаются. Хотя бинд уже отжат. И циклы не останавливаются пока бинд не будет повторно нажат.<br />SetTimer вообще не как не повлиял на код, даже если его значение равно 1.<br />Не могу понять в чем проблема.</p>]]></description>
			<author><![CDATA[null@example.com (romzes96)]]></author>
			<pubDate>Thu, 06 Sep 2018 08:01:29 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=128519#p128519</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Loop залип*]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=128498#p128498</link>
			<description><![CDATA[<p>Используйте цикл While вместо Loop.</p>]]></description>
			<author><![CDATA[null@example.com (powercat)]]></author>
			<pubDate>Wed, 05 Sep 2018 14:46:02 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=128498#p128498</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Loop залип*]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=128487#p128487</link>
			<description><![CDATA[<p>Здравствуйте, не подскажите в чем может быть проблема(?)<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.
#UseHook
#NoEnv
#Persistent
#KeyHistory, 0
#HotKeyInterval -1
#MaxHotkeysPerInterval 200
#InstallKeybdHook
#SingleInstance, Force
SetKeyDelay,  -1
SetMouseDelay, -1

#InstallMouseHook
SetBatchLines, -1
SetTimer, CheckKey, On
SetTimer, CheckKey, 1

*~LButton::
Loop ; Цикл
{
	Sleep, 5
	Send, {LButton}
	moveAmount := (moveAmount = 2) ? 3 : 0
	mouseXY(moveAmount,4.7)
	GetKeyState, state, LButton, P
	if state = U  ; Клавиша отпущена, поэтому выйти из цикла.
		break
}
mouseXY(x,y)
{
	DllCall(&quot;mouse_event&quot;,int,1,int,x,int,y,uint,0,uint,0)
}

KeyWait, LButton
Return</code></pre></div><p>Беда в том что при нажатие LButton <strong>ИНОГДА</strong> скрипт не выходит из циклы и думает что LButton до сих пор в статусе &quot;Нажата&quot;. Хотя кнопка мыши уже давно отпущена. </p><p>Есть еще один код написанный за долго до первого и в нем данной проблемы вроде бы нет. Вот он:</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.

#NoEnv
SendMode Input

~F5::Suspend

~End::ExitApp

*~LButton::
Loop ; Цикл
{
	Sleep, 5
	moveAmount := (moveAmount = 2) ? 3 : 0
	mouseXY(moveAmount,4.5)
	GetKeyState, state, LButton, P
	if state = U  ; Клавиша отпущена, поэтому выйти из цикла.
		break
}
mouseXY(x,y)
{
	DllCall(&quot;mouse_event&quot;,int,1,int,x,int,y,uint,0,uint,0)
}</code></pre></div><p>Структура вроде одна, но <strong>второй/это</strong>т скрипт не залипает в цикле...</p><p>В первом коде SetTimer не помог решить данную проблему. Не подскажите может быть в первом коде что-то лишнее имеется(?)<br />Спасибо!</p>]]></description>
			<author><![CDATA[null@example.com (romzes96)]]></author>
			<pubDate>Wed, 05 Sep 2018 09:25:36 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=128487#p128487</guid>
		</item>
	</channel>
</rss>
