mIRC Home    About    Download    Register    News    Help

Print Thread
#143739 28/02/06 01:25 PM
Joined: Feb 2006
Posts: 1
D
deka Offline OP
Mostly harmless
OP Offline
Mostly harmless
D
Joined: Feb 2006
Posts: 1
; fix time: this identifier will convert the yucky 24h times into 12h times. usage: $fxtime(15:00:00), output: 3:00:00pm
alias fxtime return $calc($iif($gettok($1,1,58) > 12,$calc($gettok($1,1,58) -12),$replace($gettok($1,1,58),00,12))+0) $+ : $+ $gettok($1,2-,58) $+ $iif($gettok($1,1,58) > 11,pm,am)

; fix full time: this identifier will convert long and ugly dates into a more understandable format. usage: $fxftime(Mon 02/20/2001 15:00:00), output: 3:00:00pm Monday, February 20th, 2001
alias fxftime tokenize 32 $round($1,0) | return $asctime($1,h:nn:sstt dddd) $+ , $asctime($1,mmmm) $ord($asctime($1,d)) $+ , $asctime($1,yyyy)

; sets your offset for chanserv expiration calcuations, since chanserv doesnt tell us what time it is.
on *:load:set %exp3.os $time(zz)

on *:notice:*:?:{
; checks if its dalnet services we're dealing with, you can change this if youre sure the services youre working with have the same output time format.
if ($fulladdress = NickServ!service@dal.net) {
; sets the ctime of the last seen time to %exp3.lst, with the time localized (your gmt offset added/subtracted). then it sets the expiration ctime to %exp3.lst
if ($1-3 = last seen time) { %exp3.lst = $calc($ctime($gettok($instok($6-7,$gettok($6,1,47),3,47),2-,47)) +(($time(z)*60*60*24) + $iif($daylight,3600,0))) | %exp3.xpt = $calc(%exp3.lst +2592000) | return }
; sets the ctime of the time services see it as now to %exp3.tn to avoid clock desync miscalculations, also sets the offset to %exp3.os for future usage with chanserv. also calculates how long until the expiration time.
; NOTE: it's a good idea to periodically use /ns info just to keep the proper offset in order to get the best results out of chanserv expire times.
if ($1-2 = time now) { %exp3.tn = $calc($ctime($gettok($instok($5-6,$gettok($5,1,47),3,47),2-,47)) +(($time(z)*60*60*24) + $iif($daylight,3600,0)))
%exp3.xptl = $calc(%exp3.xpt - %exp3.tn)
%exp3.dxptl = [ [ %exp3.xptl ] ] $ctime
%exp3.os = $calc(%exp3.tn - $ctime)
.echo $colour(notice) -a $timestamp -NickServ- Expires on : $asctime(%exp3.xpt, ddd mm/dd/yyyy HH:nn:ss) [local time]
.echo $colour(notice) -a $timestamp -NickServ- Expires in : $iif(%exp3.xptl,$iif(%exp3.xptl < 0,*** past expirey time by $duration($abs(%exp3.xptl)),$duration(%exp3.xptl)),NOW!) | return
}
}
; again, checks to see if this is dalnet services. feel free to modify if the time format is the same.
if ($fulladdress = ChanServ!service@dal.net) {
; sets the last opping ctime to %exp3.lo, with the time localized. and since chanserv doesnt tell us what time it is, we go ahead and calculate the expiration using the stored offset
if ($1-2 = last opping:) { %exp3.lo = $calc($ctime($gettok($instok($4-5,$gettok($4,1,47),3,47),2-,47)) +(($time(z)*60*60*24) + $iif($daylight,3600,0)) + %exp3.os)
%exp3.xpt = $calc(%exp3.lo +2592000) | %exp3.xptl = $calc(%exp3.xpt -$ctime + %exp3.os)
.echo $colour(notice) -a $timestamp -ChanServ- Expires on : $asctime(%exp3.xpt, ddd mm/dd/yyyy HH:nn:ss) [local time]
.echo $colour(notice) -a $timestamp -ChanServ- Expires in : $iif(%exp3.xptl,$iif(%exp3.xptl < 0,*** past expirey time by $duration($abs(%exp3.xptl)),$duration(%exp3.xptl)),NOW!) | return
}
}
}
Plz help me to fix time bug..

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
You have to actually tell us what the problem is before we can help you.

-genius_at_work

Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
And pasting the code again, within a code box, would be helpful.


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby

Link Copied to Clipboard