Solved Adding contents of a list to a single text string?

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

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Wynnevir

Well-Known Member
Jul 9, 2017
1,015
62
48
30
Elsewhere
Hello!
I'm trying to take the contents of a list variable (ie; t, e, s, t, n and g) and convert them to a single string (ie; "testing").
I'd like it to be flexible to the size of the list however so I do not have to set it like "%{_list::1}%%{_list::2}%%{_list::3}%" and so on, which is the only way I can think of right now to do it. And that takes away to automation I want with it.

Any idea on how to do this or anything I can try? Been at it a while. Here's the code I have for reference:
Code:
command /splittest:
    trigger:
        set {_sp::*} to split "testing" by every 1 character #This is with Dovias's snippet
        loop {_sp::*}:
            set {_i} to loop-index parsed as integer
            if {_i} is not divisible by 2:
                set {_sp::%{_i}%} to "&6%loop-value%"
            else:
                set {_sp::%{_i}%} to "&e%loop-value%"
        broadcast "%{_sp::*}%"
It takes the text and splits it, then colors every other letter a certain color. This part works perfectly. Now I'm having trouble putting it back together into a single text string.

Thank you!
[doublepost=1602687749,1602568346][/doublepost]I think i just figured this out 5 min before i have to leave for work xD
If anyone knows a neater way to do it by all means~~~
Code:
command /ttt:
    trigger:
        add "t", "e", "s" and "t" to {_s::*}
        set {_a} to 0
        loop {_s::*}:
            if {_a} > 0:
                set {_v} to "%{_v}%%loop-value%"
                add 1 to {_a}
            else:
                set {_v} to loop-value
                add 1 to {_a}
        send "%{_v}%"
 
Status
Not open for further replies.