<?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=15226</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=15226&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Беспрерывное чтение файла».]]></description>
		<lastBuildDate>Sun, 08 Mar 2020 18:55:25 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Беспрерывное чтение файла]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=138389#p138389</link>
			<description><![CDATA[<div class="codebox"><pre><code>File := FileOpen(&quot;input.txt&quot;, &quot;r&quot;)
Loop {
	while (File.AtEOF)
		Sleep 1
	strings := File.Read()
	/*
		Что-то делаем со %strings%.

		Следует учитывать, что последняя строка могла быть прочитана
		не полностью и её следует запомнить и добавить в начало
		следующей считанной части.
	*/
}
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (wisgest)]]></author>
			<pubDate>Sun, 08 Mar 2020 18:55:25 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=138389#p138389</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Беспрерывное чтение файла]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=138388#p138388</link>
			<description><![CDATA[<p>Таймеры: <a href="http://www.script-coding.com/AutoHotkey/SetTimer.html">http://www.script-coding.com/AutoHotkey/SetTimer.html</a></p>]]></description>
			<author><![CDATA[null@example.com (Foma)]]></author>
			<pubDate>Sun, 08 Mar 2020 18:17:24 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=138388#p138388</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Беспрерывное чтение файла]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=138387#p138387</link>
			<description><![CDATA[<p><strong>stealzy</strong><br />Ситуация описанная с использованием таймера.</p>]]></description>
			<author><![CDATA[null@example.com (Anton.Badonov)]]></author>
			<pubDate>Sun, 08 Mar 2020 18:05:17 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=138387#p138387</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Беспрерывное чтение файла]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=138386#p138386</link>
			<description><![CDATA[<p>Навскидку — у вас два бесконечных цикла. Нить выполнения только одна, и, соответственно, цикл будет крутиться только последний запущенный, а предпоследний замрет в ожидании выхода из последнего.</p><p>Решение попроще - уместить все в один цикл, посложнее — переделать на таймеры.<br /><span style="color: grey">И прекратите пытать знаки пунктуации.</span></p>]]></description>
			<author><![CDATA[null@example.com (stealzy)]]></author>
			<pubDate>Sun, 08 Mar 2020 17:25:11 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=138386#p138386</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Беспрерывное чтение файла]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=138382#p138382</link>
			<description><![CDATA[<p>Добрый день .<br />Пользуюсь кодом . <br />Он должен считывать файл в&nbsp; цикле и каждый раз новые строки . <br />Но считывание происходит только единожды при запуске . <br />Вот &quot; читающая часть&quot;<br /></p><div class="codebox"><pre><code>
loop, read, combat.log
{
	if (lastLine.combat &gt;= A_Index)
		Continue

	lastLine.combat := A_Index
	str := RegExReplace(A_LoopReadLine, &quot;\s+&quot;, A_Space)
	str := RegExReplace(str, &quot;^\d+:\d+:[\.\d+]+\|\s+&quot;)

	if (str ~= &quot;Active battle started\.&quot;)	
	{
		Active := A_TickCount
	}
	else if (str ~=  &quot;attacker:\s+&quot; nickName1)
		{
			Active2 := A_TickCount
		}
	else if (str ~=  &quot;killer:\s+&quot; nickName1)
		{
            Active3 := A_TickCount
		}
    else if (str ~=  &quot;Victim:\s+&quot; nickName1)
		{
			Active4 := A_TickCount
		}
	else if (str ~=  &quot;Kill\. Victim:\s+&quot; nickName1)
		{
			Active5 := A_TickCount
		}
} 
</code></pre></div><p>А вот часть которая выводит переменные . <br /></p><div class="codebox"><pre><code>
loop
{
		if (A_TickCount - Active &lt;= 500)
		{
           pic = 5
		}
		else if (A_tickCount - Active2 &lt;= 500)
		{
			pic = 2				
		}
		else if (A_tickCount - Active3 &lt;= 500)
		{
			pic = 3		
		}
		else if (A_tickCount - Active4 &lt;= 500)
		{	 
		   pic = 2  
		}
		else if (A_tickCount - Active5 &lt;= 500)
		{
			pic = 4
		}
}
</code></pre></div><p>Ник берется выше читающей части и помещается в переменную nickName1</p><p>Вот пример того , как выглядит файл который читается . <br />08:54:49.990| Active battle started.<br />09:00:18.024| Damage. Victim: Sophia&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; , attacker: MS_ONE&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;, weapon &#039;CarPart_Gun_BigCannon_EX_Relic&#039;, damage: 929.58 DMG_BLAST|CAR_PART|IGNORE_DAMAGE_SCALE<br />09:00:30.137| Damage. Victim: MS_ONE&nbsp; &nbsp; &nbsp; &nbsp; , attacker: Christopher&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;, weapon &#039;CarPart_Gun_Shotgun_epic&#039;, damage: 5.90 DMG_DIRECT|CAR_PART|HIGH_FIRE_RATE<br />09:22:45.333| Kill. Victim: TestDriveCar2&nbsp; &nbsp; &nbsp; &nbsp; killer: MS_ONE<br />09:29:13.630| Kill. Victim: MS_ONE&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; killer: n/a&nbsp; &nbsp;</p><br /><p>Вывод сообщений на экран через GDIP . ( эта часть кода работает , проверялась с другими чтениями )<br />Подскажите в чем проблема .</p>]]></description>
			<author><![CDATA[null@example.com (Anton.Badonov)]]></author>
			<pubDate>Sun, 08 Mar 2020 07:08:30 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=138382#p138382</guid>
		</item>
	</channel>
</rss>
