print or save in pdf?

  • #10, by afrlmeSunday, 26. September, 16:44 3 weeks ago
    I know how to create a folder on windows in the documents folder, but the problem is that I don't think that would be valid for mac & linux. I have no idea if the folders would be named/accessed in the same way because the method I've shown below is using the environment variables which are - as far as I'm aware - unique to each different OS.

    Anyway, to create a folder on the desktop (on windows at least) you can use this code...
    local dir = os.getenv("userprofile") .. "\\Documents\\"
    lfs.mkdir(dir .. "\\Example Game Name")
    lfs.mkdir(dir .. "\\Example Game Name\\Screenshots")

    local time = os.date("%Y-%m-%d_%Hh-%Mm-%Ss")
    createScreenshot(dir .. "\\Example Game Name\\screenshots\\" .. time .. ".png")
    1
    2
    3
    4
    5
    6

    Imperator

    7025 Posts


Write post