The Adlib function interrupts the main script every Time ms and this will continue until you AdlibUnregister the function or the script ends.

Program example
1: ; Give ourselves an out by pressing ESC
2: HotKeySet("{ESC}", "On_Exit")
3: Func On_Exit()
4: Exit
5: EndFunc
6:
7: ; Register the Adlib function
8: AdlibRegister("Counter", 100)
9:
10: ; Set the counter
11: $i = 0
12:
13: ; Start an infinite loop - but this could be anything you wanted
14: While 1
15: Sleep(10)
16: WEnd
17:
18: ; The Adlib function
19: Func Counter()
20: ; Increase counter
21: $i += 1
22: ; Write it
23: ConsoleWrite($i & @CRLF)
24: EndFunc