VrS (Variant realities Script) — File Browser

VrSVariantrealitiesScriptv2.0 / VrSVariantrealitiesScriptv2.0 / VrS / System / Modules / vNC / VNC.MRC

VNC.MRC — 5.25 KB — Download this file

;#[vHD@3.0 F!vNC@1.0.0;2001.07.18;Variant<variant@variantrealities.com>]
;#[SD ]
;#[Incl ]
;#[vMI's Nick Completer mini-engine]
;#[ ]
;#[ ]


alias checklines {
  var %counter = 1
  var %lines = 0
  var %dir = $sdir="Select directory to check lines of code for" $vrsdir
  var %bytes = 0
  while (%counter < $findfile(%dir,*.mrc,0,10)) {
    inc %lines $lines($findfile(%dir,*.mrc,%counter,10))
    inc %bytes $file($findfile(%dir,*.mrc,%counter,10)).size
    inc %counter
  }
  echo -a $findfile(%dir,*.mrc,0,10) script files, %bytes total size of code, %lines lines of code.
}


alias vNC.Complete {
  ; Syntax: $vNC.Complete(<chan>,<nick fragment>)
  var %vNC.WildText = [ [ $2 ] $+ * ] , %vNC.SolidText = $2 , %vNC.Count = 1
  if ($fline($vMI.WinName($1),$+(?,%vNC.SolidText),1,1) != $null) {
    var %Line = $ifmatch
    var %vNC.CompletedNick = $line($vMI.WinName($1),%Line,1)
    goto end
  }
  if ($fline($vMI.WinName($1),$+(*,%vNC.WildText),1,1) != $null) {
    var %Line = $ifmatch
    var %vNC.CompletedNick = $line($vMI.WinName($1),%Line,1)
  }
  :end
  return $vMI.StripNick(%vNC.CompletedNick)
}
alias vNC.Chars { 
  return $strip( [ [ %::OpChar ] $+ [ %::OpColor ] ] [ [ %::HalfOpChar ] $+ [ %::HalfOpColor ] ] [ [ %::VoiceChar ] $+ [ %::VoiceColor ] ] [  $+ [ %::Regular ] ] )
}
on *:signal:^vMI.Input: {
  return
  if ($left($vMI.Chan,1) isin &#+) && ($mouse.key != 2) {
    var %vNC.Counter = 1
    ;While start (loop through text to complete all parts that need to  be completed)
    while (%vNC.Counter <= $numtok(%vMIEvent.Text,32)) {
      ;Do stuff to complete nickname
      var %vNC.CompNum = $gettok($gettok(%vMIEvent.Text,%vNC.Counter,32),2,58)
      if (%vNC.CompNum isnum) || (%vNC.CompNum == $null) && (: isin $gettok(%vMIEvent.Text,%vNC.Counter,32)) && ($mid($gettok(%vMIEvent.Text,%vNC.Counter,32),1,1) != :) {
        var %vNC.Nick = $vNC.Complete(%vMIEvent.Chan,$gettok($gettok(%vMIEvent.Text,%vNC.Counter,32),1,58))
        if (%vNC.Nick != $null) {
          %vNC.Nick = $vNC.CompList(%vNC.CompNum,%vNC.Nick)
          set -u %vMIEvent.Text $puttok(%vMIEvent.Text,%vNC.Nick,%vNC.Counter,32)
        }
      }
      ;While end
      inc %vNC.Counter
    }
  }
  set %vMIEvent.Text %vMIEvent.Text
}
alias vnc.return set -u %return $1-
alias vNC.CompList {
  if ($1 !isnum) { 
    set -u %::Nick $2
    set -u %:echo vnc.return 
    theme.text nickcomp
    return %return
  }
  elseif ($1 == 1) { return 06.14:12 $+ $$2 $+ 14:06. }
  elseif ($1 == 2) { set %NC.nicklen $len($$2) | if (%NC.nicklen > 2) { set %NC.Completed 13 $+ $mid($$2,1,1) $+ 06 $+ $mid($$2,2, [ $calc(%NC.nicklen - 2) ] ) $+ 13 $+ $mid($$2,%NC.nicklen,1) | return 2-12/13 $+ %NC.Completed $+ 12\02- } | else { return 2-12/13 $+ $$2 $+ 12\02- } }
  elseif ($1 == 3) { return 14..02>12 $+ $$2 $+ 02<14.. }
  elseif ($1 == 4) { return 14=1<6 $+ $$2 $+  1>14= }
  elseif ($1 == 5) { set %NC.nicklen $len($$2) | if (%NC.nicklen > 2) { set %NC.Completed 10 $+ $mid($$2,1,1) $+ 14 $+ $mid($$2,2, [ $calc(%NC.nicklen - 2) ] ) $+ 10 $+ $mid($$2,%NC.nicklen,1) | return 2· $+ %NC.Completed $+ 2· } | else { return 2·10 $+ $$2 $+ 2· } }
  elseif ($1 == 6) { return 15:14:122:12 $+ $$2 $+ 2:14:15: }
  elseif ($1 == 7) { return 14-01>12 $+ $$2 $+ 01<14- }
  elseif ($1 == 8) { return 12-2»12 $+ $$2 $+ 2«12- }
  elseif ($1 == 9) { return 14-10/12 $+ $2 $+ 10\14- }
  elseif ($1 == 10) { set %NC.nicklen $len($$2) | if (%NC.nicklen > 2) { set %NC.Completed 12 $+ $mid($$2,1,1) $+ 02 $+ $mid($$2,2, [ $calc(%NC.nicklen - 2) ] ) $+ 12 $+ $mid($$2,%NC.nicklen,1) | return 10«14[ $+ %NC.Completed $+ 14]10» } | else { return 10«14[12 $+ $$2 $+ 14]10» } }
  else {
    if ($exists($vrsdir(System\Config\Comps.txt)) == $true) {
      set -u %vNC.CompLine $read($vrsdir(System\Config\Comps.txt).n,ns, Comp [ $+ [ %vNC.Num ] ] )
      ;echo -s %vNC.CompLine
      if (%vNC.CompLine != $null) { 
        if ($gettok($gettok(%vNC.CompLine,1,32),1,58) != !vNC) {
          return $replace(%vNC.CompLine,&nick,$2)
        }
        else {
          if ($isalias($gettok($gettok(%vNC.CompLine,1,32),2,58)) == $true) { 
            set -u %vNC.Identifier $ $+ [ $gettok($gettok(%vNC.CompLine,1,32),2,58) ] $+ ( $+ [ $2 ] $+ )
            return [ [ %vNC.Identifier ] ]
          }
        }
      }
      else { return $2 }
    }
    else { return $2 }
  }
}
alias -l nctemp {
  set -u %NC.nicklen $len($1) 
  if (%NC.nicklen > 2) { set -u %NC.Completed 10 $+ $mid($1,1,1) $+ 12 $+ $mid($1,2, [ $calc(%NC.nicklen - 2) ] ) $+ 10 $+ $mid($1,%NC.nicklen,1) 
    return 14[ $+ %NC.Completed $+ 14] 
  }
  else { return 14[12 $+ $1 $+ 14] }
}
alias -l nc2 {
  set -u %nick.name $1
  set -u %aa 02,00a01,00
  set -u %ee 04,00e01,00
  set -u %ii 03,00i01,00
  set -u %oo 12,00o01,00
  set -u %uu 14,00u01,00
  set -u %yy 09,00y01,00
  set -u %nick.len $len(%nick.name) - 1
  set -u %nick.len2 $len(%nick.name) - 2
  set -u %nick.name [ $+ 03,00 $+ $left(%nick.name,1) $+ 05,00 $+ $replace($left($right(%nick.name,%nick.len),%nick.len2),a,%aa,e,%ee,i,%ii,o,%oo,u,%uu,y,%yy) $+  $+ $right(%nick.name,1) $+  $+ ] 
  return %nick.name
}