<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Задание для скрипта в .txt]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=9505&amp;type=atom" />
	<updated>2014-04-20T18:40:09Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=9505</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Задание для скрипта в .txt]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=82054#p82054" />
			<content type="html"><![CDATA[<p>Но я не пойму, вам же так надо было:<br /></p><div class="codebox"><pre><code>
FileRead, str, C:\Users\sergey\Desktop\new  2.txt 
arr := StrSplit(str, &quot;`n&quot;, &quot;`r&quot;), i := 0
Loop % arr.MaxIndex()/2  {     
    sendinput % arr[++i] 
    sleep % arr[++i] 
}   
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2014-04-20T18:40:09Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=82054#p82054</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Задание для скрипта в .txt]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=82052#p82052" />
			<content type="html"><![CDATA[<p>Тогда уж так:<br /></p><div class="codebox"><pre><code>
FileRead, str, play.txt 
arr := StrSplit(str, &quot;`n&quot;, &quot;`r&quot;), i := 0
Loop % arr.MaxIndex()/2  
     fileappend, % &quot;sleep &quot; arr[++i] &quot;`nsendinput &quot; arr[++i] &quot;`n&quot;, rec.txt
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2014-04-20T18:37:03Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=82052#p82052</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Задание для скрипта в .txt]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=82047#p82047" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><div class="codebox"><pre><code>
FileRead, str, C:\Users\sergey\Desktop\new  2.txt 
arr := StrSplit(str, &quot;`n&quot;, &quot;`r&quot;), i := 0
Loop % arr.MaxIndex()/2  {     
    MsgBox % &quot;sendinput &quot; arr[++i] 
    MsgBox % &quot;sleep &quot; arr[++i] 
} 
</code></pre></div></blockquote></div><p>Спасибо работает! чуть переделал под себя.<br /></p><div class="codebox"><pre><code>FileRead, str, play.txt 
arr := StrSplit(str, &quot;`n&quot;, &quot;`r&quot;), i := 0
Loop % arr.MaxIndex()/2  { 
fileappend, % &quot;sleep &quot; arr[++i], rec.txt
fileappend, `n, rec.txt 
fileappend, % &quot;sendinput &quot; arr[++i], rec.txt
fileappend, `n, rec.txt 
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[BashkaMen]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30800</uri>
			</author>
			<updated>2014-04-20T18:31:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=82047#p82047</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Задание для скрипта в .txt]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=82031#p82031" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>
FileRead, str, C:\Users\sergey\Desktop\new  2.txt 
arr := StrSplit(str, &quot;`n&quot;, &quot;`r&quot;), i := 0
Loop % arr.MaxIndex()/2  {     
    MsgBox % &quot;sendinput &quot; arr[++i] 
    MsgBox % &quot;sleep &quot; arr[++i] 
} 
</code></pre></div><p>На случай пустых строк и пробелов по краям.<br /></p><div class="codebox"><pre><code>
arr := [], i := 0
Loop, read, C:\Users\sergey\Desktop\new  2.txt 
    If A_LoopReadLine is not space
        arr.Insert(Trim(A_LoopReadLine))
Loop % arr.MaxIndex()/2  {     
    MsgBox % &quot;sendinput &quot; arr[++i] 
    MsgBox % &quot;sleep &quot; arr[++i] 
}
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2014-04-20T17:12:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=82031#p82031</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Задание для скрипта в .txt]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=82027#p82027" />
			<content type="html"><![CDATA[<p>Ну тогда можно сделать так:<br /></p><div class="codebox"><pre><code>Gui, Add, Edit, vEdit, Введите кол-во строк
Gui, add, button, gbutton, ok
Gui, Show
return

button:
Gui, Submit
Loop %Edit%
FileReadLine, text%A_Index%, play.txt, %A_Index%
return

!1::
loop % Edit/=2
{
num++
sendinput, % text%num%
num++
sleep % text%num%
}
return

GuiClose:
ExitApp</code></pre></div>]]></content>
			<author>
				<name><![CDATA[_Квас]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32130</uri>
			</author>
			<updated>2014-04-20T16:48:21Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=82027#p82027</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Задание для скрипта в .txt]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=82002#p82002" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>_Квас пишет:</cite><blockquote><p>Первое, что пришло в голову:<br /></p><div class="codebox"><pre><code>Loop 12
FileReadLine, test%A_Index%, Play.txt, %A_Index%
return

!1::
sendinput, {%test1%}
sleep %test2%
sendinput, {%test3%}
sleep %test4%
sendinput, {%test5%}
sleep %test6%
sendinput, {%test7%}
sleep %test8%
sendinput, {%test9%}
sleep %test10%
sendinput, {%test11%}
sleep %test12%</code></pre></div><p>Можно конечно код более оптимальнее придумать, но мне пока думать лень.</p></blockquote></div><p>такой же код и у меня, но а вдруг там будет 1000 строк.</p>]]></content>
			<author>
				<name><![CDATA[BashkaMen]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30800</uri>
			</author>
			<updated>2014-04-20T11:10:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=82002#p82002</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Задание для скрипта в .txt]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=81979#p81979" />
			<content type="html"><![CDATA[<p>Первое, что пришло в голову:<br /></p><div class="codebox"><pre><code>Loop 12
FileReadLine, test%A_Index%, Play.txt, %A_Index%
return

!1::
sendinput, {%test1%}
sleep %test2%
sendinput, {%test3%}
sleep %test4%
sendinput, {%test5%}
sleep %test6%
sendinput, {%test7%}
sleep %test8%
sendinput, {%test9%}
sleep %test10%
sendinput, {%test11%}
sleep %test12%</code></pre></div><p>Можно конечно код более оптимальнее придумать, но мне пока думать лень.</p>]]></content>
			<author>
				<name><![CDATA[_Квас]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32130</uri>
			</author>
			<updated>2014-04-20T07:41:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=81979#p81979</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Задание для скрипта в .txt]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=81971#p81971" />
			<content type="html"><![CDATA[<p>Здравствуйте! Писал скрипт и столкнулся с проблемой. Есть файл &quot;Play.txt&quot; он выглядит где-то так:<br /></p><div class="codebox"><pre><code>
w
9766
b
327
d
219
h
171
e
250
y
234</code></pre></div><p>Перед буквой &quot;W&quot; строка. Буквы и цифры будут разными. Нужно что б при нажатии скрипт читал строки по очереди и исполнял то что написано, тоесть если это буква - нажать её потом будет задержка (sleep) и сново буква. <br />В данном случае скрипт должен сделать такое действие:<br /></p><div class="codebox"><pre><code>sendinput, {w}
sleep 9766
sendinput, {b}
sleep 327
sendinput, {d}
sleep 219
sendinput, {h}
sleep 171
sendinput, {e}
sleep250
sendinput, {y}
sleep 234</code></pre></div>]]></content>
			<author>
				<name><![CDATA[BashkaMen]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30800</uri>
			</author>
			<updated>2014-04-19T22:52:14Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=81971#p81971</id>
		</entry>
</feed>
