mIRC Home    About    Download    Register    News    Help

Print Thread
#4717 03/01/03 01:36 PM
Joined: Dec 2002
Posts: 174
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Dec 2002
Posts: 174
im working on my away script and i almsot got it the way i want

but the problem is i cant use $ctime cause it brings up something that doesnt even make sense 1041600752 and i cant use the (hh:nn:ss) for it cause it doesnt work for $ctime it

ill show you what ive been trying to do

//echo time is $calc(%test4now - $asctime(hh:nn:ss))

and of course when i go away /set %test4now $asctime(hh:nn:ss))

ive tried to use $duration

but the idea is to take the time now %test4now and calculate how long ive been away so the time that i came back represents by $asctime(hh:nn:ss)

im not sure what im doing wrong ive tried this a few different ways but its not coming out in any proper format.

#4718 03/01/03 01:51 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
$duration($awaytime) returns the amount of time you have been set as away for on the server, so you can either use that or:

In the set away alias add the command
set %setawayat $ctime
and in the set back alias add the command:
echo -a $duration($calc($ctime - %setawayat))

#4719 03/01/03 03:59 PM
Joined: Dec 2002
Posts: 174
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Dec 2002
Posts: 174
gerat that worked perfect

#4720 04/01/03 03:11 AM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
If you want your time to show up in 10:48 format, you can use this alias:
Code:

alias phtime {
  if ($1 < 3600) return $asctime($calc($timezone + $1),n:ss)
  elseif ($1 < 86400) return $asctime($calc($timezone + $1),H:nn:ss)
  else return $+($int($calc($1 /86400)),$asctime($calc($timezone + $1),:HH:nn:ss))
}

And then use $phtime($awaytime) in your script. The results will come back like this (values in red):
Code:

        [color:#840017]0:01[/color] == 1sec
        [color:#840017]1:59[/color] == 1min 59secs
       [color:#840017]59:59[/color] == 59mins 59secs
     [color:#840017]1:00:00[/color] == 1hr
    [color:#840017]13:45:59[/color] == 13hrs 45mins 59secs
  [color:#840017]1:23:59:59[/color] == 1day 23hrs 59mins 59secs
[color:#840017]157:23:59:59[/color] == 157days 23hrs 59mins 59secs 


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C

Link Copied to Clipboard