I make a timer called 'main' and i want to check whether this timer is still exist when mirc disconnected. How do go about that? What type of event(s) will cause a timer to cease running?
alias ftimer {
var %i 1
while (%i <= $timer(0)) {
/write timer.txt $timer(%i)
inc %i
}
var %result $iif($read(timer.txt,$1,s) != $null,$true,$false)
.remove timer.txt
return %result
}
/ftimer main
it will make a list of timers in a .txt and then delete the file after the command
thanx codemastr
If you didn't create an offline timer, then yes a timer will stop when you disconnect. To prevent this, when you create the timer add a -o to /timer to tell mIRC it's an offline timer.
So if the timer isn't a offline timer, I've to make it run again when disconnected! thank code and pheonix
The file will never be deleted.
$iif($read(timer.txt,$1,s) != $null,return $true,return $false)
.remove timer.txt
Return is called before the remove is executed. Although I think writing it to a file is a horrible way to do this, the correction would be:
var %result = $iif($read(timer.txt,$1,s), $true, $false)
.remove timer.txt
return %result
Error: Unreachable Code seems to come to mind >:D