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.

One line, line graph

Discussion in 'Snippets' started by Pexien, Jun 6, 2019.

  1. Pexien

    Pexien New Member

    Aug 10, 2017
    Likes Received:
    Allows you to graph a one line graph thing, this is very similar to the one used on hypixel to show your progress for minigames.

    Code (Text):
    1. options:
    2.     line plotter: ■
    3.     color scheme: &e
    5. function lineGraph(length: integer = 10, percent: number) :: text:
    6.     set {_graph} to "&8["
    7.     set {_values} to rounded ({_length}/100)*(rounded {_percent})
    8.     loop {_length} times:
    9.         loop-number <= {_values}:
    10.             set {_graph} to "%{_graph}%&e{@line plotter}"
    11.         else:
    12.             set {_graph} to "%{_graph}%&7{@line plotter}"
    13.     set {_graph} to "%{_graph}%&8]"
    14.     return {_graph}

    Attached Files:

    Farid, MeHow and ShaneBee like this.

Share This Page