This is a script that counts down from a given number in seconds.
It works like this:
!time 200
Then a timer will start counting down from 200 till 0. When the timer reaches 0 you will receive a message that your timer reached zero.
I also included a antiflood script and if you dont type a number behind !time you will receive a error.
Note: If you start another timer the other one will be deleted!
If you can fix my note post below. I only look at pastebin.org links so dont post any others.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; 0 0 ;;;;
;;; 4 4 2 2 1 ;;;
;; 0 2 1 ;;
; COUNTDOWN SCRIPT BY BIELIE© ;
;; 3 ;;
;;; 0 4 1 0 3 ;;;
;;;; 2 3 1 ;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
on *:TEXT:?time*:#: {
if (!$(,$+(%,flood,$nick))) { return
set -eu3 $+(%,flood,$nick)
}
if ($2 == $null) {
notice $nick Failed to time the required request because you didn't provide the duration!
return
}
if ($2 <= 1) {
notice $nick Error: I only time from 2secs or higher.
return
}
if ($2 => 7200) {
notice $nick Error: I dont accept time request from 2hours or more.
return
}
set -eu$2 $+(%,timer,$nick) $true
if (!$(,$+(%,timer,$nick))) {
notice $nick You already have a timer running. Type !stoptimer to halt the current timer.
return
}
else {
notice $nick Timer has started with $2 Seconds! Type !stoptimer to halt the current timer.
return
}
var %timeduration = $duration((%,timer,$nick).secs)
on *:text:?timeleft: {
notice $nick The timer will stop in %timeduration .
return
}
if ($duration((%,timer,$nick). == $null) {
notice $nick Timer has reached zero after counting down from $2 seconds.
halt
}
on *:text:?stoptimer:#: {
unset -eu$2 $+(%,timer,$nick) $true
}
@Bielie next time try asking for help in the forum under mIRC Snippet Requests instead of asking in the snippet section.
can also do it like this as well
on $*:TEXT:/^\?time?\s?/iS:#:{
if (!$($+(%,timer,$nick),2)) {
set -u3 $+(%,timer,$nick) 1
if ($timer(countdown)) { .notice $nick 5Timer is in use try back in 3 $timer(countdown).secs 5Seconds! }
elseif (!$2 || $2 !isnum) { .notice $nick 4Failed14 to time the required request because you didn't provide the duration! ex: ?time 5 }
else {
.notice $nick 5Timer has started with3 $2 5Seconds!
.timercountdown 1 $2 .notice $nick Timer has reached zero after counting down from $2 seconds! }
}
}
It works like this:
!time 200
Then a timer will start counting down from 200 till 0. When the timer reaches 0 you will receive a message that your timer reached zero.
on *:playend: {
.remove count.txt
.msg %x The countdown has reached zero!
.enable #countdown
}
#countdown on
on *:text:$($strip(!time *)):#: {
if (!%f) { inc -u3 %f
if (($2 > 0) && ($2 > 1)) {
if ($2 !isnum) {
.msg # * Error: !time NumberHere $&
(must be followed by a number!)
}
else {
$iif(!%x,set -e %x #)
var %c $regsubex($str(.,$2),/./g,$+($chr(32),\n)))
tokenize 32 $sorttok(%c,32,nr) | .disable #countdown
.msg %x $1 | write count.txt $* | .play %x count.txt 2000
}
}
else { .msg # * The number must be bigger than 0 and 1! }
}
}
#countdown end