Top

System, mIRC, and Connection Uptime Recorde


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  0.0 (of 0 scores)
Date Added  Jun 22, 2009
Last Updated  Jun 22, 2009
Tags  record  uptime 

Introduction

Just an alias that displays your system uptime, mIRC uptime, and connection uptime, and keeps a record of each.

Grab the Code

alias uptime {
  var %systemup.seconds = $uptime(system,3)
  var %mircup.seconds = $uptime(mirc,3)
  var %serverup.seconds = $uptime(server,3)
  var %systemup.format = $uptime(system,1)
  var %mircup.format = $uptime(mirc,1)
  var %serverup.format = $uptime(server,1)
  if ((%systemup.seconds.record !isnum) || (%systemup.seconds.record < %systemup.seconds)) {
    set %systemup.seconds.record %systemup.seconds | set %systemup.format.record %systemup.format
  }
  if ((%mircup.seconds.record !isnum) || (%mircup.seconds.record < %mircup.seconds)) {
    set %mircup.seconds.record %mircup.seconds | set %mircup.format.record %mircup.format
  }
  if ((%serverup.seconds.record !isnum) || (%serverup.seconds.record < %serverup.seconds)) {
    set %serverup.seconds.record %serverup.seconds | set %serverup.format.record %serverup.format
  }
  say System Uptime: %systemup.format
  say Record System Uptime: %systemup.format.record
  say mIRC Uptime: %mircup.format
  say Record mIRC Uptime: %mircup.format.record
  say Connection Uptime: %serverup.format
  say Record Connection Uptime: %serverup.format.record
}
on *:exit:{
  var %systemup.seconds = $uptime(system,3)
  var %mircup.seconds = $uptime(mirc,3)
  var %serverup.seconds = $uptime(server,3)
  var %systemup.format = $uptime(system,1)
  var %mircup.format = $uptime(mirc,1)
  var %serverup.format = $uptime(server,1)
  if ((%systemup.seconds.record !isnum) || (%systemup.seconds.record < %systemup.seconds)) {
    set %systemup.seconds.record %systemup.seconds | set %systemup.format.record %systemup.format
  }
  if ((%mircup.seconds.record !isnum) || (%mircup.seconds.record < %mircup.seconds)) {
    set %mircup.seconds.record %mircup.seconds | set %mircup.format.record %mircup.format
  }
  if ((%serverup.seconds.record !isnum) || (%serverup.seconds.record < %serverup.seconds)) {
    set %serverup.seconds.record %serverup.seconds | set %serverup.format.record %serverup.format
  }
}
on *:DISCONNECT:{
  var %systemup.seconds = $uptime(system,3)
  var %mircup.seconds = $uptime(mirc,3)
  var %serverup.seconds = $uptime(server,3)
  var %systemup.format = $uptime(system,1)
  var %mircup.format = $uptime(mirc,1)
  var %serverup.format = $uptime(server,1)
  if ((%systemup.seconds.record !isnum) || (%systemup.seconds.record < %systemup.seconds)) {
    set %systemup.seconds.record %systemup.seconds | set %systemup.format.record %systemup.format
  }
  if ((%mircup.seconds.record !isnum) || (%mircup.seconds.record < %mircup.seconds)) {
    set %mircup.seconds.record %mircup.seconds | set %mircup.format.record %mircup.format
  }
  if ((%serverup.seconds.record !isnum) || (%serverup.seconds.record < %serverup.seconds)) {
    set %serverup.seconds.record %serverup.seconds | set %serverup.format.record %serverup.format
  }
}

Comments

  (4)  RSS
sunslayer
Comments: 267
 
mIRC Snippet:  System, mIRC, and Connection Uptime Recorde
Posted on Jun 23, 2009 1:42 am
use /msg # instead of /say and maybe put some of them together so its less spammy

also in the disconnect event y save the mIRC uptime? maybe add an exit event for that instead
TheImrac
Comments: 64
 
mIRC Snippet:  System, mIRC, and Connection Uptime Recorde
Posted on Jun 23, 2009 5:04 am
A few pointers, Use an alias instead of having 3 copies of all the uptime checking code. Second instead of saving a formatted time, you can just use $duration identifier when you msg the channel. Third, there is no need to check to see if the record variable is a number then check if its greater than. The <,>,<=,>= operators only pop true if they are numbers. So Something like:
Code:
alias  uptime_update {
  If (%uptime_s !> $uptime(system,3)) set %uptime_s $v2
  If (%uptime_m !> $uptime(mirc,3)) set %uptime_m $v2
  If (%uptime_sv !> $uptime(server,3)) set %uptime_sv $f2
}
on *:DISCONNECT:{ uptime_update }
on *:EXIT:{ uptime_update }
alias uptime {
  uptime_update
  say System Uptime: $uptime(system,1) (Record: $duration(%uptime_s,1) $+ ), Mirc: $uptime(mirc,1) ( $+ $duration(%uptime_m,1) $+ ), Connection: $uptime(server,1) ( $+ $duration(%uptime_sv,1) $+ )
}


Sunslayer, /say is perfectly valid in this case. He is using it in an alias, so one would assume he will type /update to send the info to and this could be in a PM. all say is, is /msg $active.
HexOxide
Comments: 2
 
mIRC Snippet:  System, mIRC, and Connection Uptime Recorde
Posted on Jun 25, 2009 9:56 pm
Thanks, actually before I posted it I tried creating an uptime_update alias similar to the one you have there, but the alias just wouldn't work at the time and I couldn't figure it out at all, so I gave up and posted it as it is, but I will try again.

Cheers
HexOxide
Comments: 2
 
mIRC Snippet:  System, mIRC, and Connection Uptime Recorde
Posted on Jun 25, 2009 10:13 pm
OK, so now I have:

Code:

alias uptime_update {
  If (%systemup.record !> $uptime(system,3)) set %systemup.record $v2
  If (%mircup.record !> $uptime(mirc,3)) set %mircup.record $v2
  If (%serverup.record !> $uptime(server,3)) set %serverup.record $v2
}
on *:DISCONNECT:{ uptime_update }
on *:EXIT:{ uptime_update }
alias uptime {
  uptime_update
  say System Uptime: $uptime(system,1) Record: $duration(%systemup.record,1)
  say mIRC Uptime: $uptime(mirc,1) Record: $duration(%mircup.record,1)
  say Server Uptime: $uptime(server,1) Record: $duration(%serverup.record,1)
}


And it's still not working, the uptime_update alias is being run, but it's not setting the variables?

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom