Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #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:={"~*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"}
- timecorrection:=0
- Loop, 0xFF
- {
- if (A_Index=0x79 or A_Index=0x7a or A_Index=0x7b)
- continue
- Hotkey,% "~*vk" . A_Index . " down",Label,On T0
- Hotkey,% "~*vk" . A_Index . " up",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, "~\*(vk)0x(.*)", "$1$2" )
- if waittocontinue=1
- {
- if key contains up
- waittocontinue=0
- return
- }
- if play=1
- oldrec:=rec
- play=
- count++
- if (time<0x11)
- time-=time
- rec%count%:=time-timecorrection
- count++
- rec%count%:=key
- ;t.=time "|" key "|"
- ;tooltip,%a_tickcount%`n%A_ThisHotkey%`n%a_priorhotkey%
- ;ToolTip,"%key%"`n%A_TimeSincePriorHotkey%
- oldtime:=a_tickcount
- Return
- ;if vk<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 "`n" play "`n" Play
- if play=
- break
- Play:=rec%a_index%
- if (a_index & 1)
- {
- if Play=wait
- {
- tooltip,Нажми любую кнопку чтобы продолжить.
- waittocontinue=1
- while waittocontinue
- sleep,10
- tooltip
- }
- else if (Play>0 and oldPlay!="wait")
- DllCall("Sleep",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 "`n" play "`n" key
- ; if play=
- ; break
- ; key:=PlayRec%a_index%
- ; if (a_index & 1)
- ; {
- ; if key>0
- ; DllCall("Sleep",UInt,key)
- ; }
- ; else
- ; send,{%key%}
- ;}
- ;play=0
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement