Code:
#NoEnv
; #Warn.
SendMode Input
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetControlDelay -1
test = off
XPos = 0
YPos = 0
PixelColor = 0
settitlematchmode, 2
id := WinExist("") // fortnite window name.
F1:: // When u press F1 you have to hold it over the place where it should read pos and color.
If test = off
{
test = on
MouseGetPos, XPos, YPos
PixelGetColor, PixelColor, %XPos%, %YPos%
SetTimer, test, 100
SoundPlay, %A_WinDir%\Media\Windows Ding.wav
} else If test = on
{
test = off
SetTimer, test, Off
SoundPlay, %A_WinDir%\Media\Windows Ding.wav
sleep 100
SoundPlay, %A_WinDir%\Media\Windows Ding.wav
}
return
test:
PixelGetColor, PixelColor2, %XPos%, %YPos%
If (PixelColor == PixelColor2)
{
;ToolTipDisplay("Matched" . PixelColor . " x" . PixelColor2)
} Else {
if WinExist("ahk_exe test.exe") // Here u insert fortnite
{
ControlSend,,{},ahk_id %id% // Here You insert click function in your case.
sleep 400
ToolTipDisplay("joining next game example text...") // Not necessary but i like it with a tooltip :D
}
}
return
ToolTipDisplay(Message) {
ToolTip, %Message%
SetTimer, RemoveToolTip, 500
return
}
RemoveToolTip:
SetTimer, RemoveToolTip, Off
ToolTip
return