Resource icon

Script Directory Management 1

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Supported Minecraft Versions
  1. 1.7
  2. 1.8
  3. 1.9
  4. 1.10
  5. 1.11
  6. 1.12
  7. 1.13
  8. 1.14
  9. 1.15
Expressions:
[all] file[\s] (of|at) [directory] %string% [with [extension] %string%]

Returns files in a directory, if you add the [all] it will also search all directories in the directory. The extension is what file types it returns for example "sk" would only return skript files by default it finds everything including directories. You can set the extension to <FILES> if you want to only search for files or <DIRECTORIES> if you only want to search directories
delete file[\s] [(of|at)] [directory] %string%
Delete a specific file or if you point the string to a directory it will delete all files within that directory, it will also remove the directory if after removing all files the directory is empty (meaning if there is a folder within the folder it will not delete that content)
create file [(of|at)] %string% [with [text] %string%]
Create a file, optionally set the text of the file too
create directory [(of|at)] %string%
Creates a empty directory at the location
scripts
This returns all valid scripts in your scripts folder, this does not include scripts prefixed with "-"

Requires apache commons-io-2.6 (included in download)
file text [(of|at)] %string%

Returns text of a file

This also adds 2 functions:
files(directory,extension)
directories(directory,extension)

Examples:
Code:
command /createfile:
  trigger:
    create file "plugins\Skript\scripts\emptyscript.sk" with "##This is an empty script%nl%##I should add some content here..."
    #creates emptyscript.sk in your scripts folder and writes to it, %nl% would require skquery but adds a new line
command /deletefile:
  trigger:
    delete file "plugins\Skript\scripts\emptyscript.sk"
    #deletes emptyscript.sk in your scripts folder
command /mypluginjars:
  trigger:
    send files at directory "plugins\" with "jar"
    #returns all jar files in your plugins folder
command /alljars:
  trigger:
    send all files at directory "plugins\" with "jar"
    #returns all jar files in directories after your plugins folder, meaning this will also return skript-mirror jars in the skript-mirror folder


Requirements:

Skript-Mirror
Author
Veraid
Downloads
454
Views
454
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Veraid