Debug System

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
alessipedro
Posts: 2
Joined: 25 May 2022, 22:30

Debug System

Post by alessipedro » 27 May 2022, 10:40

I need help to make a "debug system", if my condition of pixelsearch do not find in "x" seconds, go to next step. thanks

Code: Select all


CoordMode, Pixel, Screen
SetKeyDelay, 0, 100

Loop {
    PixelSearch, x, y, 782, 764, 1145, 883, 0x282A5F, 15, FAST
    if (errorlevel = 0) {
      Send e
      Sleep 6000
      Send e
    }
}

*F2::
Suspend ;Suspend Hotkeys off/on
Pause,, 1 ;Pause Script off/on
Return

Rohwedder
Posts: 7647
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Desbug System

Post by Rohwedder » 27 May 2022, 11:59

Hallo,
perhaps?:

Code: Select all

CoordMode, Pixel, Screen
SetKeyDelay, 0, 100
Time4desbug := 10*1000 ; 10 seconds
TimeFound := A_TickCount
While, A_TickCount - TimeFound < Time4desbug
{
	PixelSearch, x, y, 782, 764, 1145, 883, 0x282A5F, 15, FAST
	if (errorlevel = 0)
	{
		Send e
		Sleep 6000
		Send e
		TimeFound := A_TickCount
	}
}
MsgBox, go to next step
Return
*F2::
Suspend ;Suspend Hotkeys off/on
Pause,, 1 ;Pause Script off/on
Return

Post Reply

Return to “Ask for Help (v1)”