I need a non interrupting indicator of loop running

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
ahkjthunter4888
Posts: 11
Joined: 02 Jul 2021, 17:29

I need a non interrupting indicator of loop running

12 Sep 2021, 15:12

So I have a loop that i run using the ~ button. I need some sort of indicator that will show on the screen each time the ~ button is being pressed to run the loop. The reason I need this is there are times when nothing is happening on screen and I'm not sure if the loop is running at all or if there is simply no White pixels to pick up. in the instance where there are no white pixels to pick up and I press the ~ button, well now I've turned the loop off thinking it wasn't on.

Any help is greatly appreciated. I would prefer a green dot on the top right corner of the screen but text or something is fine too as lone as it's a visual indicator that the ~ button was just pressed to start the loop and it won't stop or interrupt the loop. Please and Thank you in advance!

Code: Select all

#NoEnv
#SingleInstance Force
#MaxHotkeysPerInterval 99000000
#HotkeyInterval 99000000
#KeyHistory 0
ListLines Off
Process, Priority, , A
SetBatchLines, -1
SetKeyDelay, -1, -1
SetMouseDelay, -1
SetDefaultMouseSpeed, 0
SetWinDelay, -1
SetControlDelay, -1
SendMode Input


posX := [10,45,73,105,133,167,195,228,258,288,320,350,382,415,445,10,45,73,105,133,167,195,228,258,288,320,350,382,415,445,10,45,73,105,133,167,195,228,258,288,320,350,382,415,445,10,45,73,105,133,167,195,228,258,288,320,350,382,415,445,10,45,73,105,133,167,195,228,258,288,320,350,382,415,445,20,45,73,105,133,167,195,228,258,288,320,350,382,415,445]
posY := [880,880,880,880,880,880,880,880,880,880,880,880,880,880,880,910,910,910,910,910,910,910,910,910,910,910,910,910,910,910,940,940,940,940,940,940,940,940,940,940,940,940,940,940,940,975,975,975,975,975,975,975,975,975,975,975,975,975,975,975,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1061,1065,1065,1065,1065,1065,1065,1065,1065,1065,1065,1065,1065,1065,1065]
clr := 0xFFFFFF
char := ["1","2","3","4","5","6","7","8","9","0","t","g","k","y","u","!1","!2","!3","!4","!5","!6","!7","!8","!9","!0","!t","!g","!k","!y","!u","+1","+2","+3","+4","+5","+6","+7","+8","+9","+0","+t","+g","+k","+y","+u","^+1","^+2","^+3","^+4","^+5","6","^+7","^+8","^+9","^+j","^+t","^+g","^+k","^+y","^+u","^1","^2","^3","^4","^5","^6","^7","^8","9","^0","^t","^g","^k","^y","^u","^!1","^!2","^!3","^!4","^!5","^!6","^!7","^!8","^!9","^!0","^!t","^!g","^!k","^!y","^!u"]


`::
	Loop, % posX.MaxIndex()
	{
		PixelGetColor, color, posX[A_Index], posY[A_Index], Fast
		if (color = clr)
		{
			Send % char[A_Index]
			break
		}
	}
return
User avatar
Hellbent
Posts: 2114
Joined: 23 Sep 2017, 13:34

Re: I need a non interrupting indicator of loop running

12 Sep 2021, 15:45

You can add in something like this.

Code: Select all


Gui1:= {}
Gui1.Controls := {} 
Gui, Gui1:New, +AlwaysOnTop -Caption -DPIScale +hwndHwnd 
Gui1.Hwnd := hwnd 
Gui, Gui1:Margin, 0 , 0
;Progress
Gui, Gui1:Add, Progress ,w100 h30 cRed BackgroundBlack hwndhwnd , 100
Gui1.Progress := hwnd
Gui, Gui1:Font, s12 cBlack q5 , Gui1
;Text
Gui, Gui1:Add, Text ,xm ym w100 h30 0x200 Center BackgroundTrans hwndhwnd , Off
Gui1.Text := hwnd
Gui, Gui1:Show, x0 y0 AutoSize NA,  

Numpad1::
	GuiControl, % (Tog := !Tog) ? ( "Gui1:+cLime" ) : ( "Gui1:+cRed" ), % Gui1.Progress
	GuiControl, Gui1:, % Gui1.Text, % (Tog)?("On"):("Off") 
	Return

The Numpad1 stuff would go in your hotkey.
ahkjthunter4888
Posts: 11
Joined: 02 Jul 2021, 17:29

Re: I need a non interrupting indicator of loop running

12 Sep 2021, 16:08

It works Beautifully good sir. Thank you very much.
User avatar
Hellbent
Posts: 2114
Joined: 23 Sep 2017, 13:34

Re: I need a non interrupting indicator of loop running

12 Sep 2021, 17:25

@SOTE Thanks.

Been awhile, been well I hope.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: mikeyww, peter_ahk, Spawnova and 351 guests