[Solved] [Skript] How to make some symbol to size of characters

Discussion in 'Skript' started by Fathur, Apr 2, 2020.

Thread Status:
Not open for further replies.
  1. I trying to make some symbol to size of characters.
    Can somebody help?

    Code (Text):

    command /tps:
        trigger:
            set {_tps} to tps
            set {_tpsGood} to "&a■"
            set {_tpsBad} to "&c■"
            set {_tpsTotal} to 20 - tps
            if {_tps} is between 19 and 20:
                send "&6Server TPS: &a%tps% &e[&a■■■■■■■■■■■■■■■■■■■■&e]"
            if {_tps} is between 18 and 19:
                send "&6Server TPS: &a%tps% &e[&a■■■■■■■■■■■■■■■■■■■&c■&e]"
            if {_tps} is between 17 and 18:
                send "&6Server TPS: &a%tps% &e[&a■■■■■■■■■■■■■■■■■■&c■■&e]"
            if {_tps} is between 16 and 17:
                send "&6Server TPS: &a%tps% &e[&a■■■■■■■■■■■■■■■■■&c■■■&e]"
            if {_tps} is between 15 and 16:
                send "&6Server TPS: &a%tps% &e[&a■■■■■■■■■■■■■■■■&c■■■■&e]"
            if {_tps} is between 14 and 15:
                send "&6Server TPS: &a%tps% &e[&a■■■■■■■■■■■■■■■&c■■■■■&e]"
            if {_tps} is between 13 and 14:
                send "&6Server TPS: &a%tps% &e[&a■■■■■■■■■■■■■■&c■■■■■■&e]"
            if {_tps} is between 12 and 13:
                send "&6Server TPS: &a%tps% &e[&a■■■■■■■■■■■■■&c■■■■■■■&e]"
            if {_tps} is between 11 and 12:
                send "&6Server TPS: &a%tps% &e[&a■■■■■■■■■■■■&c■■■■■■■■&e]"
            if {_tps} is between 10 and 11:
                send "&6Server TPS: &a%tps% &e[&a■■■■■■■■■■■&c■■■■■■■■■&e]"
            if {_tps} is between 9 and 10:
                send "&6Server TPS: &a%tps% &e[&a■■■■■■■■■■&c■■■■■■■■■■&e]"
            if {_tps} is between 8 and 9:
                send "&6Server TPS: &a%tps% &e[&a■■■■■■■■■&c■■■■■■■■■■■&e]"
            if {_tps} is between 7 and 8:
                send "&6Server TPS: &a%tps% &e[&a■■■■■■■■&c■■■■■■■■■■■■&e]"
            if {_tps} is between 6 and 7:
                send "&6Server TPS: &a%tps% &e[&a■■■■■■■&c■■■■■■■■■■■■■&e]"
            if {_tps} is between 5 and 6:
                send "&6Server TPS: &a%tps% &e[&a■■■■■■&c■■■■■■■■■■■■■■&e]"
            if {_tps} is between 4 and 5:
                send "&6Server TPS: &a%tps% &e[&a■■■■■&c■■■■■■■■■■■■■■■&e]"
            if {_tps} is between 3 and 4:
                send "&6Server TPS: &a%tps% &e[&a■■■■&c■■■■■■■■■■■■■■■■&e]"
            if {_tps} is between 2 and 3:
                send "&6Server TPS: &a%tps% &e[&a■■■&c■■■■■■■■■■■■■■■■■&e]"
            if {_tps} is between 1 and 2:
                send "&6Server TPS: &a%tps% &e[&a■■&c■■■■■■■■■■■■■■■■■■&e]"
            if {_tps} is between 0 and 1:
                send "&6Server TPS: &a%tps% &e[&a■&c■■■■■■■■■■■■■■■■■■■&e]"
            stop
     
    I want to make it simple, so I don't need any if else again.
    I try to make it with loop, but I think that wasn't possible to make just 1 line message.
     
    #1 Fathur, Apr 2, 2020
    Last edited: Apr 2, 2020
  2. save text to variable, then you can have it one line
    set {_symbol} to ""
    set {_nsymbol} to ""
    set {_tps} to tps/2
    loop {_tps} times:
    set {_symbol} to "%{_symbol}%&a■"

    loop (difference between {_tps} and 10) times:
    set {_nsymbol} to "%{_nsymbol}%&c■"


    send formatted "%{_symbol}%%{_nsymbol}%"

    try, I didn't test
     
    • Agree Agree x 1
  3. The syntax printing only "&a■■■■■■■■■■"
    Not the size of TPS.

    BTW How to summon @ShaneBee [https://www.spigotmc.org/members/shanebee.226272/]?
    But I'll try your code.
     
  4. Ah finally I made it
    Thx for tutorial @Govindas

    Here the code if someone need it.
    Code (YAML):

    command /tps
    :
        trigger
    :
           set {_g} to ""
            set {_r} to ""
            set {_tps} to tps
            set {_bad} to 20 - {_tps}
            loop {_tps} times
    :
               set {_g} to "%{_g}%&a■"
            loop {_bad} times
    :
               set {_r} to "%{_r}%&c■"
            send "&6Server TPS
    : &a%tps% &6[%{_g}%%{_r}%&6]"
            stop
     
     
    • Like Like x 1
Thread Status:
Not open for further replies.