Strange bug with size of list variable

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

    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.

pepper82

Member
Jan 26, 2017
272
1
18
My script:

code_language.skript:
command /below:
    trigger:
        set {_id} to a random integer between 1 and 1000
        add {_id} to {_test::*}
        set {_test::%{_id}%::date} to now
        message "added"
        set {_id} to a random integer between 1 and 1000
        add {_id} to {_test::*}
        set {_test::%{_id}%::date} to now
        message "added"
        set {_id} to a random integer between 1 and 1000
        add {_id} to {_test::*}
        set {_test::%{_id}%::date} to now
        message "added"
        broadcast "result:"
        broadcast "%{_test::*}%"
        broadcast "size of: %size of {_test::*}%"

The result is:
100, 82, 500, <none>, <none> and <none>
size of: 6

But it should be:
100, 82, 500
size of: 3

Skript version: Enabling Skript v2.2-dev25

Also clean deleting of the list variable does not work either:

code_language.skript:
        loop {_test::*}:
            delete {_test::%loop-value%::date}
            remove loop-value from {_test::*}
        message "%{_test::*}%"

result is:
<none>,<none> and <none>
but it should be empty result


How would I fix this? Why does it even happen?
 
Last edited:
you are adding 2 things to the list every step so you will end with 6

code_language.skript:
add {_id} to {_test::*}
set {_test::%{_id}%::date} to now
 
But that still doesn't explain the bug when deleting the list variable. The result should not be <none>, <none> and <none>
Also the results should not contain <none> at all, because all values are set.
 
But that still doesn't explain the bug when deleting the list variable. The result should not be <none>, <none> and <none>
Also the results should not contain <none> at all, because all values are set.
That's a known (and already reported) error, instead of delete it, remove the object from the list shouldn't reproduce the same issue.
 
Thanks @Snow-Pyon ! So do I have to worry about these "undeleted" variables that make my database grow over time when deleting as shown in my script or is this only something "cosmetical" and nothing to worry about? I took a look at my database and am unable to find these <none> entries there.
 
Thanks @Snow-Pyon ! So do I have to worry about undeleted variables that make my database grow over time when deleting as shown in my script or is this only something "cosmetical" and nothing to worry about?
Eh, my variables.csv is like 4 GB and I don't have any problems yet.
 
It's not because of the size, I just hate "garbage data" in my database. I want to avoid that!
 
Ok, so this is correct?

code_language.skript:
        loop {test::*}:
            #delete {test::%loop-value%::date}
            remove loop-value from {test::*}
        message "%{test::*}%"

But what happens to the {test::%loop-value%::date} variable? Will it be deleted or will it stay in the database forever? Or how would I remove it correctly?
 
Status
Not open for further replies.