I have a problem with the hotkeys for loop sections in my script, what I want is to make it choose betwen one of two labels by using hotkey F1 for first loop and F2 for second one, but the main problem is that I can choose only one time F1/F2 then it will stuck on label1 or label2 (depending on what I choose ) and hotkey F1/F2 will not work anymore so I can't go back, my goal is make it work every time I click F1 or F2, I will be grateful if someone try help me <3 I am a noob at scripting and have already spent many hours creating this script.
Code: Select all
SetKeyDelay, 0
SetMouseDelay, 0
Setbatchlines, -1
#SingleInstance, Force
{
Label1:
Loop,
{
If WinActive("x")
{
PixelGetColor, Checka, 2665,164
PixelGetColor, Checkr, 2666,190
If (Checka <> 0xABABAB)
{
SendInput {F11}
Sleep, 200
}
Sleep, 30
If (Checkr <> 0x5ED4F1)
{
SendInput {F12}
Sleep, 200
}
}
Sleep, 30
}
$F1:: gosub, Label1
return
}
{
Label2:
Loop,
If WinActive("x")
{
PixelGetColor, Checkf, 2663,164
PixelGetColor, Checkd, 2664,191
If (Checkf <> 0x6985C7)
{
SendInput {F8}
Sleep, 200
}
Sleep, 30
If (Checkd <> 0xEDEDED)
{
SendInput {F9}
Sleep, 200
}
Sleep, 30
}
$F2:: gosub, Label2
return
}
$NumpadAdd:: Pause
return