mIRC Home    About    Download    Register    News    Help

Print Thread
#225158 26/08/10 07:38 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
how would be the best way to calc my uptime? with calc i mean i want to add my uptime to a *.ini file, then return the value + my uptime, if current match the uptime in the ini file i want it to show my current uptme, i get som strange behavior, it add time to the uptime even due it's the same..
Code:
//writeini -n file.ini test onlinetime $uptime

alias test {
 var (%x = $readini(file,test,onlinetime)}
 var %y = $uptime
 if (%y = %x) { var %x = 0 } 
 echo -a $duration{%y + %x)
}

any good ideas on how to do this? i dont want to use mirc's own online timer..


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Jan 2009
Posts: 116
Vogon poet
Offline
Vogon poet
Joined: Jan 2009
Posts: 116
You have quite a few things wrong in that code. Same code, with the syntax errors removed:

Code:
alias test {
    var %x $readini(file.ini, test, onlinetime)
    var %y $uptime
    if (%y == %x) {
        var %x 0
    }
    echo -a $duration($calc(%y + %x))
}


http://zowb.net

/server -m irc.p2p-network.net -j #zomgwtfbbq
(ssl on port 6697 and 7000)
Joined: Aug 2010
Posts: 134
T
Vogon poet
Offline
Vogon poet
T
Joined: Aug 2010
Posts: 134
EDIT: Knoeki beat me to it. Just use his code wink

Last edited by Thels; 26/08/10 08:37 PM.

Learning something new every day.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Alternative suggestion
Code:
alias test {
  echo -a $iif($uptime = $readini(file.ini, test, onlinetime),$v1,$calc($v1 + $v2))
  }
}



Link Copied to Clipboard