1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Reloading Skript without kicking people?

Discussion in 'Skript' started by Adrihun, May 23, 2017.

Thread Status:
Not open for further replies.
  1. Adrihun

    Adrihun Member

    Joined:
    Feb 1, 2017
    Messages:
    368
    Likes Received:
    6
    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
     
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    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.
     
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    isn't the /reload used to reloads all plugins? it's a "vanilla" spigot command.
    --- Double Post Merged, May 23, 2017, Original Post Date: May 23, 2017 ---
    You don't need to create a skript for a command to reload all scripts.
    Use "/skript reload scripts"
     
  4. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    @ThinkingAboutIt I got 4GB ram - It takes 40.8 seconds to start all scripts.
    @aescraft I want to create a skript command for the admins so they can reload all scripts easily.
     
  5. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    You're creating an entire command just to save them typing /sk reload all? Lmao, your admins have to be pretty lazy two save a few keys.
     
  6. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    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
     
  7. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    @ThinkingAboutIt I'm making that command, so I can add things to it like sounds, titles, broadcast in chat and more...
    --- Double Post Merged, May 23, 2017, Original Post Date: May 23, 2017 ---
    @Pikachu It's not my fault that i add a sound to my script (Skellett sound), and it takes +5 seconds to boot up.
     
  8. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    Storage is probably the problem then. How many useless plugins & variables have you got..?
     
  9. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    @ThinkingAboutIt

    No Variables
    20 "Useless" plugins (13 of them are addons)
    All of my scripts 177KB
     
  10. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    I have 3.4 mb of scripts and 4gb RAM.. Maybe split up the scripts and not bunch mechanisms up in one or two files?
     
  11. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    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.
     
  12. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    @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?
     
    #12 ShaneBee, May 24, 2017
    Last edited by a moderator: May 24, 2017
    • Like Like x 1
  13. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    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
     
  14. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    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.
     
    • Winner Winner x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...