List variables delete themselves on restart

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

memes

Member
Jun 24, 2018
23
2
3
24
So my Skript list variables delete themselves when I /stop my server. I always /save-all before stopping and I'm on the version 2.2-dev37c. Here is the code that gives me issues:
code_language.skript:
on place of brown glass block:
    if name of player's tool is "&6Magical Seeds":
        set {magicalseeds::%location of event-block%} to location of event-block
        send "&3Sky&bFarmers &8- &6New seed placed!"
command /seeds:
    trigger:
        send "%{magicalseeds::*}%"
every 30 seconds in world "plots":
    loop {magicalseeds::*}:
        loop all blocks in radius 2 around {magicalseeds::%loop-index%}:
            if loop-block is air:
                chance of 5%:
                    set loop-block to melon or pumpkin
                    set {_y.%location of loop-block%} to loop-block's y coordinate
                    set {_x.%location of loop-block%} to loop-block's x coordinate
                    set {_z.%location of loop-block%} to loop-block's z coordinate
                    execute console command "/particle cloud %{_x.%location of loop-block%}% %{_y.%location of loop-block%}% %{_z.%location of loop-block%}% 0.5 0.5 0.5 0.1 20 force @a"
                    delete {_z.%location of loop-block%}
                    delete {_y.%location of loop-block%}
                    delete {_x.%location of loop-block%}
on break of brown glass block:
    if location of event-block is equal to {magicalseeds::%location of event-block%}:
        drop 1 brown glass block named "&6Magical Seeds" at location of event-block
        delete {magicalseeds::%location of event-block%}
        send "&3Sky&bFarmers &8- &6Seed mined!"
o
 
Is there an error when reloading the script?
I just tried and it worked for me..
Try adding this:
This when the player places the glass:
code_language.skript:
set {save} to {magicalseeds::%location of event-block%}
set {save1} to location of event-block
and add this:
code_language.skript:
on script load:
    set {magicalseeds::%{save1}%} to {save}
 
Last edited:
So my Skript list variables delete themselves when I /stop my server. I always /save-all before stopping and I'm on the version 2.2-dev37c. Here is the code that gives me issues:
code_language.skript:
on place of brown glass block:
    if name of player's tool is "&6Magical Seeds":
        set {magicalseeds::%location of event-block%} to location of event-block
        send "&3Sky&bFarmers &8- &6New seed placed!"
command /seeds:
    trigger:
        send "%{magicalseeds::*}%"
every 30 seconds in world "plots":
    loop {magicalseeds::*}:
        loop all blocks in radius 2 around {magicalseeds::%loop-index%}:
            if loop-block is air:
                chance of 5%:
                    set loop-block to melon or pumpkin
                    set {_y.%location of loop-block%} to loop-block's y coordinate
                    set {_x.%location of loop-block%} to loop-block's x coordinate
                    set {_z.%location of loop-block%} to loop-block's z coordinate
                    execute console command "/particle cloud %{_x.%location of loop-block%}% %{_y.%location of loop-block%}% %{_z.%location of loop-block%}% 0.5 0.5 0.5 0.1 20 force @a"
                    delete {_z.%location of loop-block%}
                    delete {_y.%location of loop-block%}
                    delete {_x.%location of loop-block%}
on break of brown glass block:
    if location of event-block is equal to {magicalseeds::%location of event-block%}:
        drop 1 brown glass block named "&6Magical Seeds" at location of event-block
        delete {magicalseeds::%location of event-block%}
        send "&3Sky&bFarmers &8- &6Seed mined!"
o
Use vanilla or skDragon for particles, don't use console commands. You also dont need to delete _ vars
 
code_language.skript:
on script load:
    set {magicalseeds::%{_save1}%} to {_save}
That wouldn't work. Any variable starting with an underscore is LOCAL to the event. Since {_save} was never set in that event, you are literally setting {magicalseeds::%{_save1}%} to <none> ... and since {_save1} is not set to anything in that event, youre literally setting
{magicalseeds::none} to none
 
That wouldn't work. Any variable starting with an underscore is LOCAL to the event. Since {_save} was never set in that event, you are literally setting {magicalseeds::%{_save1}%} to <none> ... and since {_save1} is not set to anything in that event, youre literally setting
{magicalseeds::none} to none

Well, without the underscore?
 
Okay well a few things
1) " I always /save-all before stopping" You dont need to do that.... when you /stop a server, it automatically does that by itself
2) There might be an issue with your skript plugin, as skript doesn't delete variables on its own. Or maybe an issue when stopping your server. Look thru your console when you stop, is Skript shutting down properly? Because thats when it saves variables to the variables file.
 
code_language.skript:
[23:00:30] [Server thread/INFO]: memees issued server command: /stop
[23:00:30] [Server thread/INFO]: Stopping server
[23:00:30] [Server thread/INFO]: [KitAdder] Disabling KitAdder v2.6
[23:00:30] [Server thread/INFO]: [KitAdder] KitAdder plugin has been disabled!
[23:00:30] [Server thread/INFO]: [WorldGuard] Disabling WorldGuard v6.2.2-SNAPSHOT;8eeab68
[23:00:30] [Server thread/INFO]: [WorldGuard] Shutting down executor and waiting for any pending tasks...
[23:00:30] [Server thread/INFO]: [EssentialsSpawn] Disabling EssentialsSpawn v2.15.0.1
[23:00:30] [Server thread/INFO]: [PlotSquared] Disabling PlotSquared v18.09.09-eab918b-2040
[23:00:30] [Server thread/INFO]: All DB transactions during this session are being validated (This may take a while if corrections need to be made)
[23:00:30] [Server thread/INFO]: [EssentialsChat] Disabling EssentialsChat v2.15.0.1
[23:00:30] [Server thread/INFO]: [Essentials] Disabling Essentials v2.15.0.1
[23:00:30] [Server thread/INFO]: [Vault][Economy] Essentials Economy unhooked.
[23:00:30] [Server thread/INFO]: [skRayFall] Disabling skRayFall v1.9.14
[23:00:30] [Server thread/INFO]: [skRayFall] Bacon has been eaten. Make some more soon!
[23:00:30] [Server thread/INFO]: [WorldEdit] Disabling WorldEdit v6.1.9;caf0ad9
[23:00:30] [Server thread/INFO]: [Vault] Disabling Vault v1.7.1-b91
[23:00:30] [Server thread/INFO]: [HolographicDisplays] Disabling HolographicDisplays v2.3.0
[23:00:30] [Server thread/INFO]: [NametagEdit] Disabling NametagEdit v4.3.0
[23:00:30] [Server thread/INFO]: [SkQuery] Disabling SkQuery v3.6.0-Lime
[23:00:30] [Server thread/INFO]: [PermissionsEx] Disabling PermissionsEx v1.23.4
[23:00:30] [Server thread/INFO]: [PlaceholderAPI] Disabling PlaceholderAPI v2.9.2
[23:00:30] [Server thread/INFO]: [VoxelSniper] Disabling VoxelSniper v5.172.0-SNAPSHOT
[23:00:30] [Server thread/INFO]: [PlayerServer] Disabling PlayerServer v1.0-SNAPSHOT
[23:00:30] [Server thread/INFO]: [Skript] Disabling Skript v2.2-dev37c
[23:00:30] [Server thread/INFO]: [FastAsyncWorldEdit] Disabling FastAsyncWorldEdit v18.09.16-b7f1ee3-1215-21.5.2
[23:00:30] [Server thread/INFO]: [BukkitCore] Disabling BukkitCore v1.0-SNAPSHOT
[23:00:30] [Server thread/INFO]: [CoreProtect] Disabling CoreProtect v2.14.4
[23:00:30] [Server thread/INFO]: Saving players
[23:00:30] [Server thread/INFO]: memees lost connection: Server closed
[23:00:30] [Server thread/INFO]: memees left the game
[23:00:30] [Server thread/INFO]: CaposLock lost connection: Server closed
[23:00:30] [Server thread/INFO]: CaposLock left the game
[23:00:30] [Server thread/INFO]: Saving worlds
[23:00:30] [Server thread/INFO]: Saving chunks for level 'world'/overworld
[23:00:30] [Server thread/INFO]: Saving chunks for level 'world_nether'/the_nether
[23:00:30] [Server thread/INFO]: Saving chunks for level 'world_the_end'/the_end
[23:00:30] [Server thread/INFO]: Saving chunks for level 'plots'/overworld
It looks fine...
 
Okay so that seems odd... there is really no reason your variables should be deleting yourself.
Try this... place a few of your seed blocks

put this code in your script
code_language.skript:
command /test:
    trigger:
        send "Debug: %{magicalseeds::*}%"

Stop your server, then start it up again... after it fully loads, run "/test" and see if it sends you anything.
If it says "<none>" then yes, somehow your variables are getting deleted, else if it sends any of your lists then we at least know the variables aren't getting deleted
 
I found this:
code_language.skript:
[23:38:25] [Server thread/ERROR]: #!#! ===!!!=== Skript variable load error ===!!!===
[23:38:25] [Server thread/ERROR]: #!#! Unable to load (all) variables:
[23:38:25] [Server thread/ERROR]: #!#! 1 variable could not be loaded!
[23:38:25] [Server thread/ERROR]: #!#! Affected variables: magicalseeds::plots:33.5,65.5,-32.5
[23:38:25] [Server thread/INFO]: [Skript] Created a backup of variables.csv as variables_2018-09-24_23-38-25.csv
[23:38:25] [Server thread/ERROR]: #!#!
[23:38:25] [Server thread/ERROR]: #!#! Skript will work properly, but old variables might not be available at all and new ones may or may not be saved until Skript is able to create a backup of the old file and/or is able to connect to the database (which requires a restart of Skript)!
[23:38:25] [Server thread/ERROR]: #!#!

I kind of understand but I don't know what they mean by restarting Skript.
 
The error is why its getting deleted, because it cant save that variable. If you want to fix this delete the variables.csv file in the plugin/Skript folder

BEWARE: this will delete all your variables on that current server
 
The error is why its getting deleted, because it cant save that variable. If you want to fix this delete the variables.csv file in the plugin/Skript folder

BEWARE: this will delete all your variables on that current server
I agree ... It appears your variable file was corrupt or something along those lines.
If this is a live/production server I really hope you have a backup of your variables.
Also, if this is a live server, I highly recommend setting up a test server instance so that you can test all your skripts out before putting them onto your life server, incase stuff like this happens.
 
Status
Not open for further replies.