shortcut key to anticipate the next line of a script ?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
gabrielquaglio
Posts: 6
Joined: 22 Nov 2021, 21:50

shortcut key to anticipate the next line of a script ?

Post by gabrielquaglio » 02 Oct 2022, 10:14

Which command to use to anticipate a command line, for example, every 8 seconds the mouse moves to a position x, y, however, I would like the F2 key to anticipate the mouse moves from the next line manually without having to wait the 8 seconds , a shortcut to anticipate the next line, what would the command be?

F1::
mousemove 899, 600
sleep, 8000
mousemove 634, 232
sleep, 8000
mousemove 233, 1980....


[Mod action: Topic moved from "Scripts and Functions"]

sofista
Posts: 650
Joined: 24 Feb 2020, 13:59
Location: Buenos Aires

Re: shortcut key to anticipate the next line of a script ?

Post by sofista » 02 Oct 2022, 11:08

An idea, maybe it does what you want. I adapted the MouseMove coordinates for testing purposes, also introduced a Tooltip for the same reason, you can remove it later.

Code: Select all

arr := [ [100, 200], [300, 400], [500, 600], [100, 200], [300, 400], [500, 600] ]

F1::
For _, v in arr {
	MouseMove, v[1], v[2]
	Sleeping(8000)
}
return

Sleeping(n) {
	Loop, 100 {
		if !GetKeyState("F2", "P") {
			ToolTip, % A_Index
			Sleep, % n//100
		} else return
	}
}

Post Reply

Return to “Ask for Help (v1)”