_MM_IKKE

[mIRC] Performance Test Debug

Jan 8th, 2012
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.11 KB | None | 0 0
  1. /*
  2. THIS SCRIPT HAS BEEN MADE BY [MM]IKKE
  3. DO NOT DELETE ANY OF THESE CREDITS
  4.  
  5. SCRIPT WILL STILL ECHO ALL THE STUFF! HAVING A MESSAGE IN THE SPECIFIED COMMAND CAN CAUSE A MASSIVE FLOOD
  6. */
  7.  
  8. /performance {
  9. ;Syntax: /performance <amount of seconds> <command> <parameters>
  10.   if ($1 isnum) {
  11.     if ($2) {
  12.     ;twice an error check: syntax must be right
  13.       set %start.tmp $ticks
  14.       ;sets the starting time in ticks
  15.       var %i = 1
  16.       while (%i <= $1) {
  17.         $2-
  18.         inc %i
  19.       }
  20.       ;loops the command a specific amount of times
  21.       set %stop.tmp $ticks
  22.       ;sets the stop time in ticks
  23.       echo 2 -at Passed time to run " $+ $2- $+ " $1 times: $calc(%stop.tmp - %start.tmp)
  24.       ;echoes the amount of time passed in ticks.
  25.       unset %start.tmp
  26.       unset %stop.tmp
  27.       ;clears the variables used. I know I could use "var %start = $ticks", but I dislike the usage of that. it's easier to debug when using globals in mIRC, except for loops
  28.     }
  29.     else {
  30.       echo 4 -at ERROR: 1Specify a command
  31.     }
  32.   }
  33.   else {
  34.     echo 4 -at ERROR: 1Specify an amount of loops
  35.   }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment