<?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=12317&amp;type=atom" />
	<updated>2017-01-15T16:31:16Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=12317</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Копирование текста после определенной точки]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=111091#p111091" />
			<content type="html"><![CDATA[<p>Готово. Вот код, просто уберите из моего кода в конце return и допишите его ниже.</p><div class="codebox"><pre><code>
FileRead, text, %path_write%
	
Gui, Add, Edit, x12 y10 w450 h490 ReadOnly , %text%
Gui, Add, Button, x12 y510 w190 h60 gClose, Закрыть
Gui, Add, Button, x212 y510 w250 h60 gRefresh, Обновить
Gui, Show, x823 y115 h591 w479, Log
Return

GuiClose:
ExitApp
			
Close:
ExitApp
return

Refresh:
Reload
return
</code></pre></div><p>При нажатии кнопки &quot;Обновить&quot; скрипт производит перезапуск, заново читая логи и выводя строчки в Gui. Протестировал на 8000 строчек (дальше лень было) - работает. Есть один минус: текст при появлении Gui выделяется почему-то.</p><p>Разные надписи, размеры окон и прочее, уже добавите по своему вкусу.</p>]]></content>
			<author>
				<name><![CDATA[belyankin12]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=34408</uri>
			</author>
			<updated>2017-01-15T16:31:16Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=111091#p111091</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Копирование текста после определенной точки]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=111085#p111085" />
			<content type="html"><![CDATA[<p><strong>belyankin12</strong>, мне и нужен упор на информативность! Спасибо.</p>]]></content>
			<author>
				<name><![CDATA[lagetit]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=34471</uri>
			</author>
			<updated>2017-01-15T13:57:50Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=111085#p111085</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Копирование текста после определенной точки]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=111084#p111084" />
			<content type="html"><![CDATA[<p>Я подумаю над этим, у меня есть пару набросок, но займусь ими я позже. Учтите: упор будет только на информативность, а не на красоту. Кроме того обновление GUI будет идти по нажатию кнопки, а не автоматически. Если вас такое не устроит, то попросите помощи у других пользователей.</p>]]></content>
			<author>
				<name><![CDATA[belyankin12]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=34408</uri>
			</author>
			<updated>2017-01-15T13:56:08Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=111084#p111084</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Копирование текста после определенной точки]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=111081#p111081" />
			<content type="html"><![CDATA[<p><strong>belyankin12</strong>, Все отлично работает! Очень благодарен вам, огромное человеческое спасибо!<br />Возможно вы знаете как исходя из этого сделать GUI в который будет вставлен текст из лог файла, который мы получили? Но необходимо учесть что GUI должно будет постоянно обновляться т.к. будет постоянная подгрузка из лог файла.</p>]]></content>
			<author>
				<name><![CDATA[lagetit]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=34471</uri>
			</author>
			<updated>2017-01-15T13:22:20Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=111081#p111081</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Копирование текста после определенной точки]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=111080#p111080" />
			<content type="html"><![CDATA[<p><strong>lagetit</strong>, это дело нескольких секунд. Учитывая все вышеперечисленные требования, вот вам новый код:</p><div class="codebox"><pre><code>
path_read := A_ScriptDir &quot;\Отсюда прочитаем.txt&quot;
path_write := A_ScriptDir &quot;\А сюда мы все запишем.txt&quot;

	Loop
	{

	Loop, read, %path_read%
		 
		 if RegExMatch(A_LoopReadLine
        ,&quot;(.*)you(.*)player (.*)(shotgunslug|riflebullet|shotgunbullet|pistolbullet)(.*)&quot;
        , end_str)
		; 28.5s you      player shotgun_pump.entity    shotgunbullet stomach 30.6m    5.8    0.0         
        ; 15.2s you      player pistol_semiauto.entity pistolbullet  leg     16.1m    100.0  81.0      
      ; 649.9s  you      player_corpse            ak47u.entity           riflebullet   generic 6.5m     100.0  100.0    		
		if (end_str1 != &quot;&quot;) {
		 FileAppend, %end_str5%`n, %path_write%
		} else {
		msgbox, error
		}
		break
	}
	
	return
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[belyankin12]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=34408</uri>
			</author>
			<updated>2017-01-15T13:18:17Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=111080#p111080</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Копирование текста после определенной точки]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=111079#p111079" />
			<content type="html"><![CDATA[<p><strong>belyankin12</strong>, выше уже писал про значение &quot;shotgunslug&quot;. Можно добавлять, а можно и не добавлять, не так важно. Это уже на ваше усмотрение, если это слишком долго и мучительно делать, то думаю не стоит с этим заморачиваться.</p>]]></content>
			<author>
				<name><![CDATA[lagetit]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=34471</uri>
			</author>
			<updated>2017-01-15T13:03:04Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=111079#p111079</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Копирование текста после определенной точки]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=111078#p111078" />
			<content type="html"><![CDATA[<p><strong>lagetit</strong>, в столбце Ammo встречается и значение: &quot;shotgunslug&quot;. Или же вам нужны только те четыре параметра? Насчёт player_corpse нашел ошибку, исправил.</p>]]></content>
			<author>
				<name><![CDATA[belyankin12]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=34408</uri>
			</author>
			<updated>2017-01-15T12:56:21Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=111078#p111078</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Копирование текста после определенной точки]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=111077#p111077" />
			<content type="html"><![CDATA[<p><strong>belyankin12</strong>, по сути значений столбца ammo всего 4, shotgunbullet;riflebullet;pistolbullet;shotgunslug. Нам необходимо построить таблицу также как она идет, тобишь с 1 строки и до конца т.к. значения &quot;old_hp&quot; и &quot;new_hp&quot; постоянно меняются, а нам из всего этого как раз их и нужно знать, это собственно то, ради чего все это делается.<br />player_corpse вывело из этого лога:<br /></p><div class="codebox"><pre><code>time    attacker target                   weapon                 ammo          area    distance old_hp new_hp info 
2975.9s player   you                      ak47u.entity           riflebullet   arm     8.6m     86.0   58.5        
2975.6s player   you                      ak47u.entity           riflebullet   leg     8.3m     58.5   34.1        
2972.7s you      player                   shotgun_pump.entity    shotgunslug   hand    2.5m     36.6   0.0         
2970.1s you      player                   shotgun_pump.entity    shotgunslug   chest   2.8m     4.0    0.0         
2905.2s you      player                   ak47u.entity           riflebullet   chest   38.6m    100.0  73.8        
2901.7s you      player                   ak47u.entity           riflebullet   leg     38.6m    72.7   49.4        
2900.1s player   you                      bolt_rifle.entity      riflebullet   head    47.3m    76.4   0.0         
2857.7s you      landmine                 ak47u.entity           riflebullet   generic 4.4m     100.0  50.0        
2857.5s you      landmine                 ak47u.entity           riflebullet   generic 6.2m     100.0  50.0        
2856.3s you      landmine                 ak47u.entity           riflebullet   generic 8.2m     50.0   0.0         
651.9s  you      wall.external.high.stone ak47u.entity           riflebullet   generic 37.0m    278.2  278.0       
651.0s  you      player                   ak47u.entity           riflebullet   chest   9.3m     33.1   5.6         
649.9s  you      player_corpse            ak47u.entity           riflebullet   generic 6.5m     100.0  100.0       
648.8s  you      player                   ak47u.entity           riflebullet   stomach 6.5m     4.9    0.0         
645.3s  you      player                   pistol_semiauto.entity pistolbullet  foot    4.2m     5.0    0.0         
600.4s  player   you                      ak47u.entity           riflebullet   stomach 100.8m   100.0  78.0        
566.0s  you      mining_quarry            shotgun_pump.entity    shotgunbullet generic 2.6m     2498.6 2498.5      
566.0s  you      mining_quarry            shotgun_pump.entity    shotgunbullet generic 2.5m     2498.5 2498.3      
566.0s  you      mining_quarry            shotgun_pump.entity    shotgunbullet generic 2.6m     2498.3 2498.2      
566.0s  you      mining_quarry            shotgun_pump.entity    shotgunbullet generic 2.9m     2498.2 2498.0      
566.0s  you      mining_quarry            shotgun_pump.entity    shotgunbullet generic 2.4m     2498.0 2497.9      
566.0s  you      mining_quarry            shotgun_pump.entity    shotgunbullet generic 2.6m     2497.9 2497.7      
566.0s  you      mining_quarry            shotgun_pump.entity    shotgunbullet generic 2.6m     2497.7 2497.6      
566.0s  you      mining_quarry            shotgun_pump.entity    shotgunbullet generic 2.5m     2497.6 2497.4      
565.9s  you      mining_quarry            shotgun_pump.entity    shotgunbullet generic 2.5m     2497.4 2497.3      
565.9s  you      mining_quarry            shotgun_pump.entity    shotgunbullet generic 2.5m     2497.3 2497.1      
565.9s  you      mining_quarry            shotgun_pump.entity    shotgunbullet generic 3.5m     2497.1 2497.0      
565.9s  you      mining_quarry            shotgun_pump.entity    shotgunbullet generic 3.3m     2497.0 2496.8      
565.9s  you      mining_quarry            shotgun_pump.entity    shotgunbullet generic 3.6m     2496.8 2496.7      
565.9s  you      mining_quarry            shotgun_pump.entity    shotgunbullet generic 3.4m     2496.7 2496.5    </code></pre></div><p>Вот то что получилось:<br /></p><div class="codebox"><pre><code>  foot    4.2m     5.0    0.0         
   stomach 6.5m     4.9    0.0         
   generic 6.5m     100.0  100.0       
   chest   9.3m     33.1   5.6         
   leg     38.6m    72.7   49.4        
   chest   38.6m    100.0  73.8</code></pre></div><p>Это является значением player_corpse:<br /></p><div class="codebox"><pre><code>   generic 6.5m     100.0  100.0</code></pre></div>]]></content>
			<author>
				<name><![CDATA[lagetit]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=34471</uri>
			</author>
			<updated>2017-01-15T12:46:52Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=111077#p111077</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Копирование текста после определенной точки]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=111076#p111076" />
			<content type="html"><![CDATA[<p><strong>lagetit</strong>, есть два варианта: либо все значения столбца Ammo, либо все значения столбца Area, мне кажется вариантов второго меньше. У меня недостаточно опыта в этом выражении, чтобы указать, что в этом месте должны быть буквы (я пытался, но у меня возвращало вместо слова &quot;Chest&quot; &quot;C t&quot; только). Так ведь player_corpse не выводит.</p>]]></content>
			<author>
				<name><![CDATA[belyankin12]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=34408</uri>
			</author>
			<updated>2017-01-15T12:43:50Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=111076#p111076</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Копирование текста после определенной точки]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=111075#p111075" />
			<content type="html"><![CDATA[<p><strong>belyankin12</strong>, есть возможность не выводить в path_write лог значение &quot;player_corpse&quot; из столбца target?<br />Список столбца &quot;Area&quot;:<br /></p><div class="codebox"><pre><code>head
stomach
pelvis
hand
chest
arm
leg
foot
neck
chest</code></pre></div>]]></content>
			<author>
				<name><![CDATA[lagetit]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=34471</uri>
			</author>
			<updated>2017-01-15T12:32:05Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=111075#p111075</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Копирование текста после определенной точки]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=111074#p111074" />
			<content type="html"><![CDATA[<p><strong>lagetit</strong>, видимо я невнимательно читал. Что-ж, давайте немножко по-другому. Мне нужны всевозможные значения столбца &quot;Area&quot;. Если я правильно понимаю, откуда этот лог, их должно быть не больше десяти. Заодно я смогу и решить проблему пробелов.</p>]]></content>
			<author>
				<name><![CDATA[belyankin12]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=34408</uri>
			</author>
			<updated>2017-01-15T12:25:13Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=111074#p111074</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Копирование текста после определенной точки]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=111073#p111073" />
			<content type="html"><![CDATA[<p><span style="color: green"><strong>lagetit</strong><br />Игнорирование замечаний модератора и правил чреваты нехорошим исходом.<br />В инструментарии постов есть кнопки &quot;Вставить ник&quot; и &quot;Ответить&quot;. Пользуйтесь.</span></p>]]></content>
			<author>
				<name><![CDATA[Flasher]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27593</uri>
			</author>
			<updated>2017-01-15T12:04:09Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=111073#p111073</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Копирование текста после определенной точки]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=111072#p111072" />
			<content type="html"><![CDATA[<p><strong>belyankin12</strong>, Вот есть еще один пример лога:<br /></p><div class="codebox"><pre><code>time    attacker target                   weapon                 ammo          area    distance old_hp new_hp info 
2975.9s player   you                      ak47u.entity           riflebullet   arm     8.6m     86.0   58.5        
2975.6s player   you                      ak47u.entity           riflebullet   leg     8.3m     58.5   34.1        
2972.7s you      player                   shotgun_pump.entity    shotgunslug   hand    2.5m     36.6   0.0         
2970.1s you      player                   shotgun_pump.entity    shotgunslug   chest   2.8m     4.0    0.0         
2905.2s you      player                   ak47u.entity           riflebullet   chest   38.6m    100.0  73.8        
2901.7s you      player                   ak47u.entity           riflebullet   leg     38.6m    72.7   49.4        
2900.1s player   you                      bolt_rifle.entity      riflebullet   head    47.3m    76.4   0.0         
2857.7s you      landmine                 ak47u.entity           riflebullet   generic 4.4m     100.0  50.0        
2857.5s you      landmine                 ak47u.entity           riflebullet   generic 6.2m     100.0  50.0        
2856.3s you      landmine                 ak47u.entity           riflebullet   generic 8.2m     50.0   0.0         
651.9s  you      wall.external.high.stone ak47u.entity           riflebullet   generic 37.0m    278.2  278.0       
651.0s  you      player                   ak47u.entity           riflebullet   chest   9.3m     33.1   5.6         
649.9s  you      player_corpse            ak47u.entity           riflebullet   generic 6.5m     100.0  100.0       
648.8s  you      player                   ak47u.entity           riflebullet   stomach 6.5m     4.9    0.0         
645.3s  you      player                   pistol_semiauto.entity pistolbullet  foot    4.2m     5.0    0.0         
600.4s  player   you                      ak47u.entity           riflebullet   stomach 100.8m   100.0  78.0        
566.0s  you      mining_quarry            shotgun_pump.entity    shotgunbullet generic 2.6m     2498.6 2498.5      
566.0s  you      mining_quarry            shotgun_pump.entity    shotgunbullet generic 2.5m     2498.5 2498.3      
566.0s  you      mining_quarry            shotgun_pump.entity    shotgunbullet generic 2.6m     2498.3 2498.2      
566.0s  you      mining_quarry            shotgun_pump.entity    shotgunbullet generic 2.9m     2498.2 2498.0      
566.0s  you      mining_quarry            shotgun_pump.entity    shotgunbullet generic 2.4m     2498.0 2497.9      
566.0s  you      mining_quarry            shotgun_pump.entity    shotgunbullet generic 2.6m     2497.9 2497.7      
566.0s  you      mining_quarry            shotgun_pump.entity    shotgunbullet generic 2.6m     2497.7 2497.6      
566.0s  you      mining_quarry            shotgun_pump.entity    shotgunbullet generic 2.5m     2497.6 2497.4      
565.9s  you      mining_quarry            shotgun_pump.entity    shotgunbullet generic 2.5m     2497.4 2497.3      
565.9s  you      mining_quarry            shotgun_pump.entity    shotgunbullet generic 2.5m     2497.3 2497.1      
565.9s  you      mining_quarry            shotgun_pump.entity    shotgunbullet generic 3.5m     2497.1 2497.0      
565.9s  you      mining_quarry            shotgun_pump.entity    shotgunbullet generic 3.3m     2497.0 2496.8      
565.9s  you      mining_quarry            shotgun_pump.entity    shotgunbullet generic 3.6m     2496.8 2496.7      
565.9s  you      mining_quarry            shotgun_pump.entity    shotgunbullet generic 3.4m     2496.7 2496.5      

</code></pre></div>]]></content>
			<author>
				<name><![CDATA[lagetit]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=34471</uri>
			</author>
			<updated>2017-01-15T11:58:37Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=111072#p111072</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Копирование текста после определенной точки]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=111071#p111071" />
			<content type="html"><![CDATA[<p>Спасибо. Работает, но он выводит строки снизу вверх, а нужно сверху вниз, можно изменить?</p>]]></content>
			<author>
				<name><![CDATA[lagetit]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=34471</uri>
			</author>
			<updated>2017-01-15T11:55:16Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=111071#p111071</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Копирование текста после определенной точки]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=111070#p111070" />
			<content type="html"><![CDATA[<p>Готово. Из всех строчек, где записано как атаковали вы, после слов &quot;riflebullet&quot;,&quot;shotgunbullet&quot;,&quot;pistolbullet&quot; весь текст копируется в файл, записывая в новой строчке каждый скопированный текст.</p><div class="codebox"><pre><code>
path_read := A_ScriptDir &quot;\Отсюда прочитаем.txt&quot;
path_write := A_ScriptDir &quot;\А сюда мы все запишем.txt&quot;

	Loop
	{
	log := {str:&quot;&quot;,find:0,num:0}    ,    log.str := []

	Loop, read, %path_read%
    log.str.Insert(A_LoopReadLine)    ,log.num := A_Index
		 
		 if RegExMatch(     log.str[log.num + 1 - A_Index]
        ,&quot;(.*)you(.*)player(.*)(riflebullet|shotgunbullet|pistolbullet)(.*)&quot;
        , end_str) and (log.find:=log.num + 1 - A_Index)
		; 28.5s you      player shotgun_pump.entity    shotgunbullet stomach 30.6m    5.8    0.0         
        ; 15.2s you      player pistol_semiauto.entity pistolbullet  leg     16.1m    100.0  81.0        
		if (end_str1 != &quot;&quot;) {
		FileAppend, %end_str5%`n, %path_write%
		} else {
		msgbox, error
		}
	}
	return
</code></pre></div><p>Поменяйте пути к файлам, они в самом верху. Я не смог решить лишь проблему пробелов: весь текст, после тех слов (включая пробелы) будет копироваться, и строчки могут быть не ровно друг под другом, немножко некрасиво будет. Но зато работает.</p>]]></content>
			<author>
				<name><![CDATA[belyankin12]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=34408</uri>
			</author>
			<updated>2017-01-15T11:30:05Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=111070#p111070</id>
		</entry>
</feed>
