This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Check Lag TCL

Old posts that have not been replied to for several years.
Locked
l
lilGTO
Voice
Posts: 22
Joined: Tue Aug 24, 2004 2:59 pm
Contact:

Check Lag TCL

Post by lilGTO »

I was wondering what i could change in the tcl script mettwursts_lagcheck_v1.8.tcl that shows me the lag in ms....

What i want is the time in seconds... here is the line that converts the lag to ms.....

putmsg $::lagchan "\273\273 Current Networklag: [expr (([clock clicks] - $::lag)/2)/1000.] ms"

Thanks for the help,
lilGTO
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Code: Select all

putmsg $::lagchan "\273\273 Current Networklag: [expr (([clock clicks] - $::lag)/2)/100.] s" 
Dunno if it works, go test it
l
lilGTO
Voice
Posts: 22
Joined: Tue Aug 24, 2004 2:59 pm
Contact:

thats ok....

Post by lilGTO »

hmmmm thats good... but i was thinking more along the lines of 1m47s... users get really confused sometimes...
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

lilGTO wrote:hmmmm thats good... but i was thinking more along the lines of 1m47s... users get really confused sometimes...
If the output is 1m47s:
You can split the string from "m" and then make two seperate variables out of it one for '1 minute' and the other for '47 seconds'. In the 47s you will need to trimright the "s".

Then you can give and output of both variables joining them together with
somelike I use "[$var1] min and [$var2] secs." or "[$var1].[$var2] mins/secs"

Which will give the results:
Your ping reply is 1 min and 47 seconds. -or-
Your ping reply is 1.47 mins/secs.

There is a script by eggping.tcl by Souperman which does the same and you can find it on www.egghelp.org. It's name is eggping.tcl which gives replies in milliseconds.

Side note: You need to atleast have TCL 8.3 or greater to get replies in milliseconds. :mrgreen:
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Locked