<?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=9827&amp;type=atom" />
	<updated>2014-07-27T06:26:21Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=9827</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Говорящие часы с будильником.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=85269#p85269" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Zanoza пишет:</cite><blockquote><p>А не проще ли использовать сам&nbsp; Голосовой движок SAPI5 &quot;Алена&quot; и прикрутить к нему скрипт?</p></blockquote></div><p>Наверное не очень хороший вариант. <br />Попробовал ,установил, работает. Конечно мило, но с точки зрения кроссплатформенности и простоты использования - сложно.<br />Допустим моя мама не сможет установить такие часы никогда и никуда.</p>]]></content>
			<author>
				<name><![CDATA[Selja8]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32415</uri>
			</author>
			<updated>2014-07-27T06:26:21Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=85269#p85269</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Говорящие часы с будильником.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=85261#p85261" />
			<content type="html"><![CDATA[<p><a href="https://yadi.sk/d/KY5MhSzIXk5hw">https://yadi.sk/d/KY5MhSzIXk5hw</a><br />Код.<br /></p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><div class="codebox"><pre><code>#SingleInstance Force
SetWorkingDir %A_ScriptDir%
HideArr := Object()
Global compliance := {}
  
applicationname=oclock
SetingsTime=1200
;**************
a1=NUKEXPLO.wav
a2=MEHANICS.waw
a3=MEHANIx.waw
a4=NUKEXPLO2.mp3
SeALARM= %A3%
i1=Metro.mp3
i2=X.wav
i3=Clock.wav
SeINTRO= %i2%
SeHKI=^printscreen
SeHKS=^#printscreen
;**************
gosub ini
Loop 60 
    n := A_Index-1, n := n &lt; 10 ? 0 n : n, a := StrSplit(n) 
    , compliance[n] := a[2] &gt; 4 || a[2] = 0 || a[1] = 1 ? 3 : a[2] &gt; 1 &amp;&amp; a[2] &lt; 5 ? 2 : 1 
    loop
    {
    
    sleep 1500
    777=%A_Hour%%A_Min%
    gosub ini
    if 777 in %clock2% 
    {
    SoundPlay, %ALARM% , wait    
    gosub 555
    }
    } 
return
  


!space:: gosub 555
555:
SoundPlay, %INTRO%, wait
Speech(A_Hour, A_Min) 
return    
Speech(h, m)  { 
    a := StrSplit(h)
    SoundPlay, % (h = &quot;00&quot; ? 0 : a[1] = 0 ? &quot;&quot; : a[1] = 1 ? h : a[1] 0) &quot;.wav&quot;, wait
    SoundPlay, % (a[1] = 1 || a[2] = 0 ? &quot;&quot; : a[2]) &quot;.wav&quot;, wait
    SoundPlay, % &quot;Hour_&quot; compliance[h] &quot;.wav&quot;, wait
    a := StrSplit(m)
    SoundPlay, % (a[1] = 0 ? &quot;&quot; : a[1] = 1 ? m : a[1] 0) &quot;.wav&quot;, wait
    SoundPlay, % (a[1] = 1 || (a[2] = 0 &amp;&amp; a[1] &gt; 1) ? &quot;&quot; : a[2] = 1 || a[2] = 2 ? a[2] &quot;M&quot; : a[2]) &quot;.wav&quot;, wait
    SoundPlay, % &quot;Min_&quot; compliance[m] &quot;.wav&quot;, wait 
}  
    return
 
    
#!space::

SETTINGS:
        Gui,Destroy
        Gui,Add,GroupBox, x12 y10 w230 h350,clock
        Gui,Add,Button, x202 y380 w100 h30 GSETTINGSOK,Сохранить
        Gui,Add,Button, x332 y380 w100 h30 GSETTINGSCANCEL Default, &amp;Отмена
        Gui,Add,Edit,x22 y30 w210 h320 vsclock,%clock2%
        Gui,Show, x127 y87 h427 w509,%applicationname% Settings %A_hour%:%A_min%
        Gui, Add, GroupBox, x252 y10 w220 h140 , ALARM
        Gui, Add, Radio, x262 y30 w200 h20 Group vsA1 , NUKEXPLO
        Gui, Add, Radio, x262 y60 w200 h20 vsA2 , MEHANICS
        Gui, Add, Radio, x262 y90 w200 h20 vsA3 , MEHANIX
        Gui, Add, Radio, x262 y120 w200 h20 vsA4 Checked, NUKEXPLO2 
        Gui, Add, GroupBox, x252 y160 w220 h110 , INTRO
        Gui, Add, Radio, x262 y180 w200 h20 vsi1 Group Checked, METRO
        Gui, Add, Radio, x262 y210 w200 h20 vsi2, X
        Gui, Add, Radio, x262 y240 w200 h20 vsi3, Clock
        Gui, Add, Button, x72 y380 w100 h30 GExit, Exit_Clock
    Return

Exit:
 ExitApp
 
SETTINGSOK:
        Gui,Submit
        clock:=sclock
        HKI:=sHKI
        HKS:=sHKS
        if sA1 &gt; 0
        sALARM:=A1
        else if sA2 &gt; 0
        sALARM:=A2
        else if sA3 &gt; 0
        sALARM:=A3
        else if sA4 &gt; 0
        sALARM:=A4
        if si1 &gt; 0
        II:=i1
        else if si2 &gt; 0
        II:=i2
        else if si3 &gt; 0
        II:=i3
        IniWrite,%clock%,%applicationname%.ini,Settings,Time
        IniWrite,%sALARM%,%applicationname%.ini,Settings,ALARM
        IniWrite,%II%,%applicationname%.ini,Settings,INTRO
    Return

SETTINGSCANCEL:
        Gui,Destroy
    Return

INI:
    IfNotExist,%applicationname%.ini
    {
        IniWrite, %SetingsTime% ,%applicationname%.ini,Settings,Time
        IniWrite, %SeALARM% ,%applicationname%.ini,Settings,ALARM
        IniWrite, %SeINTRO% ,%applicationname%.ini,Settings,INTRO
    } else
    {
        IniRead,clock2,%applicationname%.ini,Settings,Time
        IniRead,ALARM,%applicationname%.ini,Settings,ALARM
        IniRead,INTRO,%applicationname%.ini,Settings,INTRO
    }
    If clock2=ERROR
        clock2=1200
    If ALARM=ERROR
        ALARM=MEHANIx.waw
    If INTRO=ERROR
        INTRO=x.waw
    If HKI=ERROR
        HKI=^printscreen
    If HKS=ERROR
        HKS=^#printscreen
    return
    
^F1::reload</code></pre></div></div></div><p>Правда я так и не доделал админку.<br />Но в целом всё работает. <br />Всем огромное спасибо, без Вас я бы не справился.</p>]]></content>
			<author>
				<name><![CDATA[Selja8]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32415</uri>
			</author>
			<updated>2014-07-26T12:34:50Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=85261#p85261</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Говорящие часы с будильником.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=85256#p85256" />
			<content type="html"><![CDATA[<p>А не проще ли использовать сам&nbsp; Голосовой движок SAPI5 &quot;Алена&quot; и прикрутить к нему скрипт?<br /><a href="http://rutracker.org/forum/viewtopic.php?t=3475243">http://rutracker.org/forum/viewtopic.php?t=3475243</a></p>]]></content>
			<author>
				<name><![CDATA[Zanoza]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26155</uri>
			</author>
			<updated>2014-07-26T09:40:54Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=85256#p85256</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Говорящие часы с будильником.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=85239#p85239" />
			<content type="html"><![CDATA[<p>Все заработало.<br />Завтра доделаю настройки.<br />Еще раз спасибо, всего доброго.</p>]]></content>
			<author>
				<name><![CDATA[Selja8]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32415</uri>
			</author>
			<updated>2014-07-25T10:51:42Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=85239#p85239</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Говорящие часы с будильником.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=85235#p85235" />
			<content type="html"><![CDATA[<p>Не надо ломать голову, так ведь и сломать можно. Надо просто прочитать справку.<br /><a href="http://www.script-coding.com/AutoHotkey/If_var_%20in.html">If var [not] in value1,value2,...</a><br /></p><div class="quotebox"><blockquote><p>Пробелы и табуляции до и после запятых имеют значение</p></blockquote></div><p>Здесь после запятых пробелы не пишутся.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2014-07-25T09:09:51Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=85235#p85235</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Говорящие часы с будильником.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=85234#p85234" />
			<content type="html"><![CDATA[<p>Посмотрите пожалуйста, я уже всю голову себе сломал. Переменная работает. Условие нет.<br /><a href="https://yadi.sk/d/a5UQKhWRXJpzT">https://yadi.sk/d/a5UQKhWRXJpzT</a></p>]]></content>
			<author>
				<name><![CDATA[Selja8]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32415</uri>
			</author>
			<updated>2014-07-25T08:55:28Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=85234#p85234</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Говорящие часы с будильником.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=85232#p85232" />
			<content type="html"><![CDATA[<p>Значит что то не так с переменной clock2.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2014-07-25T08:51:41Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=85232#p85232</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Говорящие часы с будильником.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=85231#p85231" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>loop
{
gosub ini
sleep 1500
777 := &quot;&quot;
777=%A_Hour%%A_Min%
if 777 in %clock2%
{
SoundPlay,%ALARM%        , wait
gosub 555
}
} </code></pre></div><p>Сейчас не работает условие-<br /></p><div class="codebox"><pre><code>if 777 in %clock2%
{
SoundPlay,%ALARM%        , wait
gosub 555
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Selja8]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32415</uri>
			</author>
			<updated>2014-07-25T08:49:18Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=85231#p85231</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Говорящие часы с будильником.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=85229#p85229" />
			<content type="html"><![CDATA[<p>А сейчас что не работает?</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2014-07-25T08:02:50Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=85229#p85229</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Говорящие часы с будильником.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=85228#p85228" />
			<content type="html"><![CDATA[<p>В прошлой версии скрипта всё работало.</p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><div class="codebox"><pre><code>#Include %A_ScriptDir%
HideArr := Object()
applicationname=oclock
SetingsTime=2000
;**************
1=NUKEXPLO.wav
2=MEHANICS.waw
3=MEHANIx.waw
sound= %1%
;**************


loop
{
gosub ini
sleep 1500
777 := &quot;&quot;
777=%A_Hour%%A_Min%
if 777 in %clock2%
{
SoundPlay,%sound%        , wait
gosub %777%
}
}


F22::
777 := &quot;&quot;
777=%A_Hour%%A_Min%
gosub %777%
return

0000:
SoundPlay,clock.wav        , wait
SoundPlay,x.wav            , wait
SoundPlay,0.wav            , wait
SoundPlay,Hours.wav        , wait
SoundPlay,0.wav            , wait
SoundPlay,Minutes.wav    , wait
return

f2::

SETTINGS:
            
        Gui,Destroy
        Gui,Add,GroupBox, x12 y10 w230 h350,clock
        Gui,Add,Button, x202 y380 w100 h30 GSETTINGSOK,Сохранить
        Gui,Add,Button, x332 y380 w100 h30 GSETTINGSCANCEL,&amp;Отмена
        Gui,Add,Edit,x22 y30 w210 h320 vsclock,%clock2%
        Gui,Show, x127 y87 h427 w509,%applicationname% Settings
    Return


SETTINGSOK:
        Gui,Submit
        clock:=sclock
        IniWrite,%clock%,%applicationname%.ini,Settings,Time
    Return

SETTINGSCANCEL:
        Gui,Destroy
    Return

INI:
    IfNotExist,%applicationname%.ini
        IniWrite, %SetingsTime% ,%applicationname%.ini,Settings,Time
        IniRead,clock2,%applicationname%.ini,Settings,Time
    If clock2=ERROR
        clock2=1200
    return
</code></pre></div></div></div>]]></content>
			<author>
				<name><![CDATA[Selja8]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32415</uri>
			</author>
			<updated>2014-07-25T08:00:44Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=85228#p85228</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Говорящие часы с будильником.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=85227#p85227" />
			<content type="html"><![CDATA[<p>Ну так нововведения тут не причём. На работу вашего цикла они никак невлияют. Вы просто сами не можете понять (или другим объяснить), чего вы хотите добится в этом цикле.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2014-07-25T07:26:58Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=85227#p85227</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Говорящие часы с будильником.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=85224#p85224" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>Loop 60 
    n := A_Index-1, n := n &lt; 10 ? 0 n : n, a := StrSplit(n) 
    , compliance[n] := a[2] &gt; 4 || a[2] = 0 || a[1] = 1 ? 3 : a[2] &gt; 1 &amp;&amp; a[2] &lt; 5 ? 2 : 1 
    loop
    {
    msgbox %ALARM% простая переменная
    gosub ini
    msgbox %clock2%
    sleep 1500
    777=%A_Hour%%A_Min%
    if 777 in %clock2%
    
    msgbox %ALARM% переменная вместо SoundPlay    
    gosub 555
    
    } </code></pre></div><p>А в таком виде: </p><div class="codebox"><pre><code>msgbox %ALARM% переменная вместо SoundPlay</code></pre></div><p>&nbsp; -пропускает, а </p><div class="codebox"><pre><code>gosub 555</code></pre></div><p> <br />&nbsp; -выполняет.</p><p>При этом&nbsp; </p><div class="codebox"><pre><code>msgbox %ALARM% простая переменная
 gosub ini
    msgbox %clock2%</code></pre></div><p> работает.</p>]]></content>
			<author>
				<name><![CDATA[Selja8]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32415</uri>
			</author>
			<updated>2014-07-25T07:06:51Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=85224#p85224</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Говорящие часы с будильником.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=85220#p85220" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>Будильник всё равно не работает.</p></blockquote></div><p>У меня работает.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2014-07-25T06:54:49Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=85220#p85220</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Говорящие часы с будильником.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=85219#p85219" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>У меня работает.</p></blockquote></div><div class="codebox"><pre><code>loop
{
msgbox %ALARM% простая переменная
gosub ini
msgbox %clock2%
sleep 1500
777=%A_Hour%%A_Min%
if 777 in %clock2%
{
Msgbox %ALARM% переменная вместо SoundPlay    
gosub 555
}
} </code></pre></div><p>msgbox %ALARM% переменная вместо SoundPlay НЕ ВЫПОЛНЯЕТСЯ.</p>]]></content>
			<author>
				<name><![CDATA[Selja8]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32415</uri>
			</author>
			<updated>2014-07-25T06:54:19Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=85219#p85219</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Говорящие часы с будильником.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=85218#p85218" />
			<content type="html"><![CDATA[<p>Да, таком виде работает. И %ВСЕ% работают.&nbsp; Тогда в чём ошибка? Будильник всё равно не работает.</p>]]></content>
			<author>
				<name><![CDATA[Selja8]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32415</uri>
			</author>
			<updated>2014-07-25T06:49:02Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=85218#p85218</id>
		</entry>
</feed>
