Benchmark Dialog — File Browser

BenchmarkDialogv1.0 / BenchmarkDialogv1.0 / benchmark.mrc

benchmark.mrc — 5.06 KB — Download this file

; Dialog benchmark by Sigh_
; Extract the files to a folder of your choice with WinZip
; In mIRC type /load -rs C:\path...\benchmark.mrc

dialog benchmark {
  title "Benchmark"
  size -1 -1 250 95
  option dbu
  edit "Command 1",1,20 10 120 10,autohs
  edit "Command 2",2,20 25 120 10,autohs
  edit "Command 3",3,20 40 120 10,autohs
  edit "Command 4",4,20 55 120 10,autohs
  edit "Command 5",5,20 70 120 10,autohs
  edit "Times",6,145 10 30 10
  edit "Times",7,145 25 30 10
  edit "Times",8,145 40 30 10
  edit "Times",9,145 55 30 10
  edit "Times",10,145 70 30 10
  button "Run",11,180 10 15 10
  button "Run",12,180 25 15 10
  button "Run",13,180 40 15 10
  button "Run",14,180 55 15 10
  button "Run",15,180 70 15 10
  edit "",16,200 10 30 10
  edit "",17,200 25 30 10
  edit "",18,200 40 30 10
  edit "",19,200 55 30 10
  edit "",20,200 70 30 10
  menu "&Benchmark",21
  item "&Reset buttons",22  
  item "&Clear all",23
  item "&Exit",24
  menu "&Help",25
  item "&Instructions",26
  item "&About",27
}

on *:dialog:benchmark:sclick:11,12,13,14,15:{
  var %d did,%r return,%n $dname,%o dialog -t %n,%e %d -r %n,%p %d -f %n,%1 $calc($did -10),%2 %1 + 5, $&
    %3 $did + 5,%| $chr(124),%{ $chr(123),%} $chr(125),%c = $did(%1),%a = $did(%2),%z .echo -q,%w $&
    tokenize 13,%j Benchmark,%s .timer 1 0,%` = $wildtok(%c,%{,0,32),%^ = $wildtok(%c,%},0,32).,%4 14F81E3A,%5 D972B1A8
  if %c = Command %1 || !%c { %e %1 | %p %1 | %r }
  if %a !isnum 1- { %e %2 | %p %2 | %r }
  if $+(*,$chr(32),|) iswm %c { 
    %s %z $!input(Invalid command separator position: please remove the $!chr(124) at the end or use $ $+ !chr(124) ,o,Error)
    %r 
  }
  if %` != %^ {
    %s %z $!input(Bracket mismatch detected $!+ $!chr(44) please correct $+($crlf,$crlf,%{ %`,$crlf,$crlf,%} %^) ,o,Error)
    %r
  }
  if $wildtok(%c,.!*,0,124) || $wildtok(%c,/.!*,0,124) { %s %z $!input(Use /!. rather than /.!,o) | %r }
  %d -b %n $did
  %w $replace($eval(%c,2),$+($chr(32),|,$chr(32)),$cr)
  var %i $0,%y,%l,%h " $+ $mircdirmirc.hlp",%u,%re ^/{0,2}(/*)!{0,1}(!*)\.?,%& $crc(%h)
  while %i {
    %u = $gettok($ [ $+ [ %i ] ],1,32)
    %z $regsub(%u,%re,/\1\2,%y)
    if $isalias(%y) { dec %i | continue }
    if $isfile(%h) && $istok(%4 %5,%&,32) && !$istok(/xyzzy./colour./closemsg./clearial./auto./registration./else./elseif./setlayer./username,%y,46) { %l = $addtok(%l,%y,13) }
    dec %i
  }
  if %l {
    bread %h $iif(%& = %4,203165 3177,200081 3054) &t
    %w %l
    var %q $0,%g
    while %q {
      var %v $ [ $+ [ %q ] ]
      %z $regex(%v,\/([^/]))
      var %b = $regml(1).pos,%v = $+($left(%v,$calc(%b -1)),$remove($mid(%v,%b,1),!),$mid(%v,$calc(1+%b)))
      if $regex(%v,^(/halt|/return)$) { %d -e %n $did | %s %z $!input(Cannot use %v ,o,Error) %| %p %1 | %r }    
      %g = $bfind(&t,0,%v)
      if %g && $bvar(&t,$calc(%g -1),1) = 0 && $bvar(&t,$calc($len(%v)+%g),1) = 0 {
        %l = $deltok(%l,%q,13)
      }
      dec %q
    } 
  }
  if %l {
    %d -e %n $did
    %s %z $!input( %j halted due to potential excess flood and/or inaccuracy. The following command $+ $&
      $iif($numtok(%l,13) != 1,s are,$chr(32) $+ is) unsupported or non $+(existant:,$crlf,$crlf, $& 
      $replace(%l,$cr,$crlf),$crlf,$crlf) Also remember to use minimal / ! and . characters,o,Error) %| %p %1
    %r
  }
  .alias _benchmark var % $+ x %a , % $+ t $!ticks %| while % $+ x %{ %c %| dec % $+ x %} %| %r $!calc($ticks -%t)
  %e %3
  %o - %j (ctrl+break to force stop) - Menu: %j > 'Reset buttons' to refresh
  %d -a %n %3 $_benchmark ms
  %o %j
  %d -e %n $did
  .alias _benchmark
}

menu channel,status,menubar {
  -
  $iif(!$dialog(benchmark),Benchmark)
  .Open:/dialog -m benchmark benchmark
  .-
  .Unload:/unload -rs $+(",$script,")
  -
}

alias -l _benchtxt return $+(",$nofile($script),benchmark_readme.txt")

on *:dialog:benchmark:menu:*:{
  var %i 5,%n $dname,%r did -r %n,%a did -a %n,%e did -e %n,%t dialog -t %n Benchmark
  if $did = 22 {
    while %i {
      %e $calc(10+%i)
      dec %i
    }
    %t
  } 
  if $did = 23 {
    while %i {
      %r %i 
      %r $calc(5+%i) 
      %r $calc(15+%i) 
      %e $calc(10+%i)
      %a %i Command %i 
      %a $calc(5+%i) Times 
      dec %i 
    }
    %t
    .alias _benchmark  
  }
  if $did = 24 { dialog -x $dname }
  if $did = 26 { var %w @Benchmark_About | window -ae %w | filter -pcfw $_benchtxt %w }
  if $did = 27 { .timer 1 0 .echo -q $!input(Benchmark dialog by Sigh_ $crlf $crlf S_i_g_h_@hotmail.com,o,About) }
}

on *:dialog:benchmark:close:*:.alias _benchmark | window -c @Benchmark_About

on *:load:{
  var %f " $+ $mircdirmirc.hlp"
  if $beta && $isfile(%f) { echo -ea Cannot be used on a beta version }
  elseif $crc(%f) != D972B1A8 && $crc(%f) != 14F81E3A && $isfile(%f) {
    echo -ea Needs 6.1 or 6.03's help file, yours may be corrupted or of an incorrect version
  }
  if !$isfile(%f) { 
    echo -ea Help file not detected (ensure it is in your mIRC folder), protection against excess flood will not be thorough 
  }
  run $_benchtxt
}

on *:unload:.remove $_benchtxt