Solved /baltop command

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

Trixxer

New Member
Oct 29, 2021
7
0
1
17
can somebody make a baltop command for me, i'd like it appear before 2/11/2021 (british format) 19:30 GMT+1

i'm using 2.5-beta3 and paperspigot 1.16, skellet, sknbeet, skquery and skript-db
 
Last edited:
can somebody make a baltop command for me, i'd like it appear before 2/11/2021 (british format) 19:30 GMT+1

i'm using 2.5-beta3 and paperspigot 1.16, skellet, sknbeet, skquery and skript-db
A ball top using what currency? player's balance?
 
You know, there are many scripts that already do that, and you just have to change the variable?
i tried one of those but i always get a condition error with 'the size of' something idk, plus im using 2.5-beta3 so yeah thats why lmao
 
no its like using {###::*} to get the sorted list to the top 10 highest values (biggest to smallest) (including the plr names)
Code:
function sort(indices: strings, values: numbers, descending: boolean = true) :: strings:
    loop {_indices::*}:
        set {_whole} to rounded down {_values::%loop-index%}
        set {_fraction} to mod({_values::%loop-index%}, 1) * 1E+10
        set {_sort::%{_whole}%.%{_fraction}%::%loop-index%} to loop-value
    loop indices of {_sort::*}:
        loop {_sort::%loop-value%::*}:
            add 1 to {_index}
            set {_final::%{_index}%} to loop-value-2
    return (reversed {_final::*}) if {_descending} is true, else {_final::*}

command /top:
    trigger:
        set {_sorted::*} to sort((indices of {your variable::*}), {your variable::*})
        loop 10 times:
            set {_p} to {_sorted::%loop-number%} parsed as offline player
            send "%loop-number%. %{_p}%: %{your variable::%{_p}%}%"
That should work, change "your variable" to the name of your variable
 
alright, will try it later
[doublepost=1635875318,1635868937][/doublepost]
Code:
function sort(indices: strings, values: numbers, descending: boolean = true) :: strings:
    loop {_indices::*}:
        set {_whole} to rounded down {_values::%loop-index%}
        set {_fraction} to mod({_values::%loop-index%}, 1) * 1E+10
        set {_sort::%{_whole}%.%{_fraction}%::%loop-index%} to loop-value
    loop indices of {_sort::*}:
        loop {_sort::%loop-value%::*}:
            add 1 to {_index}
            set {_final::%{_index}%} to loop-value-2
    return (reversed {_final::*}) if {_descending} is true, else {_final::*}

command /top:
    trigger:
        set {_sorted::*} to sort((indices of {your variable::*}), {your variable::*})
        loop 10 times:
            set {_p} to {_sorted::%loop-number%} parsed as offline player
            send "%loop-number%. %{_p}%: %{your variable::%{_p}%}%"
That should work, change "your variable" to the name of your variable
didnt work, it uses uuids to store data so when i run the command it always appears with <none> for the balance so like this {eco::###} hashtags are the uuid of the player
 
Last edited:
alright, will try it later
[doublepost=1635875318,1635868937][/doublepost]
didnt work, it uses uuids to store data so when i run the command it always appears with <none> for the balance so like this {eco::###} hashtags are the uuid of the player
send your code
 
send your code
2.5-beta3 btw not the latest because yes (paperspigot 1.16) also
Code:
function sort(indices: strings, values: numbers, descending: boolean = true) :: strings:
    loop {_indices::*}:
        set {_whole} to rounded down {_values::%loop-index%}
        set {_fraction} to mod({_values::%loop-index%}, 1) * 1E+10
        set {_sort::%{_whole}%.%{_fraction}%::%loop-index%} to loop-value
    loop indices of {_sort::*}:
        loop {_sort::%loop-value%::*}:
            add 1 to {_index}
            set {_final::%{_index}%} to loop-value-2
    return (reversed {_final::*}) if {_descending} is true, else {_final::*}
 
command /top:
    trigger:
        set {_sorted::*} to sort((indices of {eco::*}), {eco::*})
        loop 10 times:
            set {_p} to {_sorted::%loop-number%} parsed as offline player
            send "%loop-number%. %{_p}%: %{eco::%uuid of {_p}%}%"
 
2.5-beta3 btw not the latest because yes (paperspigot 1.16) also
Code:
function sort(indices: strings, values: numbers, descending: boolean = true) :: strings:
    loop {_indices::*}:
        set {_whole} to rounded down {_values::%loop-index%}
        set {_fraction} to mod({_values::%loop-index%}, 1) * 1E+10
        set {_sort::%{_whole}%.%{_fraction}%::%loop-index%} to loop-value
    loop indices of {_sort::*}:
        loop {_sort::%loop-value%::*}:
            add 1 to {_index}
            set {_final::%{_index}%} to loop-value-2
    return (reversed {_final::*}) if {_descending} is true, else {_final::*}
 
command /top:
    trigger:
        set {_sorted::*} to sort((indices of {eco::*}), {eco::*})
        loop 10 times:
            set {_p} to {_sorted::%loop-number%} parsed as offline player
            send "%loop-number%. %{_p}%: %{eco::%uuid of {_p}%}%"
You said you used uuids to store data so why do you parse as offline player then get uuid again
try this
Code:
command /top:
    trigger:
        set {_sorted::*} to sort((indices of {eco::*}), {eco::*})
        loop 10 times:
            set {_uuid} to {_sorted::%loop-number%}
            set {_p} to {_sorted::%loop-number%} parsed as offline player
            send "%loop-number%. %{_p}%: %{eco::%{_uuid}%}%"
Also please update, you're 10 versions behind.
 
You said you used uuids to store data so why do you parse as offline player then get uuid again
try this
Code:
command /top:
    trigger:
        set {_sorted::*} to sort((indices of {eco::*}), {eco::*})
        loop 10 times:
            set {_uuid} to {_sorted::%loop-number%}
            set {_p} to {_sorted::%loop-number%} parsed as offline player
            send "%loop-number%. %{_p}%: %{eco::%{_uuid}%}%"
Also please update, you're 10 versions behind.
cant because cubedcraft's limitations are really bad
[doublepost=1636306130,1636306078][/doublepost]
You said you used uuids to store data so why do you parse as offline player then get uuid again
try this
Code:
command /top:
    trigger:
        set {_sorted::*} to sort((indices of {eco::*}), {eco::*})
        loop 10 times:
            set {_uuid} to {_sorted::%loop-number%}
            set {_p} to {_sorted::%loop-number%} parsed as offline player
            send "%loop-number%. %{_p}%: %{eco::%{_uuid}%}%"
Also please update, you're 10 versions behind.
anyways it worked aweusm ty