<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK:Скрипт - определенная ротация клавиш и пара кликов в приложении]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=6413</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=6413&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK:Скрипт - определенная ротация клавиш и пара кликов в приложении».]]></description>
		<lastBuildDate>Mon, 07 Nov 2011 13:21:18 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK:Скрипт - определенная ротация клавиш и пара кликов в приложении]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=53308#p53308</link>
			<description><![CDATA[<div class="codebox"><pre><code>IfWinActive ahk_class GxWindowClassD3d</code></pre></div><p>Поставте это условие внутри цикла и без #.</p><div class="codebox"><pre><code>l::
loop 
{ 
  IfWinActive ahk_class GxWindowClassD3d
  {
    sendinput 1
    sleep 1500
    sendinput 1
    sleep 1500
    sendinput 1
    sleep 1500
    sendinput 1
    sleep 1500
    sendinput 1
    sleep 1500
    sendinput 5
    sleep 1500
    sendinput 1 
    sleep 1500
    sendinput 1 
    sleep 1500
    sendinput 1 
    sleep 1500
    sendinput 1 
    sleep 1500
    sendinput 5 
    sleep 500
    sendinput 1 
    sleep 1500
    sendinput 1 
    sleep 1500
    sendinput 1 
    sleep 1000
    sendinput 1 
    sleep 1500
    sendinput 5 
    sleep 500
    MouseClick, right,  640,  443 
  }
  else
    sleep,100
}
return</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alectric)]]></author>
			<pubDate>Mon, 07 Nov 2011 13:21:18 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=53308#p53308</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:Скрипт - определенная ротация клавиш и пара кликов в приложении]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=53306#p53306</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>#IfWinActive ahk_class GxWindowClassD3d&quot; гарантирует, что скрипт будет работать только тогда, когда окно игры активно.</p></blockquote></div><p>Хоткей в скрипте запускает цикл который имитирует нажатия клавиш.</p><p>Чтобы скрипт действовал только на игру используйте <a href="http://www.autohotkey.net/~Lexikos/AutoHotkey_L/docs/commands/ControlSend.htm">ControlSend</a></p>]]></description>
			<author><![CDATA[null@example.com (creature.ws)]]></author>
			<pubDate>Mon, 07 Nov 2011 10:53:07 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=53306#p53306</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:Скрипт - определенная ротация клавиш и пара кликов в приложении]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=53305#p53305</link>
			<description><![CDATA[<p>Вроде всё правильно. Проверьте класс окна (не путать с элементами управления окна). Можно попробовать задать окно через заголовок, а не класс.</p>]]></description>
			<author><![CDATA[null@example.com (ypppu)]]></author>
			<pubDate>Mon, 07 Nov 2011 10:03:44 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=53305#p53305</guid>
		</item>
		<item>
			<title><![CDATA[AHK:Скрипт - определенная ротация клавиш и пара кликов в приложении]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=53304#p53304</link>
			<description><![CDATA[<p>Задача: Создать определенную последовательность нажатий и пару кликов в игре, не зависимо от того, свернута ли игра, активна или просто находится на заднем плане.</p><p>Мой вариант скрипта ( Скачал AHK пару часов назад ) :</p><div class="codebox"><pre><code>#IfWinActive ahk_class GxWindowClassD3d

l::
loop 
{ 
sendinput 1
sleep 1500
sendinput 1
sleep 1500
sendinput 1
sleep 1500
sendinput 1
sleep 1500
sendinput 1
sleep 1500
sendinput 5
sleep 1500
sendinput 1 
sleep 1500
sendinput 1 
sleep 1500
sendinput 1 
sleep 1500
sendinput 1 
sleep 1500
sendinput 5 
sleep 500
sendinput 1 
sleep 1500
sendinput 1 
sleep 1500
sendinput 1 
sleep 1000
sendinput 1 
sleep 1500
sendinput 5 
sleep 500
MouseClick, right,  640,  443 
} 
return</code></pre></div><p>Задача решена: по нажатию клавиши &quot;l&quot; в игре начинается цикл определенных нажатий + клик мышкой в определенном месте.<br />А строка &quot;#IfWinActive ahk_class GxWindowClassD3d&quot; гарантирует, что скрипт будет работать только тогда, когда окно игры активно.<br />Но этого не происходит. Стоит только переключиться с игры на другое приложение - скрипт продолжает работать уже в новом приложении.</p><p>Внимание вопрос : Как сделать так, чтобы скрипт действовал только на игру, а не на любое активное окно? Не зависимо от того, какое приложение активно в момент работы скрипта и от того, свернуто ли приложение World of Wаrсrаft.<br />Подозреваю, что решение как то связано с #IfWinActive, но ничего толкового придумать не смог.<br />Заранее спасибо за помощь.</p>]]></description>
			<author><![CDATA[null@example.com (Nialle)]]></author>
			<pubDate>Mon, 07 Nov 2011 09:53:52 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=53304#p53304</guid>
		</item>
	</channel>
</rss>
