$scriptdir

From Scriptwiki
Revision as of 21:09, 6 April 2008 by Albie (talk | contribs) (linking to self is bad.)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Returns the directory of the currently executing remote script.

$scriptdir

It is generally good practice to use this identifier to locate files associated with the current script.

Example

on *:load: {
  ;Check we have atleast version 6.2
  if ($version < 6.2) {
    echo -ag You need atleast mIRC v6.2 to use this script. 
    .unload -rs $script
  }
  ;Make sure we have the images we need.
  if (!$exists($scriptdir $+ MyImage.jpg)) {
    echo -ag MyImage wasn't found in $scriptdir please place this image into the directory before loading this remote.
    .unload -rs $script
  }
  ;Everythings ok, display image.
  background -ef $scriptdir $+ MyImage.jpg
}

See Also