|
Joined: Aug 2004
Posts: 101
Vogon poet
|
Vogon poet
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...) 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 }
|
|
|
|
Joined: Feb 2004
Posts: 2,013
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,013 |
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
|
|
|
|
Joined: Aug 2004
Posts: 101
Vogon poet
|
Vogon poet
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
|
|
|
|
Joined: Feb 2004
Posts: 2,013
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,013 |
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
|
|
|
|
Joined: Aug 2004
Posts: 142
Vogon poet
|
Vogon poet
Joined: Aug 2004
Posts: 142 |
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.
|
|
|
|
Iori
|
Iori
|
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
|
|
|
|
Joined: Aug 2004
Posts: 101
Vogon poet
|
Vogon poet
Joined: Aug 2004
Posts: 101 |
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...
Last edited by dr_Eamer; 03/09/04 10:16 AM.
|
|
|
|
Joined: Feb 2004
Posts: 2,013
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,013 |
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.
|
|
|
|
Joined: Dec 2002
Posts: 2,958
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,958 |
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.
|
|
|
|
|