<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Как сделать, чтобы скрипт не зависал от ожидания GET запроса?]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=12325&amp;type=atom" />
	<updated>2017-01-17T04:21:01Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=12325</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как сделать, чтобы скрипт не зависал от ожидания GET запроса?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111169#p111169" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, большое спасибо! Все работает!</p>]]></content>
			<author>
				<name><![CDATA[Finx]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34499</uri>
			</author>
			<updated>2017-01-17T04:21:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111169#p111169</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как сделать, чтобы скрипт не зависал от ожидания GET запроса?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111168#p111168" />
			<content type="html"><![CDATA[<p>Пример:<br /></p><div class="codebox"><pre><code>#Persistent
url := &quot;https://autohotkey.com/download/1.1/AutoHotkey_1.1.24.04_setup.exe&quot;  ; установщик AHK
DownloadPath := A_Desktop &quot;\ahk-install.exe&quot;

xmlhttp := ComObjCreate(&quot;Msxml2.XMLHTTP&quot;)
xmlhttp.Open(&quot;GET&quot;, url, true)  ; асинхронный запрос — третий параметр true
xmlhttp.onreadystatechange := Func(&quot;Ready&quot;).Bind(xmlhttp, DownloadPath)
xmlhttp.Send()

i := 0
Loop  {
   ToolTip % &quot;Скрипт может заниматься чем-то, пока файл загружается. Считаем i = &quot; i++
   Sleep, 100
}
Return

Ready(xmlhttp, path)  {
   if !(xmlhttp.readyState = 4 &amp;&amp; xmlhttp.status = 200)
      Return
   
   stream := ComObjCreate(&quot;ADODB.Stream&quot;)
   stream.type := 1  ; Binary data
   stream.Open
   stream.Write(xmlhttp.responseBody)
   stream.SaveToFile(path, 2)   ; Overwrites the file
   stream.Close
   ExitApp
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2017-01-16T23:33:39Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111168#p111168</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как сделать, чтобы скрипт не зависал от ожидания GET запроса?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111167#p111167" />
			<content type="html"><![CDATA[<p><strong>stealzy</strong>, все подготовлено лишь на PHP, а вот с АХК проблемы, не могу сделать отдельное ожидание</p>]]></content>
			<author>
				<name><![CDATA[Finx]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34499</uri>
			</author>
			<updated>2017-01-16T22:35:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111167#p111167</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как сделать, чтобы скрипт не зависал от ожидания GET запроса?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111165#p111165" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, я не программист, я не понимаю. (</p>]]></content>
			<author>
				<name><![CDATA[Finx]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34499</uri>
			</author>
			<updated>2017-01-16T22:31:14Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111165#p111165</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как сделать, чтобы скрипт не зависал от ожидания GET запроса?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111164#p111164" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Finx пишет:</cite><blockquote><p>Как сделать, чтобы скрипт не зависал от ожидания GET запроса?</p></blockquote></div><p>Пользоваться асинхронными запросами.</p><div class="quotebox"><cite>Finx пишет:</cite><blockquote><p>прошу объяснить в мелочах про COM, и дать ссылку на скачивание</p></blockquote></div><p>Для использования COM ничего скачивать не нужно, AHK <a href="https://autohotkey.com/docs/commands/ComObjActive.htm">поддерживает</a> её нативно.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2017-01-16T22:01:40Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111164#p111164</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Как сделать, чтобы скрипт не зависал от ожидания GET запроса?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111163#p111163" />
			<content type="html"><![CDATA[<p>Здравствуйте, пишу маленькую систему общения между собой, а именно от одно юзера к другому.<br />Сея проблема такова, у меня есть Gui, в котором так скажем есть несколько фишек.<br />Но как мы знаем, в дефолтном виде нельзя юзать два потока, что очень огорчает!<br />Мне бы хотелось узнать, существует ли какой-либо способ помимо COM? Задача:<br />Дан цикл через Loop, мне требуется, чтобы он работал сам по себе, а при получении ответа просто заносил его в .txt файл.<br />Если же нет таких способов, прошу объяснить в мелочах про COM, и дать ссылку на скачивание, с autohotkey.net удалили(<br />Спасибо за уделенное время!</p>]]></content>
			<author>
				<name><![CDATA[Finx]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34499</uri>
			</author>
			<updated>2017-01-16T21:35:33Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111163#p111163</id>
		</entry>
</feed>
