I think it could be nice to have a lag meter somewhere where it is always visible in mIRC. I know you can ping someone and what you get is the lag in seconds. But a bar that shows the lag to the server could be nice.
Personally, I think they are so easily available at scripting websites that it's unnecessary for mIRC to have this incorporated. There are four listed
here. You might also want to search
Google.
Regards,
I think this is a wonderful idea. Not everyone wants to figure out how to load a script with backdoors.
Hello zack.
A "lag detector" is not the most ideal script in the world. Not only is is fairly pointless (from the stand point of you should be chatting when you have your client on, and can tell what your lag is by doing so), but is also an extreme strain on the server. Think of the 100's of thousands of people on a server, all with a ping script. Individualaly, it's only, what, something like 100bytes. Now multiply that by each user. Now again, by every 30 seconds, 45 seconds, minute, or even every 5 minutes.
Look at a simple 500 person server:
100bytes -> 1 ping
* 500 users -> 50,000bytes (= 48.82Kb)
* once per minute (for an hour) -> 2929.68Kb (= 2.86Mb)
* 24 for one day -> 68.66Mb
* 30 days (avg month) -> 2059.93Mb (= 2.01Gb)
That's 2 gigs of bandwidth a month just because someone wants to have a neat little statistic built into their client. Personally, if you want your ping time, get it as needed. Could be a popup, an alias, or whatever. You don't need to make a nice gui bar graph or line graph or even progress bar just because you want to leave your mIRC running while you play a game or go out for dinner.
Why would you want to send 100 bytes?
That's like 20 bytes.
Hmm. I wonder... could the "ping? pong!" event be somehow utilised for the lag bar? Does the server always ping at a set amount of time?
If mIRC kept track of the server pings and timed how long there was between each one, couldn't some kind of lag time be deduced form that?
Sure it's crude, but it doesn't eat up the server's bandwidth any more than normal mIRC usage.
Edited: for grammar reasons
You're only counting one direction.. I suspect KingTomato is thinking of there and back again, which for me produced a total length of 123 bytes (excluding cr/lfs).
//raw ping $ticks tends to use less bandwidth, for what it's worth.
I was actually calculating the following:
ping <server> (Estimating server to be 15 characters)
pong <server> <nick> (nick about 9 characters)
Now we're at 30 characters * 2 = 60, plus packet header info. (20 bytes each packet)
then 20 just for s&g's
We're at 100.
in reply to Collective
That wouldn't work if you were using a bouncer.
In case of the //notice $me $ticks, what do you get?
From mIRC help:
$ticks
Returns the number of ticks since your operating system was first started.
What does this have to do with LAG?
When you get the reply, you subtract current ticks from the number you sent previously, and get the "lag". Ex:
//notice $me $ticks
on $*:NOTICE:/([0-9]+)/:*: {
if ($nick == $me) /echo Lag: $calc($ticks - $1)
}
when i do
and have
on $*:NOTICE:*:*: {
if ($nick == $me) /echo Lag: $calc($ticks - $1)
}
in a clean mIRC 6.16 it doesn't work.
You're doing something wrong...
Are remotes on?
Are you connected to a server?
No error messages of any kind?
Is it a completely clean mIRC for sure or is there another on notice above this one in the remotes file?
Just speculations...
Apart from the code being simple and straightforward, I c/p'ed the code and it works like a charm (mIRC 6.16)!
remotes are on, I'm connected to Quakenet, I don't see any error message by doing this, it's in a clean mIRC 6.16
But the result is shown in the server window and not in the channel window where I typed it, so it works...
shame on me, thanx for finding solutions for a problem that was in reality not there.
No worries!
Be cool!
on me:*:NOTICE:*:*: {
echo Lag: $calc($ticks - $1)
}
much better
I suppose this result is in milliseconds?
You suppose correctly. :[/b])
That's not better at all. Now the code doesn't make any distinction between a notice with ticks and whatever other notice you send yourself.
Greets
Here's the one I use:
(it's quite old and I haven't checked back at it for a looooong time. The output is really simple...)
ctcp ^*:LAG:?:{
if $nick == $me {
set %delay [ $+ [ $cid ] ] $round( $calc( ( $ticks - $2 ) / 1000 ) , 2 )
;[color:grey]The following line simply calculates the time till the next count depending on your awaystatus and you current lag:
;You might as well ignore it and set %newlag to a fixed amount of seconds
var %newlag = $calc( $iif(%awaynick [ $+ [ $cid ] ],1,0) * 20 * 60 + ( 10 - $urange(0,%delay [ $+ [ $cid ] ],8) ) * 30 )[/color]
.timernextlagcount $+ $cid 1 %newlag lagcount $cid
echo $color(info2) -st Lag: $+ $iif(%delay [ $+ [ $cid ] ] == 1,1sec,%delay [ $+ [ $cid ] ] $+ secs) $+ (Next at: $+ $asctime($calc($ctime + %newlag), HH:nn:ss) $+ )
halt
}
}
on *:CONNECT:{ .timerconnectlag $+ $cid 1 2 lagcount $cid }
on *:DISCONNECT:{ unset %delay [ $+ [ $cid ] ] }
alias lagcount { scid $iif($1 isnum,$1,$cid) | .ctcp $me LAG $ticks }
I assume you wanted to reply to the original requester?
Note that when you click on reply, it will actually reply to that specific person.
Greets
Ok you're right I'm sorry, it's more of a general post in the thread. Is it that bad it was posted as a reply to you?
In any case it contains a reply to what you said as the ctcp remote checks for self ctcps starting with the word LAG, thus minimizing the chances of catching a wrong self-ctcp message. This control can be made even stricter but then again why should anyone send a ctcp like this to himself?
Sorry once again if it bothered you.
Be well
Hi,
my original reply was to nalAAlan, who only used an on NOTICE event, not a ctcp.
Anyway, don't worry, I didn't mean to be offending, but I've seen quite a few people recently, who seem to keep replying to the wrong people, which I find rather confusing and awkward.
All is good,
Cya
That's not better at all. Now the code doesn't make any distinction between a notice with ticks and whatever other notice you send yourself.
So I suppose you send lots of notices to yourself, and pmsgs also. There is nothing like talking to yourself, I do it all the time.
You forgot the
urange alias :[/b])
Play pingpong
on ^*:pong:echo -stc info2 Lag: $calc(($ticks - $2)*.001) $+ s | halt
on *:CONNECT:.timerlag $+ $cid 0 60 .raw ping $!ticks
Darn... Sorry!
urange is an alias that constraints a variable in a range of values.
alias urange { if $$1 > $$2 { return $$1 } | if $$2 > $$3 { return $$3 } | return $$2 }
It was in another script file cause I use it here and there.
Edit: echo -c is cool! I hadn't noticed it I admit...
You are missing the point.
Whether you send notices to yourself or not, you should always make sure your code doesn't contain holes in it, and yours does, because it assumes that ANY notice you send yourself, will be one that sends a $ticks.
Your argument is based on what a regular user will never do (/notice anything else but a $ticks to himself), but that assumption is weak. People do the weirdest things that one would never expect, and that can involve sending yourself notices. Which is exactly why I said what I said, that it would be wiser to make a distinction.
I've coded a role playing game, and it is amazing how many unexpected and unforeseen things people perform when playing the bot. The most bugs that my bot suffered from, were those that arose in unusual situations, and it is those situations that you should foresee.
Good day.
You are connected to Quakenet? Do you think the owners of that network would be impressed with all 150,000 users sending un-necessary bytes to the server often enough to get a satisfactory resolution from a lagmeter?
I have a scripted one and I set the request/reply frequency to a fairly 'friendly' level but because this can be abused to the point where a server can be laboured by thousands of people with inappropriate settings I feel this function should not become part of mIRC itself.