mIRC Homepage
Posted By: Newbie Stopwatch Help - 19/12/14 11:28 PM
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
}
Posted By: Belhifet Re: Stopwatch Help - 20/12/14 12:19 AM
/help $ticks
Posted By: OrFeAsGr Re: Stopwatch Help - 02/02/15 01:56 AM
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-
Posted By: Raccoon Re: Stopwatch Help - 02/02/15 08:38 AM
We don't know what "total splits" are.
© mIRC Discussion Forums