Skip to content
IRCd Addons

New Find File Addon

A TG007 community discussion started by Warrior124.

Discussion 4 posts
Page 1 of 1
Open
Topic #13877 · 4 published posts · 2,950 views

This addon is a new version of the ff alias. What it does is it will attempt to locate the specified file in the directory where you are running mirc, and its subdirectories. If it doesn't find the file there it will attempt to locate the file where your mirc.ini file is located, and its subdirectories. If it still doesn't find the file it will create a variable for the file which will be good if creating a new file. Another thing about this new code is you can find/make a file with spaces in the directory, and/or filename. :)

 

alias ff {
  var %getff $1-
  if (!%ff. [ $+ [ " $+ %getff $+ " ] ]) || (!$exists(%ff. [ $+ [ " $+ %getff $+ " ] ])) {
    if ($shortfn($findfile($nofile($mircexe),%getff,1))) set %ff. [ $+ [ " $+ %getff $+ " ] ] $ifmatch
    elseif ($shortfn($findfile($mircdir,%getff,1))) set %ff. [ $+ [ " $+ %getff $+ " ] ] $ifmatch
    else set %ff. [ $+ [ " $+ %getff $+ " ] ] " $+ $nofile($mircexe) $+ %getff $+ "
  }
  return %ff. [ $+ [ " $+ %getff $+ " ] ]
}

Great work warrior123

Get information about ircWx here

Great work warrior123

 

:oops: warrior123 ? ........ :lmaojump: you been working to hard err0r :P

Hey Buddy,

 

Hate to be a pest... but does the %getff variable ment to be evaluated?? I just tried your new code, and it doesnt update the variable unless you evaluate the %getff variable when you set it... =)

 

alias ff {
  var %getff = $1-
  if (!%ff. [ $+ [ " $+ [ %getff ] $+ " ] ]) || (!$exists(%ff. [ $+ [ " $+ [ %getff ] $+ " ] ])) {
    if ($shortfn($findfile($nofile($mircexe),%getff,1))) set %ff. [ $+ [ " $+ [ %getff ] $+ " ] ] $ifmatch
    elseif ($shortfn($findfile($mircdir,%getff,1))) set %ff. [ $+ [ " $+ [ %getff ] $+ " ] ] $ifmatch
    else set %ff. [ $+ [ " $+ [ %getff ] $+ " ] ] " $+ $nofile($mircexe) $+ [ %getff ] $+ "
  }
  return %ff. [ $+ [ " $+ [ %getff ] $+ " ] ]
}

 

Thanks buddy, Its a handy little function I feel :)

 

Kind Regards,

Daniel

 

Actually it evaluates fine for me, but that extra = sign does the same thing, lol. Thanks, Daniel. :)

 

 

:oops: warrior123 ? ........ :lmaojump: you been working to hard err0r :P

 

:lolwave: