<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Привязка скрипта ко времени операционной системы windows.]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=11620&amp;type=atom" />
	<updated>2016-12-21T21:58:47Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=11620</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Привязка скрипта ко времени операционной системы windows.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=109993#p109993" />
			<content type="html"><![CDATA[<p><strong>serzh82saratov</strong>, а в чем проявляется функционал сценария? После запуска, наблюдаю TrayTip о следующем заданном времени. Когда заданное время наступает, ничего не происходит.</p>]]></content>
			<author>
				<name><![CDATA[becauseim]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33149</uri>
			</author>
			<updated>2016-12-21T21:58:47Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=109993#p109993</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Привязка скрипта ко времени операционной системы windows.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=104110#p104110" />
			<content type="html"><![CDATA[<p><strong>serzh82saratov</strong> Запустил на домашнем ПК ваш скрипт, всё работает. Благодарствую !</p>]]></content>
			<author>
				<name><![CDATA[panamaboot]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27546</uri>
			</author>
			<updated>2016-05-23T18:50:25Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=104110#p104110</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Привязка скрипта ко времени операционной системы windows.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=104076#p104076" />
			<content type="html"><![CDATA[<p>Очень интересно ! Но выдаёт ошибку Call to nonexistent function&nbsp; на строку </p><div class="codebox"><pre><code>Hours := Format(&quot;{:02}&quot;, Time // 3600000)</code></pre></div><p> Могли бы вы раскоментировать&nbsp; ваш скрипт, не могу понять где задавать время , и хочется понять как он работает. Т.е. это таймер на 24 часа или он привязан ко времени ОС. Пробую синхронизировать работу двух скриптов . Первый работает в цикле круглосуточно и останавливается в&nbsp; начале каждого часа ( или заданного времени 13.00, 16.00) на 5 минут , в это время включается второй скрипт, по его завершении ( или через те же 5 минут) обратно включается первый.</p>]]></content>
			<author>
				<name><![CDATA[panamaboot]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27546</uri>
			</author>
			<updated>2016-05-23T07:10:58Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=104076#p104076</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Привязка скрипта ко времени операционной системы windows.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=104068#p104068" />
			<content type="html"><![CDATA[<p>Суточные сигналы можно задать одним таймером, циклы с проверками не нужны.<br />В Times можно занести время с секундами или без них, в любом порядке и количестве, перезапускать скрипт можно в любой момент.<br /></p><div class="codebox"><pre><code>
#SingleInstance Force
#Persistent
#NoEnv

Times := [&quot;01:00&quot;,&quot;00:59:50&quot;] 
NewTimer(Times)
Return

NewTimer(Arr)  {
	For k, value in Arr
		odds := DifferenceTime(value)
		, (!Min || Min &gt; odds) 
		&amp;&amp; (Min := odds, Time := value) 
	hFunc := Func(&quot;Timer&quot;).Bind(Time, Arr)
	SetTimer, % hFunc, % -Min
	TrayTip, % &quot;Следующий в:&quot;, % &quot;`n&quot; Time &quot;`n`nЧерез:`n`n&quot; FormatTime(Min) 
}

Timer(Time, List)  {
	MsgBox, , , % Time, 1
	NewTimer(List)
}

DifferenceTime(Time)  {
	T := StrSplit(Time, &quot;:&quot;)
    Time := Time2 := A_YYYY A_MM A_DD T[1] T[2] (T[3] ? T[3] : &quot;00&quot;)
    EnvSub, Time, A_Now, Second
    Time := (Time * 1000) - A_MSec
    If Time &gt;= 0
        Return Time
    Time2 += 1, days
    EnvSub, Time2, A_Now, Second
    Return (Time2 * 1000) - A_MSec
}

FormatTime(Time)  {
	Rest := Mod(Time, 3600000)
	Hours := Format(&quot;{:02}&quot;, Time // 3600000)
	Min := Format(&quot;{:02}&quot;, Rest // 60000)
	Sec := Format(&quot;{:02}&quot;, Mod(Rest, 60000) // 1000)
	MSec := Format(&quot;{:03}&quot;, Mod(Rest, 1000)) 
	Return Hours &quot;:&quot; Min &quot;:&quot; Sec &quot;,&quot; MSec
}
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2016-05-22T22:00:38Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=104068#p104068</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Привязка скрипта ко времени операционной системы windows.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=104060#p104060" />
			<content type="html"><![CDATA[<p>Я находил такой пример:<br /></p><div class="codebox"><pre><code>if(A_Hour &gt;= 10 &amp;&amp; A_Min &gt; 00)
{
    MsgBox, 10:00
}
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[becauseim]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33149</uri>
			</author>
			<updated>2016-05-22T18:21:41Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=104060#p104060</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Привязка скрипта ко времени операционной системы windows.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=104056#p104056" />
			<content type="html"><![CDATA[<p>Всех приветствую. Возник вопрос ! Можно ли в ahk привязать работу скрипта ко времени ос windows . <br />Допустим что-бы в 10.00 и 18.00&nbsp; MsgBox выдавал заданное сообщение?</p>]]></content>
			<author>
				<name><![CDATA[panamaboot]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27546</uri>
			</author>
			<updated>2016-05-22T17:45:10Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=104056#p104056</id>
		</entry>
</feed>
