Advertisement
Guest User

Untitled

a guest
Jun 7th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #SingleInstance,Force
  2. AutoTrim,Off
  3. CoordMode,Mouse,Screen
  4. CoordMode,ToolTip
  5. CoordMode,Pixel
  6. Menu,Tray,UseErrorLevel
  7. process,priority,,high
  8. ;SendMode,input
  9. SetBatchLines,-1
  10. SetControlDelay,0
  11. SetKeyDelay,-1
  12. SetTitleMatchMode,2
  13. SetWinDelay,20
  14. SetWorkingDir,%A_ScriptDir%
  15. StringCaseSense,On
  16. DetectHiddenWindows,On
  17.  
  18. SetFormat, IntegerFast, h
  19.  
  20. vkod:={"~*del":"vk2e down","~*up":"vk26 down","~*Down":"vk28 down","~*left":"vk25 down","~*right":"vk27 down","~*ins":"vk2d down","~*home":"vk24 down","~*end":"vk23 down","~*pgup":"vk21 down","~*pgdn":"vk22 down","~*del up":"vk2e up","~*up up":"vk26 up","~*Down up":"vk28 up","~*left up":"vk25 up","~*right up":"vk27 up","~*ins up":"vk2d up","~*home up":"vk24 up","~*end up":"vk23 up","~*pgup up":"vk21 up","~*pgdn up":"vk22 up"}
  21.  
  22. timecorrection:=0
  23.  
  24. Loop, 0xFF
  25. {
  26.   if (A_Index=0x79 or A_Index=0x7a or A_Index=0x7b)
  27.     continue
  28.   Hotkey,% "~*vk" . A_Index . " down",Label,On T0
  29.   Hotkey,% "~*vk" . A_Index . " up",Label,On
  30. }
  31.  
  32.   Hotkey,~*del,Label,On T0
  33.   Hotkey,~*up,Label,On T0
  34.   Hotkey,~*Down,Label,On T0
  35.   Hotkey,~*left,Label,On T0
  36.   Hotkey,~*right,Label,On T0
  37.   Hotkey,~*ins,Label,On T0
  38.   Hotkey,~*home,Label,On T0
  39.   Hotkey,~*end,Label,On T0
  40.   Hotkey,~*pgup,Label,On T0
  41.   Hotkey,~*pgdn,Label,On T0
  42.  
  43.   Hotkey,~*del up,Label,On T0
  44.   Hotkey,~*up up,Label,On T0
  45.   Hotkey,~*Down up,Label,On T0
  46.   Hotkey,~*left up,Label,On T0
  47.   Hotkey,~*right up,Label,On T0
  48.   Hotkey,~*ins up,Label,On T0
  49.   Hotkey,~*home up,Label,On T0
  50.   Hotkey,~*end up,Label,On T0
  51.   Hotkey,~*pgup up,Label,On T0
  52.   Hotkey,~*pgdn up,Label,On T0
  53. Return
  54.  
  55. Label:
  56. critical
  57. ;tooltip,%a_tickcount%`n%A_ThisHotkey%`n%a_priorhotkey%
  58. if (A_ThisHotkey=a_priorhotkey)
  59.   return
  60. time:=a_tickcount-oldtime
  61. if A_ThisHotkey not contains vk
  62.   key:=vkod[A_ThisHotkey]
  63. else
  64.   key:=RegExreplace(A_ThisHotkey, "~\*(vk)0x(.*)", "$1$2" )
  65.  
  66. if waittocontinue=1
  67. {
  68.   if key contains up
  69.     waittocontinue=0
  70.   return
  71. }
  72.  
  73. if play=1
  74.   oldrec:=rec
  75. play=
  76.  
  77. count++
  78. if (time<0x11)
  79.   time-=time
  80. rec%count%:=time-timecorrection
  81.  
  82. count++
  83. rec%count%:=key
  84. ;t.=time "|" key "|"
  85. ;tooltip,%a_tickcount%`n%A_ThisHotkey%`n%a_priorhotkey%
  86.  
  87. ;ToolTip,"%key%"`n%A_TimeSincePriorHotkey%
  88. oldtime:=a_tickcount
  89. Return
  90.  
  91. ;if vk<7 save coords
  92.  
  93. f10::  ; rec
  94. tooltip
  95. oldtime:=a_tickcount
  96. rec=
  97. play=
  98. count=
  99. t=
  100. return
  101.  
  102. F12::  ; play
  103. PlayRec=
  104. play=1
  105. loop,% count
  106. {
  107. ;  critical
  108. ;tooltip,% A_loopfield "`n" play "`n" Play
  109.   if play=
  110.     break
  111.   Play:=rec%a_index%
  112.   if (a_index & 1)
  113.   {
  114.     if Play=wait
  115.     {
  116.       tooltip,Нажми любую кнопку чтобы продолжить.
  117.       waittocontinue=1
  118.       while waittocontinue
  119.         sleep,10
  120.       tooltip
  121.     }
  122.     else if (Play>0 and oldPlay!="wait")
  123.       DllCall("Sleep",UInt,Play)
  124.     oldPlay:=Play
  125.   }
  126.   else
  127.     send,{%Play%}
  128.   PlayRec%a_index%:=Play
  129.   c:=a_index
  130. }
  131. play=0
  132. ;loop,% c
  133. ;  rec%a_index%:=PlayRec%a_index%
  134. return
  135.  
  136. F11::  ; play old
  137. count++
  138. rec%count%=wait
  139. count++
  140. rec%count%=vk07 up
  141.  
  142. ;fileappend,%t%,Rec
  143. ;play=1
  144. ;loop,c
  145. ;{
  146. ;;  critical
  147. ;;tooltip,% A_loopfield "`n" play "`n" key
  148. ;  if play=
  149. ;    break
  150. ;  key:=PlayRec%a_index%
  151. ;  if (a_index & 1)
  152. ;  {
  153. ;    if key>0
  154. ;      DllCall("Sleep",UInt,key)
  155. ;  }
  156. ;  else
  157. ;    send,{%key%}
  158. ;}
  159. ;play=0
  160. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement