I'm not sure exactly how the code above is supposed to read, but perhaps this can help you out:
Code:
screen_x:=1024
screen_y:=768
x_from := (screen_x/2)-80
x_to := (screen_x/2)+80
y_from := screen_y*0.80
y_to := screen_y*0.80
SetKeyDelay 150
toggle := 1
count := 0
Loop {
if (Mod(count,250)=0) {
ControlSend, , a, WinTitle
Sleep 3500
ControlSend, , b, WinTitle
Sleep 2500
ControlClick, x215 y1010, WinTitle
Sleep 2500
ControlClick, x1080 y840, WinTitle
}
count++
ControlSend, , c, WinTitle
ControlSend, , d, WinTitle
Random, rand,1,5000
Sleep rand
ControlSend, , d, WinTitle
Random, rand,1,5000
Sleep rand
}
Sleep 250
Note - There is no code in this example that breaks the loop