Solved Reloading Skript without kicking people?

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

Adrihun

Member
Feb 1, 2017
368
6
0
So i made a simple reload script for skript. whenever an admin types in /reloadd, it will do
"make console execute command sk reload all".

My scripts are big and it takes like 50 seconds to reload them all. Around 20-40 seconds, players get kicked for
"Timed Out". Is it possible to reload Skript, while still keeping the players on?

Thanks
 
So i made a simple reload script for skript. whenever an admin types in /reloadd, it will do
"make console execute command sk reload all".

My scripts are big and it takes like 50 seconds to reload them all. Around 20-40 seconds, players get kicked for
"Timed Out". Is it possible to reload Skript, while still keeping the players on?

Thanks
The size of the skript barely changes load time. It's your server that can't keep up with it. Players are kicked because the server slows down significantly or crashes... get a better server / more RAM and storage.
 
isn't the /reload used to reloads all plugins? it's a "vanilla" spigot command.
[doublepost=1495569758,1495569725][/doublepost]You don't need to create a skript for a command to reload all scripts.
Use "/skript reload scripts"
 
So i made a simple reload script for skript. whenever an admin types in /reloadd, it will do
"make console execute command sk reload all".

My scripts are big and it takes like 50 seconds to reload them all. Around 20-40 seconds, players get kicked for
"Timed Out". Is it possible to reload Skript, while still keeping the players on?

Thanks
You could split them all into smaller scripts, but there's no guarantee that will work. Anyway, if your not on a test server you're scripts should never have to be reloaded besides on startup

EDIT: You could also write your scripts better
 
@ThinkingAboutIt I'm making that command, so I can add things to it like sounds, titles, broadcast in chat and more...
[doublepost=1495572627,1495572577][/doublepost]@Pikachu It's not my fault that i add a sound to my script (Skellett sound), and it takes +5 seconds to boot up.
 
@ThinkingAboutIt I'm making that command, so I can add things to it like sounds, titles, broadcast in chat and more...
[doublepost=1495572627,1495572577][/doublepost]@Pikachu It's not my fault that i add a sound to my script (Skellett sound), and it takes +5 seconds to boot up.
Storage is probably the problem then. How many useless plugins & variables have you got..?
 
Some syntax makes the Skript parser so slow, as an example, the sound effect of Skellett (by the way, @LimeGlass you should fix that, I think @Sashie knew a way to override that issue, you may ask him how to). Try removing those laggy effects/expressions.
 
@Snow-Pyon Most of Skellett's Syntax are optimized for max reload speeds, also the fact that you will be able to edit them soon makes it even faster with your configurations (Example of this being my AdvancementsAddon). The only syntax currently with really bad reload times are Sounds, Titles and some other syntax that are designed to match syntax of others. I know about Sashie's method already, I was the one to reach out to everyone and ask if there was a solution to laggy syntax. The method Sashie uses is basically reading the syntax manually in a class, then test for what the user has used.

I have a 1300+ lined sg script with lots of sounds, without the sounds it takes a second to reload, with it; it only takes like 5 seconds. The only addons I use are Skellett and SkQuery by the way to anyone reading this.

The fact that syntax lag apon starting/reloading is a major Skript flaw and Bensku has voluntarily tried countless times to fix this <3 Hopefully he/someone will find a solution one day.

Side note:
Building an addon around this technique would be an interesting experiment.
@xXAndrew28Xx Might be up for the task xD (An Umbaska task idk) (PM sashie or I if you would like the test class utilizing this)

I can look into using Sashie's method for the Sound and Title effects. Then again if proper Skript syntax/techniques are used in the script, your reload time shouldn't be that large of a time.

@Adrihun If you send me your entire script in a PM I can optimize it for you, if I have free time. Also can you say what addons you use?
 
Last edited by a moderator:
  • Like
Reactions: Snow-Pyon
To reiterate on the process of `Sashie's method`.... xD

We all know Skripts parser is slow but certain parts of it are fairly quick. For example these different syntax bits (0¦this|1¦that|2¦or_this) or (this|that|or_this)

The first one gets the parser to make essentially 3 different syntax strings with the 3 different ways its made from that input then you differentiate between which 'syntax' it is

The second one simply makes one syntax string with the chosen option, then you just do a simple check for if that string contained `this` , `that` or `or_this`

Although they both seem the same on the outside the second method is way faster in the end
 
Bensku found out the other day that java's string to lowercase or string to uppercase is laggy a bit and that he was casting something to something he shouldn't have been doing. Explains it in Discord. But ya he is going to be fixing the speed times in the nex tupcoming updates.
 
Status
Not open for further replies.