mIRC Home    About    Download    Register    News    Help

Print Thread
#48401 10/09/03 10:01 AM
Joined: Dec 2002
Posts: 397
A
ATMA Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Dec 2002
Posts: 397
any one know where to get me started on a lag graph? i really dont want to rip some one elses code... so i was wondering if any one knew were i could find a tutorial..


Need amazing web design for low price: http://www.matrixn3t.net
#48402 10/09/03 01:34 PM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
Well, you need to define for yourself what you mean. How exactly do you define lag? Lag to yourself (??), to the server you are on, the average to several servers, and if so, which or all, to a specific user in your channel, or to an average of all.

Then you need to find a way to detect such lag. Are you going to take a standard ping reply, or send a command to a server and see how long it takes to get a response.

Assuming you have found your lag and have a single count in seconds, I assume with "graph" you mean some kind of progress bar. You can display just the bar, or display the entire range, with the bar colored differently from the range. Next decision is which characters you will use for such a bar. Some people use |, others insert a background-colored space, or even a dialog window.

Almost done on the decision making, you have to translate the lagtime to your bar. Are you gonna have it display absolute seconds (add one | for each second), or a procentual display (in which case: what is 100%?)

After you have made all these decisions for yourself, you can start writing the code. Don't be afraid to change a decision along the way if it isn't feasible, and be prepared for a lot of debugging and errorfinding.


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#48403 10/09/03 07:53 PM
Joined: Dec 2002
Posts: 397
A
ATMA Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Dec 2002
Posts: 397
ok so far all i have is a simple lag finder all i need to do is figur out how to make it graph it -.-

alias /ping { .ping $$1 | .set %ping.ticks $ticks }
on *:PONG: {
var %ping.difference = $ticks - %ping.ticks
var %ping.final $calc(%ping.difference / 1000)
echo -a Ping Reply: %ping.final Sec.
unset %ping.*
}


Need amazing web design for low price: http://www.matrixn3t.net
#48404 11/09/03 04:01 AM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
add
Code:
echo -a $str[|,$str(%ping.final))


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius

Link Copied to Clipboard