I need help ending a script and being ready for the next key press. Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
mexican scientist
Posts: 33
Joined: 02 Jul 2020, 21:55

I need help ending a script and being ready for the next key press.

12 Jan 2023, 14:38

this is my code

Code: Select all

#IfWinActive, Elder Scrolls Online
z::
sleep, 11000
SetTimer, CheckColor, 1000
CheckColor:
    CoordMode, Pixel, Screen
    PixelSearch, X, Y, 1263, 958, 1371, 965, 0xF0463B, 10
    If ErrorLevel = 0
	{
        Send, {f}
	sleep, 5000
	Send, {f}
	sleep, 100
	PixelSearch, X, Y, 1093, 640, 1099, 644, 0x000000, 2
		If ErrorLevel = 1
			{
			sleep, 1000
			PixelSearch, X, Y, 1093, 640, 1099, 644, 0x000000, 2
				If ErrorLevel = 1
					{
					MsgBox The Scrip now ends, you can now press z again to start the script again.
					Exit
					}
			}

	}
Return
Notice the message box "The Scrip now ends, you can now press z again to start the script again."

How can I end the script here and do exactly what the message box claims? Using the Exit command does not work. The script is still searching for pixel colors...
adrianh
Posts: 135
Joined: 28 Jul 2014, 15:34

Re: I need help ending a script and being ready for the next key press.  Topic is solved

12 Jan 2023, 15:34

https://www.autohotkey.com/docs/v1/lib/SetTimer.htm wrote: PeriodOnOffDelete
Period: Creates or updates a timer using the absolute value of this parameter as the approximate number of milliseconds that must pass before the timer is executed. The timer will be automatically enabled and reset. It can be set to repeat automatically or run only once:
  • If Period is positive, the timer will automatically repeat until it is explicitly disabled by the script.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 181 guests