Command to put script to idle

Ask gaming related questions
derpybaits
Posts: 9
Joined: 22 Dec 2018, 03:14

Command to put script to idle

25 May 2019, 18:44

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}
}
User avatar
Xtra
Posts: 1370
Joined: 02 Oct 2015, 12:15

Re: Command to put script to idle

25 May 2019, 19:05

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}
}
derpybaits
Posts: 9
Joined: 22 Dec 2018, 03:14

Re: Command to put script to idle

25 May 2019, 19:33

Works perfectly now thank you

Return to “Gaming”

Who is online

Users browsing this forum: Dumitas and 31 guests