Please - I need a script with ?checklag

Paste Your code(s) here, and state your problem.

Please - I need a script with ?checklag

Postby StareX » Tue Nov 18, 2008 11:14 am

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?
StareX
 

Re: Please | I need a script with ?checklag

Postby capurro » Tue Nov 18, 2008 11:21 am

Code: Select all
;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
  }
}




Code: Select all
; 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
  }
}
capurro
 

Re: Please | I need a script with ?checklag

Postby capurro » Sun Feb 01, 2009 6:20 am

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


:?:
capurro
 

Re: Please | I need a script with ?checklag

Postby StareX » Tue Feb 03, 2009 2:29 pm

man, i dont need it.....
I have one myself that i have created...
its ok...


Luckmob, you can close this topic :P
StareX
 


Return to Mirc Scripting Help

Who is online

Users browsing this forum: No registered users and 2 guests

cron