temp variables without saving in file

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

kenkencw

Active Member
Jan 31, 2017
68
0
0
31
Malaysia
www.huskycraftmc.com
how to make a variables (not "{_a}") not saving in variables database, i needed to use i anytime with multiple events, after server restart will disapear

will it possible?
 
Last edited:
code_language.skript:
set {variable} to whatever

Then
code_language.skript:
on script load: #(I think that's the event)
    delete {variable}
 
Well you don't want to save it in the variables file. You don't want to use a database. You don't want to use a local variable. I don't think there's any other options.
 
There is no way to avoid variables being written to the database. You can however specify if certain variables should be deleted when you restart the server. You should have a look at the config.sk file in your Skript folder. You can find the following text on line ~180:
Code:
# PS: If you don't want some variables to be saved in any database (e.g. variables that contain an %entity% which usually despawn when the server is shut down)
# you can modify the last database's pattern to not match all variables, e.g. use '(?!x_).*' to match all variables that don't start with 'x_'.
# Be very cautious when doing this however as unsaved variables cannot be recovered after the server has been stopped.
# I recommend to use a single character to denote unsaved variables (similar to local variables' '_'), e.g. '-', in which case the last database's pattern should be '(?!-).*'.

So if you change your database pattern of your default database to (?!-).* you will be able to create variables like: {-variable} which will not be saved if the server restarts. This is how my config for the default database looks like:

Code:
    default:
        # The default "database" is a simple text file, with each variable on a separate line and the variable's name, type, and value separated by commas.
        # This is the last database in this list to catch all variables that have not been saved anywhere else.
        # You can modify this database freely, but make sure to know what you're doing if you don't want to loose any variables.

        type: CSV

        pattern: (?!-).*

        file: ./plugins/Skript/variables.csv

        backup interval: 2 hours
 
hows the pattern looks like if saving different variables file name?
not really know how to use pattern correctly, i very afraid d since the pattern messed up before
 
Status
Not open for further replies.