<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; Перезагрузка игры если найдена нужная строка.]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=11554&amp;type=atom" />
	<updated>2016-05-03T22:12:46Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=11554</id>
		<entry>
			<title type="html"><![CDATA[Re: Перезагрузка игры если найдена нужная строка.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=103323#p103323" />
			<content type="html"><![CDATA[<p>Вы запускаете игру, нажимаете Alt+1 и при появлении в файле указанной фразы игра перезапускается. И далее по кругу: перезапуск-ожидание фразы-перезапуск. Так? Если так, то ваш код (с форума) у меня работает нормально.<br />За исключением вот этого элемента:<br /></p><div class="codebox"><pre><code>Run, samp %ServerIP%</code></pre></div><p>вместо положенного<br /></p><div class="codebox"><pre><code>Run, samp://%ServerIP%</code></pre></div><p>И да, создавать пустой файл через FileAppend вовсе необязательно. Клиент игры это сделает за вас.</p>]]></content>
			<author>
				<name><![CDATA[Turambar]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33097</uri>
			</author>
			<updated>2016-05-03T22:12:46Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=103323#p103323</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Перезагрузка игры если найдена нужная строка.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=103319#p103319" />
			<content type="html"><![CDATA[<p>Вообщем пытался сделать скрипт, который перезаходит в игру если в чатлоге появляется строка с текстом &quot;Время на авторизацию ограничено&quot;. Все работает прекрасно, но скрипт перезагружает игру всего лишь 1 раз, а нужно проверять чатлог постоянно, т.е перезагрузка должна происходить всегда, когда в чатлоге есть эта фраза. Пытался всячески модифицировать код, но безуспешно.</p><div class="codebox"><pre><code>relog := &quot;Время на авторизацию ограничено&quot;
FileDelete, %a_mydocuments%\gta san andreas user files\samp\chatlog.txt
fileappend,, %a_mydocuments%\gta san andreas user files\samp\chatlog.txt
 
Gui, Add, Edit, x76 y47 w130 h20 vServerIP , IP
Gui, Add, Button, x86 y77 w110 h20 gRun , Подключиться
Gui, Add, Button, x86 y107 w110 h20 gSave , Сохранить
Gui, Add, Edit, x76 y17 w130 h20 vServerName , Название сервера
Gui, Show, x202 y106 h137 w301, BlockAdmin
 
IniRead, GuiServerIP, save.ini, Main, ServerIP
if (GuiServerIP != &quot;&quot;) and (GuiServerIP != &quot;ERROR&quot;)
GuiControl, 1:, ServerIP, % GuiServerIP
 
iniRead, GuiServerName, save.ini, Main, ServerName
if (GuiServerName != &quot;&quot;) and (GuiServerName != &quot;ERROR&quot;)
GuiControl, 1:, ServerName, % GuiServerName
return
 
 
Save:
Gui, Submit, NoHide
IniWrite, %ServerName%, save.ini, Main, ServerName
IniWrite, %ServerIP%, save.ini, Main, ServerIP
MsgBox, 262208, Опаньки.., Настройки сохранены в файл save.ini
Reload
return
 
Run:
GuiControlGet, ServerIP
Run, samp %ServerIP%
WinWaitActive, SA-MP URL
Send, {left}{enter}
return
 
!1::
Loop
{
    fileread, sms, %a_mydocuments%\gta san andreas user files\samp\chatlog.txt
    if sms contains %relog%
    {
        Process, Close, gta_sa.exe
        sleep, 2000
        GuiControlGet, ServerIP
        Run, samp %ServerIP%
        WinWaitActive, SA-MP URL
        Send, {left}{enter}
        FileDelete, %a_mydocuments%\gta san andreas user files\samp\chatlog.txt
        fileappend,, %a_mydocuments%\gta san andreas user files\samp\chatlog.txt
    }
   
    sleep, 300
}


</code></pre></div>]]></content>
			<author>
				<name><![CDATA[GrayFox1]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33347</uri>
			</author>
			<updated>2016-05-03T19:24:17Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=103319#p103319</id>
		</entry>
</feed>
