mIRC Home    About    Download    Register    News    Help

Print Thread
whois time online #127572 14/08/05 08:05 PM
Joined: Feb 2005
Posts: 344
B
Bullseye Offline OP
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Feb 2005
Posts: 344
Someone gave me a script for whois and I changed it a bit but I have trouble with the time online.
Here is the script:
Code:
 alias _whois {
  if (%whois.nick)  { 
    echo -ai25 # 5--------2<14whois2>5-------- | echo -ai25 # 14 5Nick14:2 $xwhois(nick) $+ %whois.nick $+ | echo -ai25 # 14 5Naam14:2 $xwhois(name) $+ %whois.wname | echo -ai25 # 14 5Hostmask14:2 $replace(%whois.uhost,@,@,-,-,.,.) $+ | echo -ai25 # 14 5Land14:2 $+ $ccode($gettok(%whois.ip,-1,46)) $+ 
    echo -ai25 # 14 5Kamers14:2 $xwhois(channels) $replace(%whois.chan,~,~,&,10&,@,4@2)
    if (%whois.serv) echo -ai25 # 14 5Server14:2 $xwhois(server) $replace($gettok(%whois.serv,1,32),.,.,-,-) 05(2 $+ $gettok(%whois.serv,2-,32) $+ 05) 
    if (%whois.sign) echo -ai25 # 14 5Aangemeld op14:2 $lower($asctime(%whois.sign,dddd dd mmm hh:nn:ss))
    if (%whois.idle) echo -ai25 # 14 5Tijd idle14:2 $xwhois(idle) $duration($gettok(%whois.idle,1,32)) 
    if (%whois.online) echo -ai25 # 14 5Tijd online14:2 $duration($calc($ctime - %whois.omline))
    if (%whois.regd) echo -ai25 # 14 5Geregistreerde Nicknaam14:4 $xwhois(register) $replace(%whois.regd,-,-)
    if (%whois.oper) echo -ai25 # 14 5Netwerk Functions14:2 $xwhois(oper) %whois.oper
    if (%whois.away) echo -ai25 # 14 5Weg14:2 $xwhois(away) %whois.away

    echo -ai25 # 5--------2<14einde whois2>5--------
  }
  unset %whois.*
}

alias -l ccode {
  if ($1 isnum) { return Numerical IP }
  if (XX isin $1) { return Masked Numerical IP }
  if ($readini data.ini Country $1 != $null) { return $readini data.ini Country $1 }
  else { return Onbekend }
}

Raw 301:*:{ if (%whois) %whois.away = $3- | halt }
Raw 307:*:{ if (%whois) %whois.regd = Ja | halt }
Raw 310:*:{ if (%whois) %whois.oper = $2- | halt }
Raw 311:*:{ %whois = 1 | %whois.nick = $2 | %whois.uhost = $3 $+ 5@2 $+ $4 | %whois.wname = $6- | %whois.ip = $4 | halt }
Raw 312:*:{ if (%whois) %whois.serv = $3- | halt }
Raw 313:*:{ if (%whois) %whois.oper = $5 $6 $7 $8 $9 | halt }
Raw 317:*:{ if (%whois) %whois.idle = $3- | %whois.sign = $4- | %whois.online = $4- | halt }
Raw 318:*:{ if (%whois) { _whois } | unset %whois | halt }
Raw 319:*:{ if (%whois) { unset %whois.chan | %whois.chan = $3- | halt } } 


Hope someone can find what i'm doing wrong.

Greetzz

Re: whois time online #127573 14/08/05 08:13 PM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
It's because you have a typo.

"%whois.omline" should be "%whois.online"


Gone.
Re: whois time online #127574 14/08/05 08:24 PM
Joined: Feb 2005
Posts: 344
B
Bullseye Offline OP
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Feb 2005
Posts: 344
oke sorry missed that .
But i still have the problem.
it gives a online time of 1858 weeks 7 hours 48 minutes and 35 secs.

Re: whois time online #127575 14/08/05 08:27 PM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
In the raw 317, the number stored in $4 is the $ctime value of when you signed on, which you can get with $asctime($4).
If you want to know how long you've been online, then it's a simple calculalation like:

$duration($calc($ctime - $4))

Btw, you are in fact doing a whois with the nickname paramter twice are you? Because if you do:

/whois <nickname> then it will not send you the raw 317. You specifically need to do:

/whois <nickname> <nickname>

I don't really get why you are using this variable approach, just put all the code in the raw events instead.


Gone.
Re: whois time online #127576 14/08/05 08:48 PM
Joined: Feb 2005
Posts: 344
B
Bullseye Offline OP
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Feb 2005
Posts: 344
the strangest thing happend.
I rebooted my computer and now the online time works.........
confused confused confused confused confused confused confused confused