Parameter.text question

Hello. I have a Urstrom about the parameter.text.
How can i make, that when i text in the parameter „a“ that i prints: „&1“?

-- Minecraft Bot

-- Use this function to perform your initial setup
function setup()
    parameter.text("TitleText", "a, b, c, d, e", function(x) print("/tell @a", x) end )
    a = "&1"
    b = "&2"
    c = "&3"
    d = "&4"
    e = "&5"
end

-- This function gets called once every frame
function draw()
    -- This sets a dark background color 
    background(40, 40, 50)

    -- This sets the line thickness
    strokeWidth(5)

    -- Do your drawing here
end

function touched(touch)
    print("/tell @a", x)
end

Sorry for my English…

Does is need a command for this ore something else?

@Biberjumper Can you tell me all the things you want to do and I can give you a better example of how to do it.

@Biberjumper Here’s one way to do it. Depending on how you want the results, this can be modified more. You can key either abcde or a,b,c,d,e . I don’t know if you want the “,” after each letter or not. If you don’t want the “,” after each letter, then remove the …”,” from the str=str…tab[v]…”,” statement.

-- Minecraft Bot

function setup()
    tab={a="&1",b="&2",c="&3",d="&4",e="&5"}
    parameter.text("TitleText",prt)
    
end

function prt()
    output.clear()
    str=""
    for z=1,#TitleText do
        v=string.sub(TitleText,z,z)
        if tab[v]~=nil then
            str=str..tab[v]..","
        end
    end
    print(str)
end 

function draw()
    background(40, 40, 50)
end

Ok thank‘s al lot!

How can i Coppy the „Ausgabe“?

Dose it give a Command for this?

@Biberjumper I don’t know what the Ausgabe is. I tried doing a translation and the closest word I got was output. If it is output, I’m not sure what you want to do because what prints as output is in the variable str. So you can copy str.

@Biberjumper Not sure if this is what you’re after. When you key a,b,c, in the text area, you print &1, &2, &3 .

-- Minecraft Bot

function setup()
    tab={a="&1",b="&2",c="&3",d="&4",e="&5"}
    parameter.text("TitleText",prt)
end

function prt()
    if tab[TitleText]~=nil then
        print(tab[TitleText])
    end
end 

function draw()
    background(40, 40, 50)
end

Thank you! Can i make it also like this: when i write „a, b, c“ in the parameter, it will send back: „&1 &2 &3“?

@Biberjumper Yes you can, but you’ll have to read the TitleText and separate each entry. I don’t have time right now cause I’m leaving, but I’ll give an example later if no one does it by then.