All pastes #995462 Raw Edit

Yajirobe

public text v1 · immutable
#995462 ·published 2008-04-24 05:24 UTC
rendered paste body
alias slashes {
  var %dir = $?="Enter the path of your BASE Windower directory $crlf $+ (where launcher.exe is found)." 
  if (!$exists($+(%dir,$iif($right(%dir,1) !isin \/,/),launcher.exe))) { echo -a Windower directory not specified. | return }
  %dir = $+(%dir,$iif($right(%dir,1) !isin \/,/),scripts) 
  var %temp , %count = 0 , %i = 1 , %files = $findfile(%dir,*,0)
  while (%i <= %files) {
    var %j = 1 , %file = $findfile(%dir,*,%i)
    while ($read(%file,w,*\*,%j)) {
      if ($regsub($v1,/((?:[^\\]+|(?:\\\\)+)+)((?:\\)?)(?!\\)/g,\1\2\2,%temp) > 1) {
        write -l $+ $readn $qt(%file) %temp
        echo -a %file $readn
        inc %count
      }
      %j = $calc($readn + 1)
    }
    inc %i
  }
  echo -a %count replacements made
}