01 Feb 11, 06:22AM
More of a toy than anything, but could be useful in many situations (like the akimbo countdown script :D)...
[SELECT ALL] Code:
// Countdown script - counts down from x to y, in z intervals, and outputs it all on the console every A milliseconds - by DES|Bukz
alias countdown [
alias countdownfrom $arg1
alias countdownto $arg2
alias countdownint $arg3
alias countdownsleep $arg4
alias countdownsleepcounter 0
loop ctdnloop (div $countdownfrom $countdownint) [
+= countdownsleepcounter $countdownsleep
if (>= (- $countdownfrom $countdownint) $countdownto) [
sleep $countdownsleepcounter [-= countdownfrom $countdownint; echo $countdownfrom]
] []
]
]
docsection [Countdown];
docident [countdown] [Shows a countdown on the console.];
docargument [X] [The starting value.];
docargument [Y] [The ending value.];
docargument [I] [The interval to count in.];
docargument [S] [The sleep value between each echo.];
docexample [/countdown 10 0 1 1000] [Output: 10 lines on the console that show up in 1 second intervals.];