Hello, i wanna script of the ?checklag
i mean, if i write ?checklag so my bot saying "My currect lag is"
Example: My currect lag is 3002.90s
So somebady please can give me?
;Create alias that will notice us with $ticks
alias lagcheck {
; Tells the user we are checking his lag with whichever server he typed it on
echo -atg Checking ping with $server $+ ...
; Set a variable to the time we ran this command
set -u300 %ping. $+ $ticks $ticks
; Notice ourself
.notice $me ping $ticks
}
; Receive our notice
on ^*:NOTICE:ping &:?: {
; make sure this notice is our script
if $nick == $me && %ping. [ $+ [ $2 ] ] {
; keep us from seeing our notice
haltdef
; calculate our lag with the server
echo -atg Current ping with $server $+ : $calc($ticks - $2) miliseconds.
; cleanup
unset %ping. $+ $2
}
}
; First we create an alias lagcheck, that sends out a "PING :lag <ticks>" to the server.
alias lagcheck {
.quote PING :lag $ticks
}
; Second we create an on PONG event, to catch the reply and halt the default output.
; The difference between $ticks and the returned value is the response time in milliseconds.
; Echo this to the status window and halt the default output.
on ^*:PONG:{
if ($2 == lag) && ($3 isnum) {
echo -s Response time: $calc($ticks - $3) ms
haltdef
}
}
on *:text:?checklag:#:{
notice $me LAG $chan $ticks
}
on *:notice:*:?:{
if ($nick == $me) && ($1 == LAG) {
var %ex = $ticks $+ - $+ $3
var %lag = $calc(%ex)
msg $2 My currect Lag is: %lag MS
}
}
Users browsing this forum: No registered users and 2 guests