Lag meter

0/5 (4 avis)

Snippet vu 7 552 fois - Téléchargée 27 fois

Contenu du snippet

C'est pas a moi je les trouver sur le web et il me plait bien alors je vous en fait profiter :)

Source / Exemple :


;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
;- Lagmeter for mIRC5.3-
;-by BizarrO-
;	          ---------<>---------
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
on 1:load: { 
  if $version < 5.3 { echo 4 -a *** Your mIRC version is not compatible with this addon. Please download mIRC5.3 or higher. | unload -rs lagmeter.mrc | halt }
  setvar lag 0.200 | setvar bground $rgb(100,100,100) | setvar text $rgb(180,180,180) | setvar meter $rgb(128,0,0)  
  setvar meterxpos 0 | setvar meterypos 0
  setvar checkevery 3
  setvar maxmeter 10
  setvar addavg 0 
  setvar worst 0.001
  setvar best 100.000
  setvar totaltimeschecked 0
  lagmeter
  echo 2 -s *** Lagmeter1.0 by BizarrO loaded
  halt
}

alias lagstat {
  return $readini lag.ini lag $1
}
alias setvar {
  writeini lag.ini lag $1 $2-
}
alias checklag { 
  if $lagstat(meterstatus) == closed { halt }  
  if $lagstat(meterstatus) == open { 
    raw -q whatsmylag | setvar sentat $calc($ticks / 1000)
  }
  if $lagstat(date) < $remove($adate,$chr(47)) || $right($lagstat(date),2) < $right($adate,2) {
    setvar date $remove($adate,$chr(47))
    setvar addavg 0 
    setvar worst $lagstat(lag) 
    setvar best $lagstat(lag) 
    setvar totaltimeschecked 0
  }
}
raw 421:*: {
  if ($2 == whatsmylag) {  
    if $lagstat(meterstatus) == open {
      setvar lag $calc($ticks / 1000 -  $lagstat(sentat))
      setvar totaltimeschecked $calc($lagstat(totaltimeschecked) + 1) 
      updatelagmeter | .timer7 1 $lagstat(checkevery) checklag
    }
    halt  
  }
}
alias lagmeter {
  window -p +b @Lagmeter 0 0 200 40 @Lagmeter | window -p +b @Lagmeter 0 0 200 40 @Lagmeter
  if $server == $null {
    drawtext @lagmeter 0 "times new roman" 15 0 0 You must be connected to a server...
    drawtext @lagmeter 0 "times new roman" 15 65 18 for the Lagmeter to work 
    halt
  } 
  setvar meterstatus open | setvar expandstats Open | setvar colorpicker Open
  if $lagstat(recordworst) == $null { setvar recordworst $lagstat(lag) }
  if $lagstat(recordbest) == $null { setvar recordbest $lagstat(lag) }
  if $lagstat(date) == $null { setvar date $remove($adate,$chr(47)) }
  checklag
}
alias updatelagmeter {
  if $lagstat(meterstatus) == open { 
    if $exists(lag.ini) == $false { lagmeter }
    if $lagstat(maxmeter) == $null { setvar maxmeter 10 }
    drawrect -rf @lagmeter $lagstat(bground) 1 0 0 200 40
    if $calc($lagstat(lag) / ($lagstat(maxmeter) / 200)) > 200 {  drawrect -rf @lagmeter $lagstat(meter) 1 0 1 200 22 } | else { drawrect -rf @lagmeter $lagstat(meter) 1 0 1 $calc($lagstat(lag) / ($lagstat(maxmeter) / 200)) 22 } 
    drawtext -ro @lagmeter $lagstat(text) "ms sans serif" 25 75 0 $lagstat(lag)  
    setvar addavg $calc($round($lagstat(addavg),3) + $lagstat(lag)) 
    setvar average $calc($lagstat(addavg) / $lagstat(totaltimeschecked))
    if $lagstat(lag) <= 0 { echo 2 -a ** $ustime lag is $lagstat(lag) ! | halt }
    if $lagstat(lag) < $lagstat(best) { setvar best $lagstat(lag) }
    if $lagstat(best) < $gettok($lagstat(recordbest),1,32) { setvar recordbest $lagstat(best)    $chr(40) $+ $remove($adate,$right($adate,3)) - $ustime $+ $chr(41) } 
    if $lagstat(lag) > $lagstat(worst) { setvar worst $lagstat(lag) }
    if $lagstat(worst) > $gettok($lagstat(recordworst),1,32) { setvar recordworst $lagstat(worst)    $chr(40) $+ $remove($adate,$right($adate,3)) - $ustime $+ $chr(41) } 

    drawtext -r @lagmeter $lagstat(text) "times new roman" 14 1 24 Worst: $round($lagstat(worst),3)
    drawtext -r @lagmeter $lagstat(text) "times new roman" 14 76 24 Best: $round($lagstat(best),3)
    drawtext -r @lagmeter $lagstat(text) "times new roman" 14 137 24 AVG: $round($lagstat(average),3)

    if $lagstat(expandstats) == Close { 
      drawrect -fr @lagmeter $lagstat(bground) 1 0 40 200 80   
      drawline -r @lagmeter $lagstat(meter) 1 0 38 200 38
      drawtext -r @lagmeter $lagstat(text) "times new roman" 14 1 38 Times Checked:    $lagstat(totaltimeschecked)
      drawtext -r @lagmeter $lagstat(text) "times new roman" 14 1 50 Checking Every:    $lagstat(checkevery) secs
      drawtext -r @lagmeter $lagstat(text) "times new roman" 14 1 63 Checking For:   $duration($calc(($lagstat(totaltimeschecked) * $lagstat(checkevery)) + $lagstat(lag)))
      drawtext -r @lagmeter $lagstat(text) "times new roman" 14 1 76 Record Best:  $lagstat(recordbest)
      drawtext -r @lagmeter $lagstat(text) "times new roman" 14 1 89 Record Worst:  $lagstat(recordworst)
    }
  }
  else { return }
}
alias slidemeterdown {
  %lag.slide = 41 
  :down
  inc %lag.slide 2
  window -p +b @Lagmeter $lagstat(meterxpos) $lagstat(meterypos) 200 %lag.slide
  if %lag.slide == 105 { setvar expandstats Close | unset %lag.slide | halt }
  goto down
}
alias slidemeterright {
  %lag.slide = 200
  :right
  inc %lag.slide 2
  window -p +b @Lagmeter $lagstat(meterxpos) $lagstat(meterypos) %lag.slide 105
  if %lag.slide == 240 { 
    drawrect -fr @lagmeter 1 1 200 0 45 110
    drawpic -c @lagmeter 200 0 $mircdirsystem\palette.jpg 
    drawrect -rf @Lagmeter $lagstat(bground) 1 226 8 10 20
    drawrect -rf @Lagmeter $lagstat(text) 1 226 42 10 20   
    drawrect -rf @Lagmeter $lagstat(meter) 1 226 75 10 20
    unset %lag.slide  
    setvar colorpicker Close | setvar expandstats Close  
    halt
  }
  goto right
}
alias slidemeterleft {
  %lag.slide = 240
  :left
  dec %lag.slide 2
  window -p +b @Lagmeter $lagstat(meterxpos) $lagstat(meterypos) %lag.slide 105
  if %lag.slide == 200 { unset %lag.slide | setvar colorpicker Open | halt }
  goto left
}
alias slidemeterup {
  setvar expandstats Open | setvar colorpicker Open
  updatelagmeter   
  %lag.slide = 104 
  :up
  dec %lag.slide 2
  if %lag.slide == 40 { unset %lag.slide | halt }
  window -p +b @Lagmeter $lagstat(meterxpos) $lagstat(meterypos) 200 %lag.slide
  goto up
}

alias lagmeterhelp { 
  window -p +bft @Lagmeter_Help 250 0 475 425 @laghelp
  drawrect -rf @lagmeter_help 13169919 1 0 0 480 430 
  drawpic -c @lagmeter_help 102 50 $mircdirsystem\helppic.jpg
  drawtext -o @lagmeter_help 1 "times new roman" 16 150 10 Lag Time
  drawline -i @lagmeter_help 1 1 173 25 192 55
  drawtext -o @lagmeter_help 1 "times new roman" 16 8 47 Lag Meter
  drawline -i @lagmeter_help 1 1 70 58 106 63
  drawtext -o @lagmeter_help 1 "times new roman" 16 273 10 Color Picker
  drawline -i @lagmeter_help 1 1 309 24 316 71
  drawtext -o @lagmeter_help 1 "times new roman" 16 360 40 Background
  drawtext -o @lagmeter_help 1 "times new roman" 16 375 55 Color
  drawline -i @lagmeter_help 1 1 369 59 332 67
  drawtext -o @lagmeter_help 1 "times new roman" 16 365 85 Text Color
  drawline -i @lagmeter_help 1 1 363 93 333 102
  drawtext -o @lagmeter_help 1 "times new roman" 16 366 118 Lag Meter
  drawtext -o @lagmeter_help 1 "times new roman" 16 376 131 Color
  drawline -i @lagmeter_help 1 1 372 134 333 137
  drawtext -o @lagmeter_help 1 "times new roman" 16 10 107 Expanded
  drawtext -o @lagmeter_help 1 "times new roman" 16 17 120 Stats
  drawline -i @lagmeter_help 1 1 95 90 87 90
  drawline -i @lagmeter_help 1 1 87 90 87 152
  drawline -i @lagmeter_help 1 1 87 152 95 152
  drawline -i @lagmeter_help 1 1 87 121 70 121

  drawtext -o @lagmeter_help 1 "times new roman" 16 5 180 $chr(149) Lag Time: Your current lag time in seconds.
  drawtext -o @lagmeter_help 1 "times new roman" 16 5 195 $chr(149) Lag Meter: Meter grows or shortens depending on your lag time.
  drawtext -o @lagmeter_help 1 "times new roman" 16 5 210 $chr(149) Worst:     Best:    AVG:    daily lag stats (resets each day)
  drawtext -o @lagmeter_help 1 "times new roman" 16 5 225 $chr(149) Expanded Stats:
  drawtext -o @lagmeter_help 1 "times new roman" 16 15 240 -Times Checked: How many times your lag time has been checked.
  drawtext -o @lagmeter_help 1 "times new roman" 16 15 255 -Checking Every: How often your lag is checked.
  drawtext -o @lagmeter_help 1 "times new roman" 16 15 270 -Checking For: How long your Lagmeter has been running since last reset.
  drawtext -o @lagmeter_help 1 "times new roman" 16 25 285 note: the 3 above stats only reset after each day.
  drawtext -o @lagmeter_help 1 "times new roman" 16 15 300 -Record Best: Your best lag time ever (never resets)
  drawtext -o @lagmeter_help 1 "times new roman" 16 15 315 -Record Worst: Your worst lag time ever (never resets)
  drawtext -o @lagmeter_help 1 "times new roman" 16 5 330 $chr(149) Color Picker: Changes the background,text, or meter color.
  drawtext -o @lagmeter_help 1 "times new roman" 16 15 345 note: you must click in the Background Color, Text Color, or Lag Meter box
  drawtext -o @lagmeter_help 1 "times new roman" 16 45 360 first then click on the color palette to change each one.
  drawtext -o @lagmeter_help 1 "times new roman" 16 45 375 When Color Picker is opened it automatically opens the Expanded Stats.
}
menu @laghelp {
  close:window -c $active
}
alias ustime { 
  if ($gettok($time,1,58) >= 13) { return $calc($gettok($time,1,58) - 12) $+ : $+ $gettok($time,2,58) $+ p }
  else if ($gettok($time,1,58) == 12) { return $gettok($time,1-2,58) $+ p }
  else if ($gettok($time,1,58) == 0) { return $calc($gettok($time,1,58) + 12) $+ : $+ $gettok($time,2,58) $+ a }
  else { return $gettok($time,1-2,58) $+ a }
}
menu @Lagmeter {
  dclick { 
    if $lagstat(expandstats) == Open { slidemeterdown } 
    if $lagstat(expandstats) == Close { slidemeterup }
  }
  sclick { 
    if $inrect($mouse.x,$mouse.y,227,8,10,15) == $true {
      set %lag.backon clicked | unset %lag.texton %lag.meteron
      drawrect @Lagmeter 16 1 227 9 8 18 
      drawrect -r @Lagmeter $lagstat(text) 1 227 43 8 18 
      drawrect -r @Lagmeter $lagstat(meter) 1 227 76 8 18
    }
    if $inrect($mouse.x,$mouse.y,227,42,10,15) == $true {
      set %lag.texton clicked | unset %lag.backon %lag.meteron 
      drawrect @Lagmeter 16 1 227 43 8 18  
      drawrect -r @Lagmeter $lagstat(bground) 1 227 9 8 18 
      drawrect -r @Lagmeter $lagstat(meter) 1 227 76 8 18 
    }
    if $inrect($mouse.x,$mouse.y,227,75,10,15) == $true { 
      set %lag.meteron clicked | unset %lag.backon %lag.texton 
      drawrect @Lagmeter 16 1 227 76 8 18 
      drawrect -r @Lagmeter $lagstat(bground) 1 227 9 8 18 
      drawrect -r @Lagmeter $lagstat(text) 1 227 43 8 18
    }
    if $inrect($mouse.x,$mouse.y,200,0,25,105) == $true { 
      if %lag.backon == clicked {
        setvar bground $getdot($active,$mouse.x,$mouse.y) 
        drawrect -rf @lagmeter $lagstat(bground) 1 226 8 10 20 
        drawrect @Lagmeter 16 1 227 9 8 18 
      }
      if %lag.texton == clicked { 
        setvar text $getdot($active,$mouse.x,$mouse.y) 
        drawrect -rf @lagmeter $lagstat(text) 1 226 42 10 20 
        drawrect @Lagmeter 16 1 227 43 8 18 
      }
      if %lag.meteron == clicked { 
        setvar meter $getdot($active,$mouse.x,$mouse.y) 
        drawrect -rf @lagmeter $lagstat(meter) 1 226 75 10 20 
        drawrect @Lagmeter 16 1 227 76 8 18
      }
    }  
    set %lag.mousex $mouse.x | set %lag.mousey $mouse.y  
  }
  mouse {
    if $mouse.key & 1 { 
      set -u1 %lag.winposx $window($active).x | set -u1 %lag.winposy $window($active).y
      window $active $calc(%lag.winposx + $mouse.x - %lag.mousex) $calc(%lag.winposy + $mouse.y - %lag.mousey) $window($active).w $window($active).h
      setvar meterxpos $calc(%lag.winposx + $mouse.x - %lag.mousex)  | setvar meterypos $calc(%lag.winposy + $mouse.y - %lag.mousey)
    }
    else { unset %lag.mousex %lag.mousey }
  }
  &Options  
  .Checking Lag Every $lagstat(checkevery) secs:setvar checkevery $$?="Choose how many seconds between lag checking"
  .Max. Length of Meter Bar[ $+ $lagstat(maxmeter) $+ ]:setvar maxmeter $$?="maximum MeterLength before it fills window" 
  .-
  .Save Current Settings: {
    write -c favlagsettings.txt 
    writeini lag.ini favorite background $lagstat(bground)
    writeini lag.ini favorite text $lagstat(text)
    writeini lag.ini favorite meter $lagstat(meter)
    writeini lag.ini favorite checkevery $lagstat(checkevery)
    writeini lag.ini favorite maxmeter $lagstat(maxmeter)
  }
  .Load Favorite Settings: { 
    setvar bground $readini lag.ini background 
    setvar text $readini lag.ini text  
    setvar meter $readini lag.ini meter 
    setvar checkevery $readini lag.ini checkevery
    setvar maxmeter $readini lag.ini maxmeter
  }
  .-
  .Reset Stats: {
    setvar addavg 0 
    setvar worst $lagstat(lag) 
    setvar best $lagstat(lag) 
    setvar totaltimeschecked 0 
  }
  $lagstat(expandstats) &Expanded Stats:if $lagstat(expandstats) == Open { slidemeterdown } | if $lagstat(expandstats) == Close { slidemeterup }
  $lagstat(colorpicker) ColorPicker: {
    if $lagstat(colorpicker) == Open { 
      setvar colorpicker Close 
      if $lagstat(expandstats) == Open { setvar expandstats Close }
      slidemeterright    
    }
    if $lagstat(colorpicker) == Close {
      setvar colorpicker Open 
      slidemeterleft
    }
    if $lagstat(colorpicker) == $null { setvar colorpicker Open }
  } 
  -
  &Help:lagmeterhelp
  E&xit $chr(160) $chr(58) $+ $chr(40) : { 
    setvar meterstatus closed
    window -c @Lagmeter
  }
}
on 1:close:@: { if $target == @Lagmeter { setvar meterstatus closed | .timer7 off | checklag } }

A voir également

Ajouter un commentaire Commentaires
Messages postés
24
Date d'inscription
samedi 13 mai 2006
Statut
Membre
Dernière intervention
31 mai 2007

" je me suis deconect et apres impossible de Revoir Lagmeter . "
normal CANARD2Wc, le lag est le temps entre le moment ou tu tape sur entré et le moment ou ton message aparait dc pour le calculer il faut ke tu soit conecté ;-)
enfin sinon vous faite chier av vos rip... si un auteur publi ses sources c'est bien pour ke les gens s'en servent non??? ralalala vous devriez réfléchir avt de parler...
++
Messages postés
13
Date d'inscription
dimanche 25 mai 2003
Statut
Membre
Dernière intervention
26 août 2003

salut vous pouvez m'aider svp il y a kelquechose que je ne comprend pas La premiere fois sa a bien marcher le lagmeter mais je me suis deconect et apres impossible de Revoir Lagmeter . Voila Mon pb ,merci de m'aider
Messages postés
261
Date d'inscription
dimanche 6 avril 2003
Statut
Membre
Dernière intervention
12 janvier 2010

Arround , avant de déposer un commentaire , lit ce qu il a mit.
C'est pas a moi je les trouver sur le web et il me plait bien alors je vous en fait profiter :) >>> voila se qu il a mit.
Il l'a dit lui meme que c était pas a lui.
Messages postés
39
Date d'inscription
lundi 4 novembre 2002
Statut
Membre
Dernière intervention
22 septembre 2004

rippé...

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.