Skip to content

Instantly share code, notes, and snippets.

@JoeGlines
Created October 14, 2025 11:42
Show Gist options
  • Save JoeGlines/5d487e75696edce46cfb3ed48d09f767 to your computer and use it in GitHub Desktop.
Save JoeGlines/5d487e75696edce46cfb3ed48d09f767 to your computer and use it in GitHub Desktop.
#Requires AutoHotkey v2.0.2+
#SingleInstance Force
; Global counter for demonstration
downloadCount := 0
; Start three "concurrent" downloads
SetTimer(downloadImage, 2000) ; Run after 2 seconds
SetTimer(downloadVideo, 3000) ; Run after 3 seconds
SetTimer(downloadDoc, 1000) ; Run after 1 second
; Simulate downloads with timers
downloadImage() {
global downloadCount
MsgBox("Image downloaded!")
downloadCount++
checkComplete()
}
downloadVideo() {
global downloadCount
MsgBox("Video downloaded!")
downloadCount++
checkComplete()
}
downloadDoc() {
global downloadCount
MsgBox("Document downloaded!")
downloadCount++
checkComplete()
}
checkComplete() {
global downloadCount
if (downloadCount = 3) {
MsgBox("All downloads complete!")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment