mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2015
Posts: 42
A
Artiiz Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Apr 2015
Posts: 42
Hello,

I'm using this script for countdown at my own channel:

Code:
alias todate {
  var %month = 09
  var %day = 09
  var %year = 2015

  var %todate = $calc($ctime($+(%day,-,%month,-,%year) 14:00) - $ctime)
  if (%todate < 0) {
    inc %year
    %todate = $calc($ctime($+(%day,-,%month,-,%year) 14:00) - $ctime)
  }
  return %todate
}
on 1:TEXT:!stream:#artiiz:{
  msg $chan @ $+ $nick Live in $duration($todate($2,$3)) $+
}


Is it possible to remove the seconds from the script, and if so, how?


Joined: Sep 2015
Posts: 18
R
Pikka bird
Offline
Pikka bird
R
Joined: Sep 2015
Posts: 18
do you mean the format. so do you want to change it to hours or something. If so I think you have to stick with seconds


Code:
 $I.am.REDxPHOEN 

Code:
 $I.am.THE.one.AND.only 

Code:
 $I.am.THE.best 
Joined: Apr 2015
Posts: 42
A
Artiiz Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Apr 2015
Posts: 42
Originally Posted By: REDxPHOEN
do you mean the format. so do you want to change it to hours or something. If so I think you have to stick with seconds


I want to remove the "secs", and go with only hrs and mins smile

Joined: Sep 2015
Posts: 18
R
Pikka bird
Offline
Pikka bird
R
Joined: Sep 2015
Posts: 18
I don't think you can. If you don't know what the time is in secs use google. It has a built in converter or you could make a bot that converts secs to mins


Code:
 $I.am.REDxPHOEN 

Code:
 $I.am.THE.one.AND.only 

Code:
 $I.am.THE.best 
Joined: Apr 2015
Posts: 42
A
Artiiz Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Apr 2015
Posts: 42
Ahh okey, I'll just go with secs too :P

Thanks anyway smile

Joined: Jan 2005
Posts: 192
Vogon poet
Offline
Vogon poet
Joined: Jan 2005
Posts: 192
You can use $duration(seconds,N) Where if N is 2 then the seconds are not included in the output.
For more info see /help $duration
Code:
on 1:TEXT:!stream:#artiiz:{
  msg $chan @ $+ $nick Live in $duration($todate($2,$3),2)
}


echo -a $signature

Link Copied to Clipboard