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
so how do you get the line count of a yml list?
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}%" #