Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- #Warn ; Enable warnings to assist with detecting common errors.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- #SingleInstance Force
- ;#NoTrayIcon
- SetBatchLines, -1
- SetKeyDelay, -1, 1
- SetControlDelay, -1
- SetMouseDelay, -1
- SetWinDelay, -1
- SetBatchLines, -1
- ListLines, Off
- PID := DllCall("GetCurrentProcessId")
- Process, Priority, %PID%, High
- Hotkey, ^1, Exit
- Hotkey, ^2, ToggleOn
- Hotkey, ^3, ToggleOff
- Exit(){
- ExitApp
- }
- global toggle := 0
- global count := 0
- global ticks := 0
- global freq := 0
- global CounterAfter := 0
- global CounterBefore := 0
- ToggleOn(){
- if(toggle = 0){
- toggle := 1
- Start()
- }
- }
- ToggleOff(){
- if(toggle = 1){
- toggle := 0
- }
- }
- Start(){
- While(toggle = 1){
- Send {Space Down}
- DllCall("QueryPerformanceFrequency", "Int64*", freq)
- DllCall("QueryPerformanceCounter", "Int64*", CounterBefore)
- DllCall("QueryPerformanceCounter", "Int64*", CounterAfter)
- While((CounterAfter - CounterBefore) / freq * 1000 <= 922){
- DllCall("QueryPerformanceCounter", "Int64*", CounterAfter)
- }
- Send {Space Up}
- ;Debug()
- }
- }
- Debug(){
- temp := (CounterAfter - CounterBefore) / freq * 1000
- count := count + temp
- d := count/temp
- Tooltip, Tick Between Down and Up: %temp%`nLoop Iterations: %d%
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement