Unable to activate script without hotkey

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
papabr
Posts: 4
Joined: 13 Apr 2016, 21:19

Unable to activate script without hotkey

20 Jun 2018, 19:03

Hello!

I want a script that waits for a pixel color at a specific window, and then takes a screenshot.
I want it to be permanently running when I load AHK.
Problem is he won't run, unless I activate it with a hotkey. What am I doing wrong? Thanks.

Code: Select all

IfWinActive, Empréstimo - Google Chrome
Loop
{
	PixelGetColor, Color, 673, 333
	If Color = 0x663300
	{
		send {printscreen}
		Sleep, 300
	} 
	Else 
	{
	}
}
return
Rohwedder
Posts: 7630
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Unable to activate script without hotkey

21 Jun 2018, 01:02

HaLlo,
try:

Code: Select all

Loop
{
	IfWinActive, Empréstimo - Google Chrome
	{
		PixelGetColor, Color, 673, 333
		If Color = 0x663300
		{
			send {printscreen}
			Sleep, 300
		}
		Else
		{
		}
	}
}
return
papabr
Posts: 4
Joined: 13 Apr 2016, 21:19

Re: Unable to activate script without hotkey

21 Jun 2018, 15:43

Rohwedder wrote:HaLlo,
try:

Code: Select all

Loop
{
	IfWinActive, Empréstimo - Google Chrome
	{
		PixelGetColor, Color, 673, 333
		If Color = 0x663300
		{
			send {printscreen}
			Sleep, 300
		}
		Else
		{
		}
	}
}
return
It worked, thanks! But only after I placed it at the beginning of the script. No good at the end, I don't know why.
gregster
Posts: 9002
Joined: 30 Sep 2013, 06:48

Re: Unable to activate script without hotkey

21 Jun 2018, 18:11

papabr wrote:It worked, thanks! But only after I placed it at the beginning of the script. No good at the end, I don't know why.
Compare https://autohotkey.com/docs/Scripts.htm#auto
papabr
Posts: 4
Joined: 13 Apr 2016, 21:19

Re: Unable to activate script without hotkey

21 Jun 2018, 19:38

gregster wrote:
papabr wrote:It worked, thanks! But only after I placed it at the beginning of the script. No good at the end, I don't know why.
Compare https://autohotkey.com/docs/Scripts.htm#auto
Awesome! Thanks a lot!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: mikeyww and 321 guests