mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
#96047 02/09/04 12:40 PM
Joined: Aug 2004
Posts: 101
D
Vogon poet
Offline
Vogon poet
D
Joined: Aug 2004
Posts: 101
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...)

Code:
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 }  


Maybe I wake up one day to notice that all my life was just a dream!
#96048 02/09/04 01:05 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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


Gone.
#96049 02/09/04 02:22 PM
Joined: Aug 2004
Posts: 101
D
Vogon poet
Offline
Vogon poet
D
Joined: Aug 2004
Posts: 101
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


Maybe I wake up one day to notice that all my life was just a dream!
#96050 02/09/04 02:54 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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


Gone.
#96051 03/09/04 03:04 AM
Joined: Aug 2004
Posts: 147
N
Vogon poet
Offline
Vogon poet
N
Joined: Aug 2004
Posts: 147
Quote:
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.

#96052 03/09/04 09:21 AM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
You forgot the urange alias :[/b])

Play pingpong laugh

on ^*:pong:echo -stc info2 Lag: $calc(($ticks - $2)*.001) $+ s | halt
on *:CONNECT:.timerlag $+ $cid 0 60 .raw ping $!ticks


#96053 03/09/04 10:11 AM
Joined: Aug 2004
Posts: 101
D
Vogon poet
Offline
Vogon poet
D
Joined: Aug 2004
Posts: 101
Darn... Sorry!
urange is an alias that constraints a variable in a range of values.
Code:
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...

Last edited by dr_Eamer; 03/09/04 10:16 AM.

Maybe I wake up one day to notice that all my life was just a dream!
#96054 03/09/04 06:47 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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.


Gone.
#96055 04/09/04 12:04 AM
Joined: Dec 2002
Posts: 2,985
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 2,985
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.

Page 2 of 2 1 2

Link Copied to Clipboard