Sephiroth
http://sephiroth.scifi-action.de/board/

/evaltime
http://sephiroth.scifi-action.de/board/viewtopic.php?f=4&t=75
Seite 1 von 1

Autor:  Sephiroth [ 7. Juni 2008 16:45 ]
Betreff des Beitrags:  /evaltime

Be very careful if you wanna use that snippet with an alias that /notices or /msgs someone!
; Outputs you how long your custom identifier needs to return the result
; /evaltime [how often] <identifier>
; well it's not perfect but it helps optimizing scripts :P
alias evaltime {
  if ($1) {
    var %t = $iif($1 isnum,$1,1000),%x = %t,%ticks = $ticks,%str = $iif($1 isnum,$2-,$1-)
    while (%x) { editbox -a * %x evaluations left of $qt(%str) - Time gone: $calc($ticks - %ticks) ms | var %s = $(%str,2) | dec %x }
    editbox -a /evaltime $iif($1 isnum,$1) %str
    echo $color(info) -ag * Evaluating $+(",$chr(3),$color(action).dd,$chr(2),%str,$chr(15)," - %t times: $calc(($ticks - %ticks) / %t),ms/evaluating)
  }
  else { echo $color(info) -ag * Error: /evaltime [N] <identifier> }
}

Seite 1 von 1 Alle Zeiten sind UTC + 1 Stunde
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/