<?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=17257&amp;type=atom" />
	<updated>2022-07-21T22:42:33Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=17257</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Зажать или отпустить клавишу в зависимости от цвета пикселя]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=154013#p154013" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Cucumber пишет:</cite><blockquote><p>после зажатия LMB, скрипт ничего не делает.</p></blockquote></div><p>А почему вы так решили? Можно добавить отладочные сообщения:<br /></p><div class="codebox"><pre><code>Loop
{
    PixelGetColor, right, 1710, 1037, RGB
    PixelGetColor, left, 1711, 1037, RGB
    PixelGetColor, mid, 1709, 1037, RGB
    if ( right = &quot;0x4fb8ff&quot; or left = &quot;0x4fb8ff&quot; or mid = &quot;0x4fb8ff&quot; ) 
    {
        if Not @error
        Break
    }
}
MsgBox, скрипт вышел из первого цикла
Send, {LButton down}
Loop 
{
    ToolTip скрипт вошёл во второй цикл
    
    PixelGetColor, right, 1810, 1037, RGB
    PixelGetColor, left, 1811, 1037, RGB
    PixelGetColor, mid, 1809, 1037, RGB
    if ( right = &quot;0x58de80&quot; or left = &quot;0x58de80&quot; or mid = &quot;0x58de80&quot; ) 
    {
        if Not @error
        Break
    }
}
MsgBox, скрипт вышел из второго цикла
Send, {LButton up}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2022-07-21T22:42:33Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=154013#p154013</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Зажать или отпустить клавишу в зависимости от цвета пикселя]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=154012#p154012" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, Перефразирую.<br />Находим пиксель ( 0x4fb8ff ), далее зажимаем LMB. Ищем в других координатах пиксель с цветом ( 0x58de80 ), если находим, то отжимаем LMB.<br /></p><div class="codebox"><pre><code>Loop
{
    PixelGetColor, right, 1710, 1037, RGB
    PixelGetColor, left, 1711, 1037, RGB
    PixelGetColor, mid, 1709, 1037, RGB
    if ( right = &quot;0x4fb8ff&quot; or left = &quot;0x4fb8ff&quot; or mid = &quot;0x4fb8ff&quot; ) 
    {
        if Not @error
        Break
    }
}
Send, {LButton down}
Loop 
{
    PixelGetColor, right, 1810, 1037, RGB
    PixelGetColor, left, 1811, 1037, RGB
    PixelGetColor, mid, 1809, 1037, RGB
    if ( right = &quot;0x58de80&quot; or left = &quot;0x58de80&quot; or mid = &quot;0x58de80&quot; ) 
    {
        if Not @error
        Break
    }
}
Send, {LButton up}</code></pre></div><p>У меня проблема в том, что после зажатия LMB, скрипт ничего не делает.</p>]]></content>
			<author>
				<name><![CDATA[Cucumber]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=42689</uri>
			</author>
			<updated>2022-07-21T22:32:50Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=154012#p154012</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Зажать или отпустить клавишу в зависимости от цвета пикселя]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=154011#p154011" />
			<content type="html"><![CDATA[<p>Я, честно говоря, не очень понял вопрос.<br /></p><div class="quotebox"><cite>Cucumber пишет:</cite><blockquote><p>Когда пиксель ( 0x0af70f ) появляется на определенный координатах, то нужно ЗАЖАТЬ клавишу, после того, как пиксель изменяется в отмеченной зоне, клавиша отжимается, а скрипт продолжает выполнять следующее условие.</p></blockquote></div><p>Что за «следующее условие»? Под условием обычно понимается конструкция if-else. И что значит «продолжает выполнять»? Он его уже выполняет в данный момент? Я поэтому просто указал на явную ошибку, может в ней и была проблема.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2022-07-21T22:08:21Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=154011#p154011</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Зажать или отпустить клавишу в зависимости от цвета пикселя]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=154010#p154010" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, хорошо, Я понял, что вы мне написали про Then, спасибо, но я задавал другой вопрос.</p>]]></content>
			<author>
				<name><![CDATA[Cucumber]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=42689</uri>
			</author>
			<updated>2022-07-21T20:55:25Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=154010#p154010</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Зажать или отпустить клавишу в зависимости от цвета пикселя]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=154005#p154005" />
			<content type="html"><![CDATA[<p>Ну, если что-то в переменную @error поместить, тогда будет работать, но в вашем коде этого не происходит. В любом случае слово Then лишнее, AHK его воспринимает, как пустую переменную.<br /></p><div class="codebox"><pre><code>Then := true
@error := false
if Not @error Then
   MsgBox, no error
else
   MsgBox, error</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2022-07-20T23:56:16Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=154005#p154005</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Зажать или отпустить клавишу в зависимости от цвета пикселя]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=154003#p154003" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p> это не работает.</p></blockquote></div><p>Не работает в общем или не будет работать в выполнении поставленного выше условия?<br />Я хочу доработать код, чтобы не зависеть от cooldown&#039;a в игре, а выполнять все по мере появления или исчезновении пикселей.</p>]]></content>
			<author>
				<name><![CDATA[Cucumber]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=42689</uri>
			</author>
			<updated>2022-07-20T23:11:57Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=154003#p154003</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Зажать или отпустить клавишу в зависимости от цвета пикселя]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=154002#p154002" />
			<content type="html"><![CDATA[<p>Поверьте, в таком виде это не работает.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2022-07-20T23:00:46Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=154002#p154002</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Зажать или отпустить клавишу в зависимости от цвета пикселя]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=154001#p154001" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, Да, у меня это работает.</p>]]></content>
			<author>
				<name><![CDATA[Cucumber]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=42689</uri>
			</author>
			<updated>2022-07-20T22:59:04Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=154001#p154001</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Зажать или отпустить клавишу в зависимости от цвета пикселя]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=154000#p154000" />
			<content type="html"><![CDATA[<p>Думаете, AHK такое понимает?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2022-07-20T22:57:18Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=154000#p154000</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Зажать или отпустить клавишу в зависимости от цвета пикселя]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=153999#p153999" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, Ам... *Если нет ошибок, то*. <br />В моем случае, если найден нужный пиксель (и вообще все правильно), то выполняется действие.</p>]]></content>
			<author>
				<name><![CDATA[Cucumber]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=42689</uri>
			</author>
			<updated>2022-07-20T22:54:29Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=153999#p153999</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Зажать или отпустить клавишу в зависимости от цвета пикселя]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=153998#p153998" />
			<content type="html"><![CDATA[<p>А что за интересная конструкция <em>if Not @error Then</em> ? Что это означает?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2022-07-20T20:35:49Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=153998#p153998</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Зажать или отпустить клавишу в зависимости от цвета пикселя]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=153995#p153995" />
			<content type="html"><![CDATA[<p>Здравствуйте, нужна помощь.<br />Когда пиксель ( 0x0af70f ) появляется на определенный координатах, то нужно ЗАЖАТЬ клавишу, после того, как пиксель изменяется в отмеченной зоне, клавиша отжимается, а скрипт продолжает выполнять следующее условие.</p><p>У меня в коде останавливается на зажатие LMB:<br /></p><div class="codebox"><pre><code>Loop
{
    PixelGetColor, right, 1710, 1037, RGB
    PixelGetColor, left, 1711, 1037, RGB
    PixelGetColor, mid, 1709, 1037, RGB
    if ( right = &quot;0x4fb8ff&quot; or left = &quot;0x4fb8ff&quot; or mid = &quot;0x4fb8ff&quot; ) 
    {
        if Not @error Then
        Break
    }
}
Send, {LButton down}
Loop 
{
    PixelGetColor, right, 1710, 1037, RGB
    PixelGetColor, left, 1711, 1037, RGB
    PixelGetColor, mid, 1709, 1037, RGB
    if ( right = &quot;0x58de80&quot; or left = &quot;0x58de80&quot; or mid = &quot;0x58de80&quot; ) 
    {
        if Not @error Then
        Break
    }
}
Send, {LButton up}</code></pre></div><p>Можно ли как то соединить два Loop&#039;a, чтобы соответствовало выше написанному?</p>]]></content>
			<author>
				<name><![CDATA[Cucumber]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=42689</uri>
			</author>
			<updated>2022-07-20T11:21:58Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=153995#p153995</id>
		</entry>
</feed>
