<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; Как правильно написать код, запоминающий нажатие клавиши?]]></title>
		<link>http://forum.script-coding.com/viewtopic.php?id=10943</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=10943&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «Как правильно написать код, запоминающий нажатие клавиши?».]]></description>
		<lastBuildDate>Tue, 06 Oct 2015 14:05:44 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Как правильно написать код, запоминающий нажатие клавиши?]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=97931#p97931</link>
			<description><![CDATA[<p>А типо бот можно записать маршрут автобуса чтоль?</p>]]></description>
			<author><![CDATA[null@example.com (Dimasik-Sk)]]></author>
			<pubDate>Tue, 06 Oct 2015 14:05:44 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=97931#p97931</guid>
		</item>
		<item>
			<title><![CDATA[Re: Как правильно написать код, запоминающий нажатие клавиши?]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=97398#p97398</link>
			<description><![CDATA[<p>Большое спасибо!&nbsp; Разобрался в коде)</p>]]></description>
			<author><![CDATA[null@example.com (GrayFox1)]]></author>
			<pubDate>Sun, 13 Sep 2015 19:50:20 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=97398#p97398</guid>
		</item>
		<item>
			<title><![CDATA[Re: Как правильно написать код, запоминающий нажатие клавиши?]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=97389#p97389</link>
			<description><![CDATA[<p>Вот пытался когда-то:<br /></p><div class="codebox"><pre><code>#SingleInstance,Force
AutoTrim,Off
CoordMode,Mouse,Screen
CoordMode,ToolTip
CoordMode,Pixel
Menu,Tray,UseErrorLevel
process,priority,,high
;SendMode,input
SetBatchLines,-1
SetControlDelay,0
SetKeyDelay,-1
SetTitleMatchMode,2
SetWinDelay,20
SetWorkingDir,%A_ScriptDir%
StringCaseSense,On
DetectHiddenWindows,On

SetFormat, IntegerFast, h

vkod:={&quot;~*del&quot;:&quot;vk2e down&quot;,&quot;~*up&quot;:&quot;vk26 down&quot;,&quot;~*Down&quot;:&quot;vk28 down&quot;,&quot;~*left&quot;:&quot;vk25 down&quot;,&quot;~*right&quot;:&quot;vk27 down&quot;,&quot;~*ins&quot;:&quot;vk2d down&quot;,&quot;~*home&quot;:&quot;vk24 down&quot;,&quot;~*end&quot;:&quot;vk23 down&quot;,&quot;~*pgup&quot;:&quot;vk21 down&quot;,&quot;~*pgdn&quot;:&quot;vk22 down&quot;,&quot;~*del up&quot;:&quot;vk2e up&quot;,&quot;~*up up&quot;:&quot;vk26 up&quot;,&quot;~*Down up&quot;:&quot;vk28 up&quot;,&quot;~*left up&quot;:&quot;vk25 up&quot;,&quot;~*right up&quot;:&quot;vk27 up&quot;,&quot;~*ins up&quot;:&quot;vk2d up&quot;,&quot;~*home up&quot;:&quot;vk24 up&quot;,&quot;~*end up&quot;:&quot;vk23 up&quot;,&quot;~*pgup up&quot;:&quot;vk21 up&quot;,&quot;~*pgdn up&quot;:&quot;vk22 up&quot;}

timecorrection:=0

Loop, 0xFF
{
  if (A_Index=0x79 or A_Index=0x7a or A_Index=0x7b)
    continue
  Hotkey,% &quot;~*vk&quot; . A_Index . &quot; down&quot;,Label,On T0
  Hotkey,% &quot;~*vk&quot; . A_Index . &quot; up&quot;,Label,On
}

  Hotkey,~*del,Label,On T0
  Hotkey,~*up,Label,On T0
  Hotkey,~*Down,Label,On T0
  Hotkey,~*left,Label,On T0
  Hotkey,~*right,Label,On T0
  Hotkey,~*ins,Label,On T0
  Hotkey,~*home,Label,On T0
  Hotkey,~*end,Label,On T0
  Hotkey,~*pgup,Label,On T0
  Hotkey,~*pgdn,Label,On T0

  Hotkey,~*del up,Label,On T0
  Hotkey,~*up up,Label,On T0
  Hotkey,~*Down up,Label,On T0
  Hotkey,~*left up,Label,On T0
  Hotkey,~*right up,Label,On T0
  Hotkey,~*ins up,Label,On T0
  Hotkey,~*home up,Label,On T0
  Hotkey,~*end up,Label,On T0
  Hotkey,~*pgup up,Label,On T0
  Hotkey,~*pgdn up,Label,On T0
Return

Label:
critical
;tooltip,%a_tickcount%`n%A_ThisHotkey%`n%a_priorhotkey%
if (A_ThisHotkey=a_priorhotkey)
  return
time:=a_tickcount-oldtime
if A_ThisHotkey not contains vk
  key:=vkod[A_ThisHotkey]
else
  key:=RegExreplace(A_ThisHotkey, &quot;~\*(vk)0x(.*)&quot;, &quot;$1$2&quot; )

if waittocontinue=1
{
  if key contains up
    waittocontinue=0
  return
}

if play=1
  oldrec:=rec
play=

count++
if (time&lt;0x11)
  time-=time
rec%count%:=time-timecorrection

count++
rec%count%:=key
;t.=time &quot;|&quot; key &quot;|&quot;
;tooltip,%a_tickcount%`n%A_ThisHotkey%`n%a_priorhotkey%

;ToolTip,&quot;%key%&quot;`n%A_TimeSincePriorHotkey%
oldtime:=a_tickcount
Return

;if vk&lt;7 save coords

f10::  ; rec
tooltip
oldtime:=a_tickcount
rec=
play=
count=
t=
return

F12::  ; play
PlayRec=
play=1
loop,% count
{
;  critical
;tooltip,% A_loopfield &quot;`n&quot; play &quot;`n&quot; Play
  if play=
    break
  Play:=rec%a_index%
  if (a_index &amp; 1)
  {
    if Play=wait
    {
      tooltip,Нажми любую кнопку чтобы продолжить.
      waittocontinue=1
      while waittocontinue
        sleep,10
      tooltip
    }
    else if (Play&gt;0 and oldPlay!=&quot;wait&quot;)
      DllCall(&quot;Sleep&quot;,UInt,Play)
    oldPlay:=Play
  }
  else
    send,{%Play%}
  PlayRec%a_index%:=Play
  c:=a_index
}
play=0
;loop,% c
;  rec%a_index%:=PlayRec%a_index%
return

F11::  ; play old
count++
rec%count%=wait
count++
rec%count%=vk07 up

;fileappend,%t%,Rec
;play=1
;loop,c
;{
;;  critical
;;tooltip,% A_loopfield &quot;`n&quot; play &quot;`n&quot; key
;  if play=
;    break
;  key:=PlayRec%a_index%
;  if (a_index &amp; 1)
;  {
;    if key&gt;0
;      DllCall(&quot;Sleep&quot;,UInt,key)
;  }
;  else
;    send,{%key%}
;}
;play=0
return



</code></pre></div><p>F10 - запись.<br />F12 - воспроизведение.</p>]]></description>
			<author><![CDATA[null@example.com (Alectric)]]></author>
			<pubDate>Sun, 13 Sep 2015 12:46:09 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=97389#p97389</guid>
		</item>
		<item>
			<title><![CDATA[Как правильно написать код, запоминающий нажатие клавиши?]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=97377#p97377</link>
			<description><![CDATA[<p>Пытаюсь создать&nbsp; скрипт,&nbsp; который будет запоминать нажатие клавиши (действия), к примеру вождение машины (эмуляция),&nbsp; &nbsp; для gta samp,&nbsp; а после будет их воспроизводить. Пытался сделать с помощью макроса,&nbsp; тоже не вышло. Нужна ваша помощь. Заранее спасибо!</p>]]></description>
			<author><![CDATA[null@example.com (GrayFox1)]]></author>
			<pubDate>Sat, 12 Sep 2015 11:14:00 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=97377#p97377</guid>
		</item>
	</channel>
</rss>
