get line count of yml list

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

GewoonQuint

Member
Oct 15, 2017
15
0
0
43
So I'm trying to loop a yml list to get the highest rated player, making a leaderboard.
I use a yml list to store the elo points
code_language.skript:
elo:
  BuildUHC:
    8580db88-d6c3-42a6-81af-0ec6f055ecc8: 979.0
    ff576433-4e28-4e3d-954e-04d967766744: 1021.0
code_language.skript:
        set {_count} to yml value "elo.BuildUHC" of file "plugins/x/playerdata.yml"'s line count
        set {_c} to {_count}
        loop {_count} times:
            set {_current} to file "plugins/xydar/playerdata.yml"'s line {_c}
            remove 1 from {_c}
            set {_value} to subtext of {_current} from 1 to 36
            add {_value} to {_values::*}
        loop {_values::*}:
            set {_arg} to loop-value
            set {_trimmed} to "%(subtext of {_arg} from characters 0 to 8)%%(subtext of {_arg} from characters 10 to 13)%%(subtext of {_arg} from characters 15 to 18)%%(subtext of {_arg} from characters 20 to 23)%%(subtext of {_arg} from characters 25 to 36)%"
            set {_u} to text from "https://api.mojang.com/user/profiles/%{_trimmed}%/names"
            set {_a::*} to {_u} split at """"
            loop {_a::*}:
                loop-value-2 isn't "[{"
                loop-value-2 isn't "name"
                loop-value-2 isn't ":"
                loop-value-2 isn't "}]"
                set {_p} to loop-value-2 parsed as offline player
                message "%{_p}%" #
so how do you get the line count of a yml list?
 
Status
Not open for further replies.