<?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=13843&amp;type=atom" />
	<updated>2018-06-12T09:44:05Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=13843</id>
		<entry>
			<title type="html"><![CDATA[AHK: Прошу помочь]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=125952#p125952" />
			<content type="html"><![CDATA[<p>Приветствую, вот вам код который при нажатии на альт+1 берет последнюю строку из файла саспект и вписывает в чат /answ id, хотелось бы получить объяснения на каждый шаг, что это за строка и что она делает. Просто не могу найти ничего в интернете, а научиться писать скрипты хотелось бы.<br /></p><div class="codebox"><pre><code>#IfWinActive GTA:SA:MP
SLES := 0
suspectid := 0
suspectname := &quot;Test&quot;
suspectid1 := 0
suspectname1 := &quot;Test&quot;
path := &quot;\GTA San Andreas User Files\SAMP\&quot;

!1::
{
FileDelete, %A_MyDocuments%%path%suspect.txt
sleep 50

Loop
{
Loop, read, %A_MyDocuments%%path%chatlog.txt, %A_MyDocuments%%path%suspect.txt
{
IfInString, A_LoopReadLine, ] Вопрос от , FileAppend, %A_LoopReadLine%`n
}

Loop, read, %A_MyDocuments%%path%suspect.txt
{
RegExMatch(A_LoopReadLine, &quot;] Вопрос от (.*) ID &quot;, suspectname)
RegExMatch(A_LoopReadLine, &quot; ID (.*): &quot;, suspectid)
}
NewStr := RegExReplace(suspectid, &quot; ID (.*):&quot;, &quot;$1&quot;)
sendinput {f6}/answ %NewStr%
Break
if SLES &lt;&gt; 0
{
SLES := 0
Break
}
}
sleep 1000
}

return</code></pre></div><p>Не понимаю почти ничего из этого кода, если бы кто то объяснил каждую строку - был бы неописуемо рад. Спасибо.</p>]]></content>
			<author>
				<name><![CDATA[R.Carm]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=39314</uri>
			</author>
			<updated>2018-06-12T09:44:05Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=125952#p125952</id>
		</entry>
</feed>
