#Create Very Long List

1 messages · Page 1 of 1 (latest)

devout pagoda
#

I'm trying to define a long list, but there is an error message that says it is too long, and then the server crashes.

[10:48:24 INFO]:     There was a StackOverFlowError occurred when loading a node. This maybe from your scripts, aliases or Skript configuration.
[10:48:24 INFO]:     Please make your script lines shorter! Do NOT report this to SkriptLang unless it occurs with a short script line or built-in aliases!
[10:48:24 INFO]:     
[10:48:24 INFO]:     Updating your Java and/or using respective 64-bit versions for your operating system may also help and is always a good practice.
[10:48:24 INFO]:     If it is still not fixed, try moderately increasing the thread stack size (-Xss flag) in your startup script.
[10:48:24 INFO]:     
[10:48:24 INFO]:     Using a different Java Virtual Machine (JVM) like OpenJ9 or GraalVM may also help; though be aware that not all plugins may support them.
[10:48:24 INFO]:     
[10:48:24 INFO]:     Line that caused the issue:
                         # super long list here

List is defined like this:

set {_mylist::*} to "a", "b", "c", ...

I couldn't figure out how to define the list using multiple lines like this

set {_mylist::*} to "a",
    "b",
    "c",
    ...

Addons: skript, skbee, skript gui, lusk, skquery

languid niche
#

what is the list being made of

devout pagoda
#

its strings like "emoji|<emoji>"

languid niche
#

why not store that externally in another form

#

such as yml or json

devout pagoda
#

ok, i'll try to figure that out

#

how do i read a file, do i need to add another addon?
i dont see anything on skript hub with the addons i am using.

languid niche
#

if you use an addon like skjson you can easily read and write json files

devout pagoda
#

there is a huge error in the console on the line
set {_json} to json from file "plugins/skript/emojis.json"

edit: might be because the json doesnt have key/value pairs
nope, still doesnt work

devout pagoda
#

something went horribly wrong with skript

queen reef
#

i'm the dev

#

of that addon

devout pagoda
#

ok

queen reef
#

show me the file

#

basically skjson said you pass null params.

devout pagoda
#

set {_json} to json from file "plugins/skript/emojis.json"

queen reef
#

okey i figured out

#

gimme sec

#

the file reading works
i guess the issues is in your .json cause of escaping

#

[21:49:01 INFO]: [SkJson] Error cz.coffee.api.gson.stream.MalformedJsonException: Invalid escape sequence at line 4 column 10 path $.1234
[21:49:01 INFO]: [Skript] Successfully reloaded testnew.sk. (7ms)

#

let mte try fix your json

#

Here we go, repaired JSON

queen reef
devout pagoda
#

the error still happens with this json file

{
    "key1": "value1",
    "key2": "value2",
    "key3": "value3"
}

and this skript

command /jsontest:
    permission: op
    trigger:
        set {_json} to json from file "plugins/skript/jsontest.json"

am i doing something wrong?

queen reef
#

i'm actually don't know, did you tried download the jar what i got ya?

devout pagoda
#

I downloaded the json you sent and tried that, and still didnt work
I made a test command with those files above and it still has the error.
Is the line that sets {_json} messed up or something?

queen reef
#

you got any paritucular error?