Help with decoding text object separated by separator

…why am I posting this topic chat :sob:

anyways, I need help on searching for a guide that helps with decoding a text object with a certain format. My brain’s not braining, I cant think of the search terms. Help is 100000% appreciated. thx

-costco

also I hate it when people click in to add a view but do absolutely nothing

edit - maybe I should add that this is for this topic right here: NBT data in GKC? (Pseudo-Items)

2 Likes

can you explain so it is easier to comprehend

2 Likes

What do you mean, “decoding a text object”?
If it seems easy enough to do, I can make it myself and show it to you.

its bc ppl just dont have ideas for it dude, they dont see the whole topic through the title..

1 Like

So I have some text that is separated by a separator, and I need it to act like a list in text.
So index grabbing basically.

you you want the text to be together?
Im not smart enough bro

do you mean if a player interacts with a text, it changes a symbol/number/letter?

1 Like

umm I can try to help, but I have no idea what this means? explanation need

error_:431_4##5TstrA

1 Like

Here I’ll just
So lets say I have some text
it looks like this:
|item1|item2|item3|item4|
the separator character is |
In theory, with the following python code you can “grab” item2 like it’s a list item:

def substring(txt, sep, sep_idx) -> int:
    sep_amt = 1
    i = 0
    while i+1<len(txt):
        char = txt[i]
        if char == sep:
            if sep_amt == sep_idx:
                return i
            else:
                sep_amt +=1
        i += 1
    

but I can’t find the block to grab like the second |, only the first one

How long is each item in the list? Are they all equal # of characters, or do they vary?

2 Likes

they vary