mIRC Home    About    Download    Register    News    Help

Print Thread
#187217 01/10/07 04:38 PM
Joined: Jul 2004
Posts: 59
L
Babel fish
OP Offline
Babel fish
L
Joined: Jul 2004
Posts: 59
I am trying to write a script that will tell someone when the last time they did a Script settings backup Everything works great but I would like to be able to take the HRS section below and get the Days and hours when the hours go over 24 but are less then 7 days. can anyone help?

timecheck {
;Check to see if there has ever been a backup done
!if ($isdir(c:\circcbak)) {
;Check when last backup was done
Set %backup_calc $calc($ctime - $rgc_settingsR(Backup, date))
;Backup Should be done at least every 15 days.
if (%backup_calc > 12962000) {
backup_check
}
;Was it hours ago
elseif (%backup_calc > 3600) {
echo -a your settings where last backed up $round($calc(%backup_calc / 3600),1) hrs ago | Return
}
;was it only min ago
else echo -a your settings where last backed up $round($calc(%backup_calc / 60),1) min ago | Return
}
else backup_check
}

Last edited by LittleJohn; 01/10/07 04:39 PM.
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Try echo -a your settings where last backed up $duration(value) ago | Return

Last edited by Lpfix5; 01/10/07 07:15 PM.

Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Besides using $duration, one thing to note... you don't need to use RETURN in those places. Everything following are ELSEs, so the RETURNs aren't necessary. They won't hurt anything, but aren't needed.


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard