color trigger

Ask gaming related questions (AHK v1.1 and older)
vitorcastro
Posts: 47
Joined: 18 Apr 2021, 19:09

color trigger

Post by vitorcastro » 18 Apr 2021, 19:16

Code: Select all

#Persistent



SetTimer, Cura, 350

Return



Cura:

Sleep,350



PixelGetColor, Color,347, 45

If color = 0x0B0C0F
{

Send {F3}

}

Return
[Mod edit: [code][/code] tags added.]

I need help with this script instead of using the color I wanted him to give the command when the color chose was absent until the color returned to normal
vitorcastro
Posts: 47
Joined: 18 Apr 2021, 19:09

Re: color trigger

Post by vitorcastro » 18 Apr 2021, 19:20

example i have a hp bar when i lose hp the bar changes into gray then the script trigger until the bar is fully red again
User avatar
mikeyww
Posts: 26875
Joined: 09 Sep 2014, 18:38

Re: color trigger

Post by mikeyww » 18 Apr 2021, 19:26

Code: Select all

#Persistent
SetTimer, Cura, 350
Cura:
PixelGetColor, color, 347, 45
If (color = 0x0B0C0F) {
 SetTimer, Cura, Off
 MsgBox, 64, Done, Done!
} Else Send {F3}
Return
vitorcastro
Posts: 47
Joined: 18 Apr 2021, 19:09

Re: color trigger

Post by vitorcastro » 18 Apr 2021, 20:43

there is a box pop up lol saying done!
and its using potion when my hp is lost the scprit i post already do that i need one script when my hp is missing heal until the hp color is back again
vitorcastro
Posts: 47
Joined: 18 Apr 2021, 19:09

Re: color trigger

Post by vitorcastro » 18 Apr 2021, 22:19

i need this if color not exist send f1 until the color get back and delay option
a pause key can be f5
vitorcastro
Posts: 47
Joined: 18 Apr 2021, 19:09

Re: color trigger

Post by vitorcastro » 18 Apr 2021, 22:42

Code: Select all

loop {
		PixelSearch,,, 340, 62, 340, 62, 0xA00415, 100
if (!ErrorLevel = 0)

{
    Send {F2}
sleep 100
send {f2}
	}
}
return



F10::exitapp
[Mod edit: [code][/code] tags added.]



this one is god but there's a problem this one still keeps spaming even if i close the game
User avatar
mikeyww
Posts: 26875
Joined: 09 Sep 2014, 18:38

Re: color trigger

Post by mikeyww » 19 Apr 2021, 06:40

Code: Select all

Gosub, Timer
WinWaitClose, ahk_exe game.exe
Done:
SetTimer, Check, Off
SoundBeep, 1000
ExitApp

Check:
SoundBeep, 1500
PixelSearch,,, 340, 62, 340, 62, 0xA00415, 100, Fast
If !ErrorLevel
 Gosub, Done
Send {F2}
Sleep, 100
Send {F2}
Timer:
SetTimer, Check, -250
Return
Post Reply

Return to “Gaming Help (v1)”