<?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="https://forum.script-coding.com/extern.php?action=feed&amp;tid=14833&amp;type=atom" />
	<updated>2019-06-21T21:47:02Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=14833</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Замена двух из трёх значений по нажатию горячей клавиши и вывод]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134742#p134742" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br />Спасибо огромное! То, что нужно</p>]]></content>
			<author>
				<name><![CDATA[umototomori]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40221</uri>
			</author>
			<updated>2019-06-21T21:47:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134742#p134742</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Замена двух из трёх значений по нажатию горячей клавиши и вывод]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134739#p134739" />
			<content type="html"><![CDATA[<p><strong>umototomori</strong>, даже не знаю, как по-простому реализовать, лучше всего действительно использовать IniRead/Write (есть <a href="http://script-coding.com/AutoHotkeyTranslation.html">перевод</a>, если нужно).<br /></p><div class="codebox"><pre><code>filePath = F:\12.txt

NumpadAdd::
NumpadSub::
   if !FileExist(filePath)
      throw Exception(&quot;Файл &quot;&quot;&quot; . filePath . &quot;&quot;&quot; не найден!&quot;)
   
   FileRead, str, % filePath
   if !RegExMatch(str, &quot;(ОГ:\s(\d+))\R(П:\s(\d+))\R(Л:\s(\d+))&quot;, match)
      throw Exception(&quot;Формат записи в файл не соответствует шаблону!&quot;)
   
   str := RegExReplace(str, match1, &quot;ОГ: &quot; . ++match2)
   if InStr(A_ThisHotkey, &quot;Add&quot;)
      str := RegExReplace(str, match3, &quot;П: &quot; . ++match4)
   else
      str := RegExReplace(str, match5, &quot;Л: &quot; . ++match6)
   ; MsgBox, % str
   FileDelete, % filePath
   FileAppend, % str, % filePath
   Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-06-21T16:54:00Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134739#p134739</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Замена двух из трёх значений по нажатию горячей клавиши и вывод]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134732#p134732" />
			<content type="html"><![CDATA[<p>Лучше используйте ини файлы. Iniread и iniwrite вам в помощь.</p>]]></content>
			<author>
				<name><![CDATA[belyankin12]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34408</uri>
			</author>
			<updated>2019-06-21T12:07:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134732#p134732</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Замена двух из трёх значений по нажатию горячей клавиши и вывод]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134729#p134729" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong> Вот. Вместо того, что бы добавлять к каждой, он суммирует всё в одно число<br /></p><div class="codebox"><pre><code>filePath = F:\12.txt
FileReadLine, Var1, %filePath%, 1
FileReadLine, Var2, %filePath%, 2
FileReadLine, Var3, %filePath%, 3

Var1 = 10
Var2 = 7
Var3 = 3

  NumpadAdd::

		IfNotExist, %filePath%
			FileAppend,0, %filePath%	
		FileReadLine, Var1, %filePath%, 1
		Var := ++Var1
		FileDelete, %filePath%
		FileAppend,%Var1%, %filePath%
		FileReadLine, Var2, %filePath%, 2
		Var := ++Var2
		FileDelete, %filePath%
		FileAppend,%Var2%, %filePath%
	return
   


NumpadSub::
		IfNotExist, %filePath%
			FileAppend,0, %filePath%	
		FileReadLine, Var1, %filePath%, 1
		Var := ++Var1
		FileDelete, %filePath%
		FileAppend,%Var1%, %filePath%
		FileReadLine, Var3, %filePath%, 3
		Var := ++Var3
		FileDelete, %filePath%
		FileAppend,%Var3%, %filePath%
	return
	





</code></pre></div>]]></content>
			<author>
				<name><![CDATA[umototomori]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40221</uri>
			</author>
			<updated>2019-06-21T09:04:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134729#p134729</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Замена двух из трёх значений по нажатию горячей клавиши и вывод]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134716#p134716" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>umototomori пишет:</cite><blockquote><p>всю башку сломал уже</p></blockquote></div><p>Покажите результаты своих усилий.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-06-20T19:54:21Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134716#p134716</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Замена двух из трёх значений по нажатию горячей клавиши и вывод]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134714#p134714" />
			<content type="html"><![CDATA[<p>Помогите, пожалуйста, ламеру, всю башку сломал уже.<br />Имеется условный .txt файл с тремя значениями<br />ОГ: 10<br />П: 7<br />Л: 3<br />Нужно, что бы по нажатии клавиши Numpad + значения ОГ и П получали +1, а по нажатию клавишы Numpad - Значения ОГ и Л получали +1. И вывод в текстовый файл.<br />Заранее спасибо!</p>]]></content>
			<author>
				<name><![CDATA[umototomori]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40221</uri>
			</author>
			<updated>2019-06-20T18:47:08Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134714#p134714</id>
		</entry>
</feed>
