PixelSearch hangs Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
Fefint
Posts: 7
Joined: 18 Aug 2017, 09:27

PixelSearch hangs

14 Jan 2018, 04:13

I'm using PixelSearch to see if I actually pressed a button, there is a variation so can't use Pixelget. But now PixelSearch is starting to hang, it worked fine before. I got a bigger screen and had to redo everything.

This is the code,

Code: Select all

F2::
sleep 500
mousemove 2299, 1196
click 2188, 1196		;open interface
PixelSearch, Px, Py, 2188, 1196, 2188, 1196, 0xC8EAEE, 30, Fast 	;cheack if we opened it
while(ErrorLevel == 0 ){
	click
	sleep 1000
	PixelSearch, Px, Py, 2188, 1196, 2188, 1196, 0xC8EAEE, 30, Fast
}
sleep 250 
click 438, 874
sleep 500
PixelSearch, Px, Py, 575, 276, 576, 277 0xF2F2F1, 30, Fast 	;cheack if we selected it
while(ErrorLevel == 1 ){
	click
	sleep 1000
	PixelSearch, Px, Py, 575, 276, 576, 277 0xF2F2F1, 30, Fast
}
while(ErrorLevel == 0 ){											;deploy
	click 2247, 1355
	sleep 1000
	PixelSearch, Px, Py, 575, 276, 576, 277 0xF2F2F1, 30, Fast
}
sleep 2000


Here is the log,

Code: Select all

004: SendMode,Input
005: SetWorkingDir,%A_ScriptDir%
006: SetTitleMatchMode,2
007: SetDefaultMouseSpeed,2
010: Return (5.25)
033: Sleep,500 (0.50)
034: MouseMove,2299,1196 (0.13)
035: Click,2188, 1196 (0.13)
036: PixelSearch,Px,Py,2188,1196,2188,1196,0xC8EAEE,30,Fast (0.03)
037: While,(ErrorLevel == 0 )
042: Sleep,250 (0.25)
043: Click,438, 874 (0.16)
044: Sleep,500 (0.50)
045: PixelSearch,Px,Py,575,276,576,277 0xF2F2F1,30,Fast (35.33)
077: Pause,Toggle (6.02)
the last PixelSearch will hang, then I must pause the script and after 30sec the command goes through. Before I added a pause button I was forced to kill the script in task manager. The one before work just fine, this is a subroutine and the PixelSearch before this works fine too. I tried to change the pixel area and the color but didn't help. I created a new script with just the subroutine that hangs for testing.

Anyone know why this happens?
User avatar
boiler
Posts: 2372
Joined: 21 Dec 2014, 02:44

Re: PixelSearch hangs  Topic is solved

14 Jan 2018, 04:34

You are missing a comma after 277 in the second PixelSearch.
Fefint
Posts: 7
Joined: 18 Aug 2017, 09:27

Re: PixelSearch hangs

14 Jan 2018, 05:07

Ha, I knew it was something dumb. Thanks for the help.

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], Xtra and 18 guests