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!

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

Hiring Need a Skript Addon done: Sorting Lists

Discussion in 'Hiring' started by pepper82, Oct 8, 2020.

  1. pepper82

    pepper82 Member

    Joined:
    Jan 26, 2017
    Messages:
    272
    Likes Received:
    1
    Person: PN me, no discord, been around here for some years
    About: I've been looking for someone to hire to make this for a while and nobody's been able to yet, so I'm asking on here now.
    Perm or temp: Temporary, I just need the one skript addon.
    Basic idea of request:
    In order for me to make toplists for several minigames, I need somebody to write a skript addon that allows me to sort lists like this:

    Code (Text):
    1.  
    2. # Simple List with players and scores:
    3.  
    4. add "player1" to {_list::*}
    5. add "player2" to {_list::*}
    6. add "player3" to {_list::*}
    7. set {_list::player1} to 100
    8. set {_list::player2} to 200
    9. set {_list::player3} to 20
    10.  
    11. # Now here comes the magic, that I need to be done:
    12.  
    13. set {_newlist::*} to numerical sorted list by value descending {_list::*}
    14.  
    15. # output
    16. loop {_newlist::*}:
    17.   message "%loop-index% %loop-value%"
    18.  
    19. # Result:
    20. # player2 200
    21. # player1 100
    22. # player3 20
    23.  
    Also other sorting options will be:
    set {_newlist::*} to alphabetically sorted list by value [descending/ascending] {_list::*}
    set {_newlist::*} to numerical sorted list by index [descending/ascending] {_list::*}
    set {_newlist::*} to alphabetically sorted list by index [descending/ascending] {_list::*}

    # the syntax is optional and up to you

    Budget/offer: Please tell me the price it would cost to do this and I can pay upfront.

    Timeframe: Within a week or two would be good, if you need more time than that it's okay.
     
  2. Hexay

    Hexay Member

    Joined:
    Oct 14, 2020
    Messages:
    3
    Likes Received:
    0
    I understand this isn't entirely what you are looking for, but what you can do with this is simply change some of the variables, then in the gui just add a couple of if statement to order them, for this I would simply focus on the concept as it's not hard to code. Obviously no payment for this.
    Code (Text):
    1. command /prestigetop:
    2.   trigger:
    3.     send " "
    4.     send "&b&lPrestige Top:"
    5.     send "&3%{prestigetopshow.1}%"
    6.     send "&3%{prestigetopshow.2}%"
    7.     send "&3%{prestigetopshow.3}%"
    8.     send "&3%{prestigetopshow.4}%"
    9.     send "&3%{prestigetopshow.5}%"
    10.     send " "
    11. command /setlb:
    12.   permission: op
    13.   trigger:
    14.     set {prestigetop.5} to 0
    15.     set {prestigetop.4} to 0
    16.     set {prestigetop.3} to 0
    17.     set {prestigetop.2} to 0
    18.     set {prestigetop.1} to 0
    19.     send "&b&lSet lb's"
    20.  
    21. every 5 seconds:
    22.   loop all players:
    23.     leaderboard(loop-player)
    24.  
    25. function leaderboard(p: player):
    26.   set {_uuid} to {_p}'s uuid
    27.   if {prestigecounter::%{_uuid}%} is greater than {prestigetop.5}:
    28.     if {prestigecounter::%{_uuid}%} is smaller than {prestigetop.4}:
    29.       set {prestigetop.5} to {prestigecounter::%{_uuid}%}
    30.       set {prestigetopshow.5} to "##5 %{_p}% %{prestigetop.5}%"
    31.     if {prestigecounter::%{_uuid}%} is greater than {prestigetop.4}:
    32.       if {prestigecounter::%{_uuid}%} is smaller than {prestigetop.3}:
    33.         set {prestigetop.4} to {prestigecounter::%{_uuid}%}
    34.         set {prestigetopshow.4} to "##4 %{_p}% %{prestigetop.4}%"
    35.       if {prestigecounter::%{_uuid}%} is greater than {prestigetop.3}:
    36.         if {prestigecounter::%{_uuid}%} is smaller than {prestigetop.2}:
    37.           set {prestigetop.3} to {prestigecounter::%{_uuid}%}
    38.           set {prestigetopshow.3} to "##3 %{_p}% %{prestigetop.3}%"
    39.         if {prestigecounter::%{_uuid}%} is greater than {prestigetop.2}:
    40.           if {prestigecounter::%{_uuid}%} is smaller than {prestigetop.1}:
    41.             set {prestigetop.2} to {prestigecounter::%{_uuid}%}
    42.             set {prestigetopshow.2} to "##2 %{_p}% %{prestigetop.2}%"
    43.           if {prestigecounter::%{_uuid}%} is greater than {prestigetop.1}:
    44.             set {prestigetop.1} to {prestigecounter::%{_uuid}%}
    45.             set {prestigetopshow.1} to "##1 %{_p}% %{prestigetop.1}%"
    46.             set {_vartesting} to "pass"
    47.  
    48.  
    49. command /prestigetest:
    50.   trigger:
    51.     send "%{prestigetop.1}%"
    52.     send "%{prestigetopshow.1}%"
    53.     send "%{_vartesting}%"
    54.  
     

Share This Page

Loading...