Skip to content

Releases: ItsTheSky/skript-storage

Deleting fixing

09 Apr 18:44
Compare
Choose a tag to compare

This small update fixes the deletion changer for nodes.
You can now delete your nodes and clear them, without any errors.

Full Changelog: 1.2.1...1.2.2

Small fixes ...

16 Nov 19:00
Compare
Choose a tag to compare

this very small update brings fix the #1 issue, where lists were taken as Java lists and not converted into Skript's ones.
In addition, you can use list values in the loop effect as long as you use the s in values word (skript-storage will therefore convert it as a list)

Full Changelog: 1.2.0...1.2.1

Queue system update!

15 Nov 19:17
Compare
Choose a tag to compare

This pretty big update implemented whole new features: Queues!
Queues are made for huge data management, and only advanced users should use them.
You can create a queue for a specific path, then every change made to it will be queued, but not saved to the file yet.
Make the changes you want, and save the file one time with all these values by restarting the queue!

Example code:

create shortcut for "plugins/Test/test.json" as "config"
start queue for "config" # After this effect, every change made to "config" will be queued and not saved
        
set value "test" of "config" to true
set value "Hello.World" of "config" to 30
        
save queue for "config" # Every change will be saved here

Full Changelog: 1.1.0...1.2.0

Clear nodes effect and default node expression!

13 Nov 14:07
Compare
Choose a tag to compare

This small release adds two main syntaxes:

  • Clear nodes effect, you can now delete every content of your file through a simple effect.

  • Default values of nodes, which is for advanced users:

This new expression (get [the] [value] %string% (of|from|in) [the] [file] %string% or [(1¦set)] [default] [to] %objects%) will allow you to manage nodes value even easier:

Example code:

clear nodes of "config"

set {_v::*} to get "test" of "config" or default "hello" and "dsqqsd"
send "%{_v::*}%" to console

set {_v::*} to get "test2" of "config" or set default "hello" and "dsqqsd"
send "%{_v::*}%" to console

YAML result:

test2: 
- hello
- dsqqsd

Console result:
image

First skript-storage release!

13 Nov 13:07
Compare
Choose a tag to compare

skript-storage was made to handle file storing within three main ways:

  • YAML
  • JSON
  • TOML
    All of them have the same effects and expressions to edit, however have different advantages and disadvantages.

Check the official wiki here: https://skstorage.itsthesky.info/

Example code:

options:
	Name: Test

on load:
	create private shortcut for "plugins/{@Name}/config.yml" as "config"

	set default value "EnablePlugin" of "config" to true
	set comment of node "EnablePlugin" of "config" to " Either the Plugin is enabled or not."
	set default value "PluginPrefix" of "config" to "!"
	set comment of node "PluginPrefix" of "config" to " The prefix used in a lot of other features." and " Should be a one-char only!"
	
	# For example, bot configuration
	set default value "Token" of "config" to "YOUR TOKEN HERE"
	set comment of node "Token" of "config" to " The token of the bot." and " You can create one through Discord developer portal" and "THIS IS PRIVATE, send this token to nobody!"
	set default value "OwnerID" of "config" to 0
	set comment of node "OwnerID" of "config" to " The user ID of the bot owner." and " Allow multiple private permission commands."
	set default value "ModeratorsID" of "config" as list to 0 # Will force skript-storage to save it as a list
	set default values "RolesID" of "config" to 0, 1, 2 and 3

	# The header should always be changed after other edition.
	# (the custom comment parser could clear it sometimes)
	set framed header of "config" to "This is the main configuration file of {@Name}"

YAML result:

# +----------------------------------------------------+ #
# <    This is the main configuration file of Test     > #
# +----------------------------------------------------+ #
EnablePlugin: true
# The prefix used in a lot of other features.
# Should be a one-char only!
PluginPrefix: '!'
# The token of the bot.
# You can create one through Discord developer portal
# THIS IS PRIVATE, send this token to nobody!
Token: YOUR TOKEN HERE
# The user ID of the bot owner.
# Allow multiple private permission commands.
OwnerID: 0
ModeratorsID: 
- 0
RolesID: 
- 0
- 1
- 2
- 3

JSON Result:

{
   "RolesID": [
      0,
      1,
      2,
      3
   ],
   "OwnerID": 0,
   "ModeratorsID": [0],
   "Token": "YOUR TOKEN HERE",
   "EnablePlugin": true,
   "PluginPrefix": "!"
}

TOML Result:

OwnerID = 0
ModeratorsID = [0, ]
Token = "YOUR TOKEN HERE"
EnablePlugin = true
PluginPrefix = "!"
RolesID = [0, 1, 2, 3, ]