<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Timer (накрутка времени)]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=15468</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=15468&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Timer (накрутка времени)».]]></description>
		<lastBuildDate>Sat, 25 Jul 2020 23:43:05 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Timer (накрутка времени)]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=141053#p141053</link>
			<description><![CDATA[<div class="quotebox"><cite>__Михаил__ пишет:</cite><blockquote><p>Набросал</p></blockquote></div><p><strong>__Михаил__</strong><br />Вы как моя учительница математики. У неё тоже вроде бы всё просто, а у учеников голова пухнет с её примеров.</p>]]></description>
			<author><![CDATA[null@example.com (fgslm)]]></author>
			<pubDate>Sat, 25 Jul 2020 23:43:05 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=141053#p141053</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Timer (накрутка времени)]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=140217#p140217</link>
			<description><![CDATA[<p><strong>afibur</strong></p><p>Цикл, как по мне последнее, что нужно использовать.</p><p>Набросал свой вариант, вроде работает идеально:</p><div class="codebox"><pre><code>TimeOut :=	10000	; По умолчанию 10 секунд
TimeOutStep :=	5000	; Шаг изменения
TimeOutMax :=	100000	; Максимальное время таймера
TimeOutMin :=	5000	; Минимальное время таймера
ToolTipSleep :=	2000	; Время на отображение ToolTip подсказки
Return


^#WheelDown::
^#WheelUp::
SetTimer, Alarm, Off				; Выключить текущий таймер
Mode := InStr(A_ThisHotkey, &quot;WheelUp&quot;) ? 1 : 0		; Определить нажатую кнопку
If Mode		; Если колесо вверх:
{
 If (TimeOut &lt; TimeOutMax)	; Проверить предел
  TimeOut += TimeOutStep		; Прибавить время
 Else							; Если вышло за предел
  TimeOut := TimeOutMax		; Установить максимум
}
Else		; Если колесо вниз:
{
 If !(TimeOut &lt; TimeOutMin+TimeOutStep)		; Проверить предел
  TimeOut -= TimeOutStep					; Убавить время
}

T := Round(TimeOut/1000,0)
ToolTip, Таймер: %T% сек.
SetTimer, Alarm, %TimeOut%
SetTimer, RemoveToolTip, %ToolTipSleep%
Return


Alarm:
SetTimer, Alarm, Off
T := Round(TimeOut/1000,0)
MsgBox,8256, Время истекло: %T% сек, Таймер сработал!
Return

RemoveToolTip:
SetTimer, RemoveToolTip, Off
ToolTip
Return</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (__Михаил__)]]></author>
			<pubDate>Sun, 21 Jun 2020 12:09:09 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=140217#p140217</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Timer (накрутка времени)]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=140215#p140215</link>
			<description><![CDATA[<p>Всем привет!<br />Набросал таймер который при прокрутке колеса мышки накручивает время. При отпускании LControl и LWin запускает.<br />Есть ощущение что использовать таким образом цикл неправильно...<br />Есть ли более эффективные решения?<br />Заранее благодарен!<br /></p><div class="codebox"><pre><code>^#WheelDown::
^#WheelUp::
30sec := 30000
While GetKeyState(&quot;LControl&quot;,&quot;p&quot;) and GetKeyState(&quot;LWin&quot;,&quot;p&quot;){
	if (A_PriorKey = &quot;WheelDown&quot;){
		if (ms &gt;= 30000){
			
			ms += -%30sec%
		} else {
			ms = 0
		}
		Sleep,300
		;tooltip current ms %ms%
	} else if (A_PriorKey = &quot;WheelUp&quot;){
		ms += %30sec%
		Sleep,300
		;tooltip current ms %ms%
	}
	msInMin := ms/1000/60
	
	tooltip Timer will be set to %msInMin%
}

SetTimer, Alarm, %ms%

SetTimer, RemoveToolTip, 2000

return</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (afibur)]]></author>
			<pubDate>Sun, 21 Jun 2020 08:57:35 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=140215#p140215</guid>
		</item>
	</channel>
</rss>
