; **/ ; * Shows the uptime ; * ; * @author Mohamed Mansour ; * @since 5/26/2006 ; * @build 1.0 ; */ on 1:EXIT:{ var %current_uptime = $duration($Tools.GetUptimeSystem()) if ( %current_uptime > %record_uptime ) { set %record_uptime %current_uptime set %record_uptime_date $ctime } else if ( !%record_uptime || !%record_uptime_date ) { set %record_uptime %current_uptime set %record_uptime_date $ctime } } ; **/ ; * Calculates the System Uptime Record ; */ alias Tools.getUptimeRecord { ;// Check if Variables are defined if (%record_uptime && %record_uptime_date ) { return $duration(%record_uptime) } else { return $Tools.GetUptimeSystem() } } ; **/ ; * Calculates the System Uptime ; */ alias Tools.getUptimeRecordDate { ;// Initialize the Text Variable var %txt ;// Lets check if the variables are defined if (%record_uptime && %record_uptime_date ) { %txt = %record_uptime_date } else { %txt = $ctime } ;// Return nicely formated time return $asctime(%txt,dddd mmmm doo yyyy) at $asctime(%txt,hh:nn tt) } ; **/ ; * Calculates the System Uptime ; */ alias Tools.GetUptimeSystem { return $uptime(system, 1) } ; **/ ; * Prints the Uptime ; */ alias Tools.Uptime { ;// Output String var %output = UPTIME: Current: %output = $+(%output, $Tools.GetUptimeSystem()) %output = $+(%output,  Record: $Tools.getUptimeRecord()) %output = $+(%output, $chr(32) set on $Tools.getUptimeRecordDate()) ;// Message out the buffer /MSG $active $1 } ;// ### Menu menu query,channel { - Total Space: /Tools.Uptime - }