Please help fix my AHK script

06/29/2022 15:38 Comprehensive_Socks156#1
Hello all, I am fairly new and was wondering if someone can help me fix my script.

Quote:
CoordMode, Mouse, Screen

F11::
Loop
{
Sleep 6000
Send {E}
Loop
{
PixelSearch, FoundX, FoundY, 213, 235, 1569, 918, 0xeaba6f, 10, RGB Fast
if (ErrorLevel = 0){
Send {E}
Break
}
}
}
*ESC::ExitApp
Overall, I want this entire script to loop, but I don't want it repeatedly inputting E until after it finds the pixel. After it finds the pixel and completes the ErrorLevel = 0, I want it to start from the top again with the Sleep/Send {E}. Hope that makes sense, the pixel is being found I just want it to restart from the very top.
06/30/2022 09:06 Toxicator#2
#moved
07/18/2022 12:03 SEEH4U5#3
Quote:
Originally Posted by Comprehensive_Socks156 View Post
Hello all, I am fairly new and was wondering if someone can help me fix my script.



Overall, I want this entire script to loop, but I don't want it repeatedly inputting E until after it finds the pixel. After it finds the pixel and completes the ErrorLevel = 0, I want it to start from the top again with the Sleep/Send {E}. Hope that makes sense, the pixel is being found I just want it to restart from the very top.
I don't know if ErrorLevel is triggered so i would try to replace ErrorLevel=0 with if color = 0xeaba6f.

Why looping two times?

The main part of your script could look like this:
Code:
Loop
{
PixelSearch, FoundX, FoundY, 213, 235, 1569, 918, 0xeaba6f, 10, RGB Fast
   if color = 0xeaba6f
      send {e down}
      sleep 30
      send {e up}
      break
sleep 10
}
send {e down}
sleep 30
send {e up}
return
Untested. Maybe it helps.

Sincerely yours,
SEEH4U5