mIRC Home    About    Download    Register    News    Help

Print Thread
#249858 19/12/14 11:28 PM
Joined: Nov 2014
Posts: 79
N
Newbie Offline OP
Babel fish
OP Offline
Babel fish
N
Joined: Nov 2014
Posts: 79
Hi guys, I'm trying to make a stopwatch like code where I can get total splits which I can then place into a stopwatch. Is there any way we can get to milliseconds though? The farthest this will go is seconds.

on *:TEXT:!start:#: {
var %stopwatch Currentrun.ini
remini %stopwatch Start
var %Stime $ctime
var %Swatch 1
writeini %stopwatch Start %Stime 1
}

on *:TEXT:!split:#: {
var %stopwatch Currentrun.ini
var %Start $ini(%stopwatch,Start,1)
var %Sptime $ctime
var %Ttime $duration($calc(%Sptime - %Start),N)
var %Total $ini(%stopwatch,Boss,0)
var %Tt %Total + 1
writeini %stopwatch Boss %Tt %Ttime
var %Msg $readini(%stopwatch,Boss,%Tt)
msg # Split is %Msg from start
}

Last edited by Newbie; 19/12/14 11:28 PM.
Newbie #249860 20/12/14 12:19 AM
Joined: Jun 2014
Posts: 248
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Jun 2014
Posts: 248
/help $ticks

Newbie #250894 02/02/15 01:56 AM
Joined: Feb 2015
Posts: 243
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
You Can Get Miliseconds using $ticks
Here's 2 little aliases to see how it works
Code:
alias get_ms { set %mstart $ticks }
alias get_ms2 { set %msresult $calc($ticks - %mstart) | echo -at $calc(%msresult / 1000) }


Just Put These 2 aliases in a remote and then type /get_ms
wait for some random seconds and then type /get_ms2
You'll see that it will echo the miliseconds between /get_ms and /get_ms2
I think you'll then will be able to use it on your scripts smile

-OrFeAsGr-

OrFeAsGr #250900 02/02/15 08:38 AM
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
We don't know what "total splits" are.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!

Link Copied to Clipboard