RandomSK sorting error:

Discussion in 'Skript' started by KroterPvP, May 19, 2017.

  1. Code (skript (Unknown Language)):
    set {_temp::*} to {seco.bal::*} sorted from highest to lowest with output "@index::;@value"
    loop {_temp::*}:
        add 1 to {_}
        if {_} > 15:
            exit loop
        set {_x::*} to loop-value split at "::;"
        send "%{_x::1}%: %{_x::2}%€"
     
    I have this error:
    Code (skript (Unknown Language)):
    [23:59:24 ERROR]: '::*} sorted from highest to lowest with output "@index::@value"' is not a valid item data (SuperEconomy.sk, line 36: set {_temp::*} to {seco.bal::*} sorted from highest to lowest with output "@index::@value"')
    I'm trying using this code to test it:
    Code (skript (Unknown Language)):
    command /toplist:
        trigger:
            set {kills::1} to 10
            set {kills::2} to 5
            set {kills::3} to 2
            set {_toplist::*} to sorted {kills::*} from highest to lowest with output "@index has killed a total of @value"
            message "Top Kills:"
            loop {_toplist::*}:
                message "%loop-index%: %loop-value%"
    And this is the error shown in console:
    Code (skript (Unknown Language)):
    An international error has ocurred message in chat
    And this error in console:
    [00:05:04 INFO]: [Skript] Encountered 1 error while reloading the config and all scripts!
    [00:05:08 ERROR]: #!#!
    [00:05:08 ERROR]: #!#! [Skript] Severe Error:
    [00:05:08 ERROR]: #!#!
    [00:05:08 ERROR]: #!#! If you're developing an add-on for Skript this likely means that you have done something wrong.
    [00:05:08 ERROR]: #!#! If you're a server admin however please go to https://github.com/bensku/Skript/issues/
    [00:05:08 ERROR]: #!#! and check whether this error has already been reported.
    [00:05:08 ERROR]: #!#! If not please create a new ticket with a meaningful title, copy & paste this whole error into it (or use paste service),
    [00:05:08 ERROR]: #!#! and describe what you did before it happened and/or what you think caused the error.
    [00:05:08 ERROR]: #!#! If you think that it's a trigger that's causing the error please post the trigger as well.
    [00:05:08 ERROR]: #!#! By following this guide fixing the error should be easy and done fast.
    [00:05:08 ERROR]: #!#!
    [00:05:08 ERROR]: #!#! Stack trace:
    [00:05:08 ERROR]: #!#! ch.njol.skript.SkriptAPIException: UnparsedLiterals must be converted before use
    [00:05:08 ERROR]: #!#!     at ch.njol.skript.lang.UnparsedLiteral.invalidAccessException(UnparsedLiteral.java:273)
    [00:05:08 ERROR]: #!#!     at ch.njol.skript.lang.UnparsedLiteral.getAll(UnparsedLiteral.java:283)
    [00:05:08 ERROR]: #!#!     at ch.njol.skript.expressions.ExprSortedList.get(ExprSortedList.java:67)
    [00:05:08 ERROR]: #!#!     at ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:103)
    [00:05:08 ERROR]: #!#!     at ch.njol.skript.effects.EffChange.execute(EffChange.java:268)
    [00:05:08 ERROR]: #!#!     at ch.njol.skript.lang.Effect.run(Effect.java:52)
    [00:05:08 ERROR]: #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61)
    [00:05:08 ERROR]: #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:89)
    [00:05:08 ERROR]: #!#!     at ch.njol.skript.lang.Trigger.execute(Trigger.java:55)
    [00:05:08 ERROR]: #!#!     at ch.njol.skript.command.ScriptCommand.execute2(ScriptCommand.java:220)
    [00:05:08 ERROR]: #!#!     at ch.njol.skript.command.ScriptCommand.execute(ScriptCommand.java:182)
    [00:05:08 ERROR]: #!#!     at ch.njol.skript.command.Commands.handleCommand(Commands.java:268)
    [00:05:08 ERROR]: #!#!     at ch.njol.skript.command.Commands$1.onPlayerCommand(Commands.java:163)
    [00:05:08 ERROR]: #!#!     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [00:05:08 ERROR]: #!#!     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    [00:05:08 ERROR]: #!#!     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    [00:05:08 ERROR]: #!#!     at java.lang.reflect.Method.invoke(Unknown Source)
    [00:05:08 ERROR]: #!#!     at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306)
    [00:05:08 ERROR]: #!#!     at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
    [00:05:08 ERROR]: #!#!     at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502)
    [00:05:08 ERROR]: #!#!     at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487)
    [00:05:08 ERROR]: #!#!     at net.minecraft.server.v1_8_R3.PlayerConnection.handleCommand(PlayerConnection.java:1154)
    [00:05:08 ERROR]: #!#!     at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:997)
    [00:05:08 ERROR]: #!#!     at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:45)
    [00:05:08 ERROR]: #!#!     at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:1)
    [00:05:08 ERROR]: #!#!     at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13)
    [00:05:08 ERROR]: #!#!     at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    [00:05:08 ERROR]: #!#!     at java.util.concurrent.FutureTask.run(Unknown Source)
    [00:05:08 ERROR]: #!#!     at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44)
    [00:05:08 ERROR]: #!#!     at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:715)
    [00:05:08 ERROR]: #!#!     at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374)
    [00:05:08 ERROR]: #!#!     at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654)
    [00:05:08 ERROR]: #!#!     at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557)
    [00:05:08 ERROR]: #!#!     at java.lang.Thread.run(Unknown Source)
    [00:05:08 ERROR]: #!#!
    [00:05:08 ERROR]: #!#! Version Information:
    [00:05:08 ERROR]: #!#!   Skript: 2.2-dev27
    [00:05:08 ERROR]: #!#!   Bukkit: 1.8.8-R0.1-SNAPSHOT
    [00:05:08 ERROR]: #!#!   Minecraft: 1.8.8
    [00:05:08 ERROR]: #!#!   Java: 1.8.0_131 (Java HotSpot(TM) 64-Bit Server VM 25.131-b11)
    [00:05:08 ERROR]: #!#!   OS: Windows 10 amd64 10.0
    [00:05:08 ERROR]: #!#!
    [00:05:08 ERROR]: #!#! Running CraftBukkit: false
    [00:05:08 ERROR]: #!#!
    [00:05:08 ERROR]: #!#! Current node: null
    [00:05:08 ERROR]: #!#! Current item: set {_toplist::*}(as java.lang.Object) to sorted list
    [00:05:08 ERROR]: #!#!
    [00:05:08 ERROR]: #!#! Thread: Server thread
    [00:05:08 ERROR]: #!#!
    [00:05:08 ERROR]: #!#! End of Error.
    [00:05:08 ERROR]: #!#!
    I'm using RandomSK 2.7, spigot 1.8.8 in localhost.
     
  2. Try RandomSk 2.7.1 also Bensku's edit has this sorting feature so there is no need for RandomSk anymore. It's old now.

    The UnparsedLiterals must be converted before use error is basically an unhandled error that Skript doesn't know what it is.

    It might be conflicting with Bensku's sorting syntax which is:
    Code (Text):
    set {_this::*} to sorted {_stuff::*}
     
    • Agree Agree x 1
  3. Fixed, thanks :)
     
    • Like Like x 1
  4. Sorry for the bump but I needed this, Bensku's sorting doesn't include indexes only sort the values which in my case top kill will be sorted as numbers but without players
     
  5. First, thanks for the response,
    second, I used to use the first method (link 1) but sometimes after a long time it starts to become crazy! like it sorts 500 then 502 then 490 for example, also I checked the code and if 2 players have the same value the player name will be 1 of them and not both sorted.

    About the second method (sorted {variable::*}) it doesn't include variable indexes which causes the player name to be missing but numbers are sorted and here I've been trying since yesterday before I sleep for a way to keep the names and sort the numbers but I'm still trying :D

    Also the second method contains another solution made by Snow-Pyon, I haven't tested it yet but I'm not sure if it will work with all kind of top sorting idk yet, i will try it and see.

    Currently the best solution is (sorted {variable::*}) but I'm trying to find a way to include names with the sorting.
     
  6. I have this code in my server for sorting, I just directly copied it, you can edit it to your liking:
    Code (Text):


    command /showtopany [<text>]:
        trigger:
            set {_arg} to arg 1
            set {_split::*} to {_arg} split at " "
            loop {_split::*}:
                replace all "_" with " " in {_split::%loop-index%}
            set {_variable} to colored {_split::1}
            set {_title} to colored {_split::2}
            set {_type} to colored {_split::3}
            send "%{_title}%"
            async:
                loop {%{_variable}%::*}:
                    difference between {lastlogin.%loop-index%} and now is less than 90 days
                    add 1 to {_size}
                    if {_sort::%loop-value%} is not set:
                        set {_sort::%loop-value%} to loop-index
                    else if {_sort::%loop-value%.%{_size}%} is not set:
                        set {_sort::%loop-value%.%{_size}%} to loop-index
                loop 10 times:
                    set {_element} to last element of {_sort::*}
                    remove {_element} from {_sort::*}
                    set {_sorted::%loop-number%} to {_element}
                set {_finished} to true
            while {_finished} is not set:
                add 1 to {_ticks}
                if {_ticks} is higher than 100:
                    stop
                wait a tick
            loop {_sorted::*}:
                {name::%loop-value%} is not set:
                    set {name::%loop-value%} to offline player from uuid loop-value
                send "&a&lTOP &e&l%loop-index% &a%{name::%loop-value%}% &6- &e&l%rounded {%{_variable}%::%loop-value%}% %{_type}%"
                if {_result} is 10:
                    stop
     
    this code displays top10 players and works good with even sorting 2k variables lagless
     
  7. Looks nice tbh, but what should I put in arg-1? a variable like {test::kills::*} also what should the stored data of the variable look like?
    add player to {test::kills::*}
    add 1 to {test::kills::%player%}

    Should it be like this?
     
  8. with my code it's always %player's uuid% and there is {name::%player's uuid%} variable set to name of player to get name of player's uuid displayed, other than that, yes it's correct, here's example of command usage:
    /showtopany daysinarow &a&lTOP_Players_in_&e&lUniverse &6Days_logged_in_a_row

    daysinarow = {daysinarow::*}
     
    • Useful Useful x 1