Up Time Percentage
Platform: mIRC
Published Oct 31, 2011
Updated Nov 01, 2011
This little snippet tracks mIRC's uptime as a percentage using the time mIRC has been open divided by the time since the script was started. It even protects against crashes by periodically saving the uptime.
Just load the snippet and type /uppercent to see how much of the time since you loaded the script mIRC has been running.
Example:
<pball> Uptime Percentage: 99.235506% since Mon Oct 31 23:50:49 2011
(49 seconds later)
<pball> Uptime Percentage: 99.24338% since Mon Oct 31 23:50:49 2011
You can watch your up time percentage increase the longer you've been up, assuming you aren't at 100%. Just know that once you drop below 100% it's impossible to reach 100% (theoretically at least, rounding will let you get 100% after long enough lol).
/*
[Addon]
Script=Uptime Counter
Version=1
Author=pball
Desc=Tracks uptime of mIRC
For=Mirc
Date=10-31-2011
[script]
*/
on *:start:{
if (!%uptimepercent.beginning) set %uptimepercent.beginning $ctime
if (%uptimepercent.temp) set %uptimepercent.up $calc(%uptimepercent.up + (%uptimepercent.temp - %uptimepercent.start))
set %uptimepercent.start $ctime
.timer -o 0 600 set %uptimepercent.temp $!ctime
}
on *:exit:{
set %uptimepercent.up $calc(%uptimepercent.up + ($ctime - %uptimepercent.start))
unset %uptimepercent.temp
}
alias uppercent {
say 7Uptime Percentage: $calc(100* ( %uptimepercent.up + ( $ctime - %uptimepercent.start )) / ( $ctime - %uptimepercent.beginning ) ) $+ % since $asctime(%uptimepercent.beginning)
}