Results 1 to 4 of 4

Thread: Script filepath

  1. #1
    Join Date
    Oct 2009
    Location
    Melb, Australia
    Posts
    179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Script filepath

    I recently decided to add a screensaving function to my scripts so it will be easier to see where it went wrong (when afk).

    I can get the SaveScreenShot() working fine, but it requires an existing filepath.
    Is there a way to find the filepath from where the script is located? And how can I create a new directory (folder) if it doesn't exist?

  2. #2
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Here's how I do it in my script:
    SCAR Code:
    if not DirectoryExists(AppPath + 'WineTelegrabDebug\') then
        RewriteFile(AppPath + 'WineTelegrabDebug\', True);
    This creates the directory if it doesn't exist.
    SCAR Code:
    TakeScreenshot(AppPath + 'WineTelegrabDebug\' + Players[CurrentPlayer].Nick + IntToStr(Players[CurrentPlayer].Integers[5]));
    This takes the screen shot.

  3. #3
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Wow nice Senrath, i didnt know you could create.
    Great help.

  4. #4
    Join Date
    Oct 2009
    Location
    Melb, Australia
    Posts
    179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •