hey i  have this script but its not working properly, sometimes f8 takes over and f6/f7 doesnt work, sometimes its the opposite
i need u to fix it for me
i dont care if u change the structure i just need it working

!;::  ; Toggle AfkKillCompleto (Use a valid hotkey)
toggle := !toggle  ; Reverse the toggle value

if toggle {
    ToolTip, AfkKillCompletoUtito Started
    SetTimer, AfkKillCompletoUtito, 100  ; Calls the label every 100 ms
} else {
    SetTimer, AfkKillCompletoUtito, Off
    ToolTip, AfkKillCompletoUtito Stopped
    Sleep, 1000
    ToolTip
}
Return

AfkKillCompletoUtito:
if (toggle = false) || AutoPanickActive {
    Return
}

currentTime := A_TickCount

; Check and send F8 every 4 seconds
if (currentTime - lastF8Time >= 4000) { 
    send, {F8}
    lastF8Time := currentTime
}

; Alternate F6 and F7 every 2 seconds
if (currentTime - lastF6F7Time >= 1000) {
    if (isF6Next) {
        send, {F6}
        isF6Next := false
    } else {
        send, {F7}
        isF6Next := true
    }
    lastF6F7Time := currentTime
}

; Send F4 every second
if (currentTime - lastF1F2F3Time >= 100) {
    send, {F4}
}

; Send 2 every second
send, 2

; Cycle through F1, F2, F3 every 2 seconds
if (currentTime - lastF1F2F3Time >= 2000) {
    switch (AfkKillCompletoIndex) {
        case 1:
            send, {F1}
        case 2:
            send, {F2}
        case 3:
            send, {F3}
    }
    
    AfkKillCompletoIndex := AfkKillCompletoIndex + 1
    if (AfkKillCompletoIndex > 3)
        AfkKillCompletoIndex := 1
    
    lastF1F2F3Time := currentTime
}

; Perform the mouse click sequence every 3 seconds
if (currentTime - lastMouseClickTime >= 3000) {
    Random, offsetX, -5, 5
    Random, offsetY, -5, 5

    send, {Alt down}
    MouseClick, Left, 3134 + offsetX, 215 + offsetY ; Click at monster position
    send, {Alt up}

    send, {Shift down}
    Click, Right, 1927 + offsetX, 741 + offsetY ; Right click around positions
    Click, Right, 2049 + offsetX, 741 + offsetY 
    Click, Right, 2050 + offsetX, 870 + offsetY
    Click, Right, 2051 + offsetX, 995 + offsetY
    Click, Right, 1924 + offsetX, 995 + offsetY
    Click, Right, 1801 + offsetX, 995 + offsetY
    Click, Right, 1801 + offsetX, 870 + offsetY
    Click, Right, 1801 + offsetX, 744 + offsetY
    Click, Right, 1925 + offsetX, 870 + offsetY
    send, {Shift up}

    lastMouseClickTime := currentTime
}

Return


i ll give u more details, so u can change as u see fit
f8 has a cooldown of 2 seconds and lasts for 10 seconds,
f6 and f7 has 2 seconds of cooldown each and lasts for 6 seconds each
f6,f7,f8 has a shared cooldown of 1 second, meaning each time u send of this all other are put on a 1 second cooldown

f1, f2,f3 works the same way, however each has a cooldown of 6 seconds

f4 is working good so dont need to change that
2 is working good so dont need to change that

i want f8 to be sent before f6 and f7 everytime so it has a higher priority
f6 and f7 need to be cycled, so one time u use f6 other u use f7, i dont care if u put it on a loop or cycle or just one key after the other, i just need to send both of them , one after the other

i want f8 to be sent every 8 seconds
i want f6 or f7 to be sent every 2 seconds , could be f6 in 2 seconds, then f7 in 2 seconds, then f6 in 2 seconds and so on
i want the f1,f2,f3 to be cycle so you sent first f1, then f2,then f3 , so f1 has the higher priority, then f2, then f3, and i want them to be fired every second, so every second u press f1, then f2, then f3

remember, there can be no conflict in the keys because of their cooldows