Page 1 of 1

Command to put script to idle

Posted: 25 May 2019, 18:44
by derpybaits
Right now the script looks for a color and when it sees it continues the action until I hit the F5 key again to stop it. What I was wondering is how to make it only activate one time and then wait for me to hit F5 again to start the search again.

#NoEnv
SetWorkingDir %A_ScriptDir%
CoordMode, Mouse, Client
SendMode Input
#SingleInstance Force
SetTitleMatchMode 2
#WinActivateForce
SetControlDelay 1
SetWinDelay 0
SetKeyDelay -1
SetMouseDelay -1

F5::SetTimer F9,% (F9 := !F9) ? 1 : "Off"
F9::
PixelSearch, Px, Py, 90, 190, 1062, 621, 0xFF3300, 0, Fast
if ErrorLevel
return
{
Click, 830 463
Send {F4}
sleep 40
Click, 835 472
sleep 40
Click, 835 472
sleep 40
Click, 835 472
PixelSearch, Px, Py, 90, 190, 1062, 621, 0x36667F, 0, Fast
Click %Px%, %Py% 2
Send {F1}
}

Re: Command to put script to idle

Posted: 25 May 2019, 19:05
by Xtra

Code: Select all

F5::SetTimer, F9, -1
or

Code: Select all

F5::
F9::
PixelSearch, Px, Py, 90, 190, 1062, 621, 0xFF3300, 0, Fast
if ErrorLevel
return
{
Click, 830 463
Send {F4}
sleep 40
Click, 835 472 
sleep 40
Click, 835 472 
sleep 40
Click, 835 472 
PixelSearch, Px, Py, 90, 190, 1062, 621, 0x36667F, 0, Fast
Click %Px%, %Py% 2
Send {F1}
}

Re: Command to put script to idle

Posted: 25 May 2019, 19:33
by derpybaits
Works perfectly now thank you