################
# > Holowriter: Convert a word in chat into holograms instantly.
# > How to use: Spawn it and write a word in chat. There is a holo limit so keep the words short.
################

@name Holowriter
@persist Letters:table
@persist LettersPos:table LettersSca:table LettersAng:table
@persist I II Ang:angle

if (first()|duped()) {

Letters["A",number]=4
Letters["B",number]=5
Letters["C",number]=3
Letters["D",number]=4
Letters["E",number]=4
Letters["F",number]=3
Letters["G",number]=5
Letters["H",number]=3
Letters["I",number]=3
Letters["J",number]=3
Letters["K",number]=3
Letters["L",number]=2
Letters["M",number]=4
Letters["N",number]=3
Letters["O",number]=4
Letters["P",number]=4
Letters["Q",number]=5
Letters["R",number]=5
Letters["S",number]=5
Letters["T",number]=2
Letters["U",number]=3
Letters["V",number]=2
Letters["W",number]=4
Letters["X",number]=2
Letters["Y",number]=2
Letters["Z",number]=3

LettersPos["",vector]=vec()
LettersSca["",vector]=vec()
LettersAng["",angle]=ang()
LettersPos["A1",vector]=vec(12,30,0)
LettersSca["A1",vector]=vec(4,1,1)
LettersAng["A1",angle]=ang(-0,90,0)
LettersPos["A2",vector]=vec(48,30,0)
LettersSca["A2",vector]=vec(4,1,1)
LettersAng["A2",angle]=ang(-0,270,0)
LettersPos["A3",vector]=vec(30,60,0)
LettersSca["A3",vector]=vec(2,1,1)
LettersAng["A3",angle]=ang(-0,0,0)
LettersPos["A4",vector]=vec(30,24,0)
LettersSca["A4",vector]=vec(2,1,1)
LettersAng["A4",angle]=ang(-0,0,0)
LettersPos["B1",vector]=vec(12,36,0)
LettersSca["B1",vector]=vec(5,1,1)
LettersAng["B1",angle]=ang(-0,90,0)
LettersPos["B2",vector]=vec(30,54,0)
LettersSca["B2",vector]=vec(4.1622776601684,1,1)
LettersAng["B2",angle]=ang(-0,341.56506347656,0)
LettersPos["B3",vector]=vec(30,42,0)
LettersSca["B3",vector]=vec(4.1622776601684,1,1)
LettersAng["B3",angle]=ang(-0,198.43495178223,0)
LettersPos["B4",vector]=vec(30,30,0)
LettersSca["B4",vector]=vec(4.1622776601684,1,1)
LettersAng["B4",angle]=ang(-0,341.56506347656,0)
LettersPos["B5",vector]=vec(30,18,0)
LettersSca["B5",vector]=vec(4.1622776601684,1,1)
LettersAng["B5",angle]=ang(-0,198.43495178223,0)
LettersPos["C1",vector]=vec(12,36,0)
LettersSca["C1",vector]=vec(5,1,1)
LettersAng["C1",angle]=ang(-0,90,0)
LettersPos["C2",vector]=vec(36,12,0)
LettersSca["C2",vector]=vec(3,1,1)
LettersAng["C2",angle]=ang(-0,0,0)
LettersPos["C3",vector]=vec(36,60,0)
LettersSca["C3",vector]=vec(3,1,1)
LettersAng["C3",angle]=ang(-0,0,0)
LettersPos["D1",vector]=vec(12,36,0)
LettersSca["D1",vector]=vec(5,1,1)
LettersAng["D1",angle]=ang(-0,90,0)
LettersPos["D2",vector]=vec(30,18,0)
LettersSca["D2",vector]=vec(4.1622776601684,1,1)
LettersAng["D2",angle]=ang(-0,18.434947967529,0)
LettersPos["D3",vector]=vec(30,54,0)
LettersSca["D3",vector]=vec(4.1622776601684,1,1)
LettersAng["D3",angle]=ang(-0,341.56506347656,0)
LettersPos["D4",vector]=vec(48,36,0)
LettersSca["D4",vector]=vec(3,1,1)
LettersAng["D4",angle]=ang(-0,270,0)
LettersPos["E1",vector]=vec(12,36,0)
LettersSca["E1",vector]=vec(5,1,1)
LettersAng["E1",angle]=ang(-0,90,0)
LettersPos["E2",vector]=vec(36,12,0)
LettersSca["E2",vector]=vec(3,1,1)
LettersAng["E2",angle]=ang(-0,0,0)
LettersPos["E3",vector]=vec(36,60,0)
LettersSca["E3",vector]=vec(3,1,1)
LettersAng["E3",angle]=ang(-0,0,0)
LettersPos["E4",vector]=vec(30,36,0)
LettersSca["E4",vector]=vec(2,1,1)
LettersAng["E4",angle]=ang(-0,0,0)
LettersPos["F1",vector]=vec(12,36,0)
LettersSca["F1",vector]=vec(5,1,1)
LettersAng["F1",angle]=ang(-0,90,0)
LettersPos["F2",vector]=vec(36,60,0)
LettersSca["F2",vector]=vec(3,1,1)
LettersAng["F2",angle]=ang(-0,0,0)
LettersPos["F3",vector]=vec(30,36,0)
LettersSca["F3",vector]=vec(2,1,1)
LettersAng["F3",angle]=ang(-0,0,0)
LettersPos["G1",vector]=vec(12,36,0)
LettersSca["G1",vector]=vec(5,1,1)
LettersAng["G1",angle]=ang(-0,90,0)
LettersPos["G2",vector]=vec(30,12,0)
LettersSca["G2",vector]=vec(2,1,1)
LettersAng["G2",angle]=ang(-0,0,0)
LettersPos["G3",vector]=vec(36,60,0)
LettersSca["G3",vector]=vec(3,1,1)
LettersAng["G3",angle]=ang(-0,0,0)
LettersPos["G4",vector]=vec(48,18,0)
LettersSca["G4",vector]=vec(2,1,1)
LettersAng["G4",angle]=ang(-0,90,0)
LettersPos["G5",vector]=vec(42,36,0)
LettersSca["G5",vector]=vec(2,1,1)
LettersAng["G5",angle]=ang(-0,180,0)
LettersPos["H1",vector]=vec(12,36,0)
LettersSca["H1",vector]=vec(5,1,1)
LettersAng["H1",angle]=ang(-0,90,0)
LettersPos["H2",vector]=vec(30,36,0)
LettersSca["H2",vector]=vec(2,1,1)
LettersAng["H2",angle]=ang(-0,0,0)
LettersPos["H3",vector]=vec(48,36,0)
LettersSca["H3",vector]=vec(5,1,1)
LettersAng["H3",angle]=ang(-0,270,0)
LettersPos["I1",vector]=vec(30,12,0)
LettersSca["I1",vector]=vec(4,1,1)
LettersAng["I1",angle]=ang(-0,0,0)
LettersPos["I2",vector]=vec(30,36,0)
LettersSca["I2",vector]=vec(3,1,1)
LettersAng["I2",angle]=ang(-0,90,0)
LettersPos["I3",vector]=vec(30,60,0)
LettersSca["I3",vector]=vec(4,1,1)
LettersAng["I3",angle]=ang(-0,0,0)
LettersPos["J1",vector]=vec(30,60,0)
LettersSca["J1",vector]=vec(4,1,1)
LettersAng["J1",angle]=ang(-0,0,0)
LettersPos["J2",vector]=vec(36,30,0)
LettersSca["J2",vector]=vec(4,1,1)
LettersAng["J2",angle]=ang(-0,270,0)
LettersPos["J3",vector]=vec(18,12,0)
LettersSca["J3",vector]=vec(2,1,1)
LettersAng["J3",angle]=ang(-0,0,0)
LettersPos["K1",vector]=vec(12,36,0)
LettersSca["K1",vector]=vec(5,1,1)
LettersAng["K1",angle]=ang(-0,270,0)
LettersPos["K2",vector]=vec(30,24,0)
LettersSca["K2",vector]=vec(4.605551275464,1,1)
LettersAng["K2",angle]=ang(-0,146.30993652344,0)
LettersPos["K3",vector]=vec(30,48,0)
LettersSca["K3",vector]=vec(4.605551275464,1,1)
LettersAng["K3",angle]=ang(-0,213.69006347656,0)
LettersPos["L1",vector]=vec(12,36,0)
LettersSca["L1",vector]=vec(5,1,1)
LettersAng["L1",angle]=ang(-0,90,0)
LettersPos["L2",vector]=vec(36,12,0)
LettersSca["L2",vector]=vec(3,1,1)
LettersAng["L2",angle]=ang(-0,0,0)
LettersPos["M1",vector]=vec(12,36,0)
LettersSca["M1",vector]=vec(5,1,1)
LettersAng["M1",angle]=ang(-0,90,0)
LettersPos["M2",vector]=vec(30,60,0)
LettersSca["M2",vector]=vec(2,1,1)
LettersAng["M2",angle]=ang(-0,0,0)
LettersPos["M3",vector]=vec(48,36,0)
LettersSca["M3",vector]=vec(5,1,1)
LettersAng["M3",angle]=ang(-0,270,0)
LettersPos["M4",vector]=vec(30,36,0)
LettersSca["M4",vector]=vec(3,1,1)
LettersAng["M4",angle]=ang(-0,270,0)
LettersPos["N1",vector]=vec(12,36,0)
LettersSca["N1",vector]=vec(5,1,1)
LettersAng["N1",angle]=ang(-0,90,0)
LettersPos["N2",vector]=vec(30,36,0)
LettersSca["N2",vector]=vec(6,1,1)
LettersAng["N2",angle]=ang(-0,306.86990356445,0)
LettersPos["N3",vector]=vec(48,36,0)
LettersSca["N3",vector]=vec(5,1,1)
LettersAng["N3",angle]=ang(-0,90,0)
LettersPos["O1",vector]=vec(12,36,0)
LettersSca["O1",vector]=vec(5,1,1)
LettersAng["O1",angle]=ang(-0,90,0)
LettersPos["O2",vector]=vec(30,60,0)
LettersSca["O2",vector]=vec(2,1,1)
LettersAng["O2",angle]=ang(-0,0,0)
LettersPos["O3",vector]=vec(48,36,0)
LettersSca["O3",vector]=vec(5,1,1)
LettersAng["O3",angle]=ang(-0,270,0)
LettersPos["O4",vector]=vec(30,12,0)
LettersSca["O4",vector]=vec(2,1,1)
LettersAng["O4",angle]=ang(-0,0,0)
LettersPos["P1",vector]=vec(12,36,0)
LettersSca["P1",vector]=vec(5,1,1)
LettersAng["P1",angle]=ang(-0,90,0)
LettersPos["P2",vector]=vec(30,60,0)
LettersSca["P2",vector]=vec(2,1,1)
LettersAng["P2",angle]=ang(-0,0,0)
LettersPos["P3",vector]=vec(48,48,0)
LettersSca["P3",vector]=vec(3,1,1)
LettersAng["P3",angle]=ang(-0,270,0)
LettersPos["P4",vector]=vec(30,36,0)
LettersSca["P4",vector]=vec(2,1,1)
LettersAng["P4",angle]=ang(-0,0,0)
LettersPos["Q1",vector]=vec(12,36,0)
LettersSca["Q1",vector]=vec(5,1,1)
LettersAng["Q1",angle]=ang(-0,90,0)
LettersPos["Q2",vector]=vec(30,60,0)
LettersSca["Q2",vector]=vec(2,1,1)
LettersAng["Q2",angle]=ang(-0,0,0)
LettersPos["Q3",vector]=vec(48,36,0)
LettersSca["Q3",vector]=vec(5,1,1)
LettersAng["Q3",angle]=ang(-0,270,0)
LettersPos["Q4",vector]=vec(30,12,0)
LettersSca["Q4",vector]=vec(2,1,1)
LettersAng["Q4",angle]=ang(-0,180,0)
LettersPos["Q5",vector]=vec(42,18,0)
LettersSca["Q5",vector]=vec(2.4142135623731,1,1)
LettersAng["Q5",angle]=ang(-0,315,0)
LettersPos["R1",vector]=vec(12,36,0)
LettersSca["R1",vector]=vec(5,1,1)
LettersAng["R1",angle]=ang(-0,90,0)
LettersPos["R2",vector]=vec(30,60,0)
LettersSca["R2",vector]=vec(2,1,1)
LettersAng["R2",angle]=ang(-0,0,0)
LettersPos["R3",vector]=vec(48,48,0)
LettersSca["R3",vector]=vec(3,1,1)
LettersAng["R3",angle]=ang(-0,270,0)
LettersPos["R4",vector]=vec(30,36,0)
LettersSca["R4",vector]=vec(2,1,1)
LettersAng["R4",angle]=ang(-0,180,0)
LettersPos["R5",vector]=vec(30,24,0)
LettersSca["R5",vector]=vec(4.605551275464,1,1)
LettersAng["R5",angle]=ang(-0,326.30993652344,0)
LettersPos["S1",vector]=vec(30,12,0)
LettersSca["S1",vector]=vec(4,1,1)
LettersAng["S1",angle]=ang(-0,0,0)
LettersPos["S2",vector]=vec(48,24,0)
LettersSca["S2",vector]=vec(1,1,1)
LettersAng["S2",angle]=ang(90,0,0)
LettersPos["S3",vector]=vec(30,36,0)
LettersSca["S3",vector]=vec(4,1,1)
LettersAng["S3",angle]=ang(-0,180,0)
LettersPos["S4",vector]=vec(12,48,0)
LettersSca["S4",vector]=vec(1,1,1)
LettersAng["S4",angle]=ang(90,0,0)
LettersPos["S5",vector]=vec(30,60,0)
LettersSca["S5",vector]=vec(4,1,1)
LettersAng["S5",angle]=ang(-0,0,0)
LettersPos["T1",vector]=vec(30,60,0)
LettersSca["T1",vector]=vec(4,1,1)
LettersAng["T1",angle]=ang(-0,0,0)
LettersPos["T2",vector]=vec(30,30,0)
LettersSca["T2",vector]=vec(4,1,1)
LettersAng["T2",angle]=ang(-0,270,0)
LettersPos["U1",vector]=vec(12,36,0)
LettersSca["U1",vector]=vec(5,1,1)
LettersAng["U1",angle]=ang(-0,270,0)
LettersPos["U2",vector]=vec(30,12,0)
LettersSca["U2",vector]=vec(2,1,1)
LettersAng["U2",angle]=ang(-0,0,0)
LettersPos["U3",vector]=vec(48,36,0)
LettersSca["U3",vector]=vec(5,1,1)
LettersAng["U3",angle]=ang(-0,270,0)
LettersPos["V1",vector]=vec(18,36,0)
LettersSca["V1",vector]=vec(5.1231056256177,1,1)
LettersAng["V1",angle]=ang(-0,284.03625488281,0)
LettersPos["V2",vector]=vec(42,36,0)
LettersSca["V2",vector]=vec(5.1231056256177,1,1)
LettersAng["V2",angle]=ang(-0,75.963752746582,0)
LettersPos["W1",vector]=vec(12,36,0)
LettersSca["W1",vector]=vec(5,1,1)
LettersAng["W1",angle]=ang(-0,90,0)
LettersPos["W2",vector]=vec(30,12,0)
LettersSca["W2",vector]=vec(2,1,1)
LettersAng["W2",angle]=ang(-0,0,0)
LettersPos["W3",vector]=vec(48,36,0)
LettersSca["W3",vector]=vec(5,1,1)
LettersAng["W3",angle]=ang(-0,270,0)
LettersPos["W4",vector]=vec(30,36,0)
LettersSca["W4",vector]=vec(3,1,1)
LettersAng["W4",angle]=ang(-0,270,0)
LettersPos["X1",vector]=vec(30,36,0)
LettersSca["X1",vector]=vec(6,1,1)
LettersAng["X1",angle]=ang(-0,53.130104064941,0)
LettersPos["X2",vector]=vec(30,36,0)
LettersSca["X2",vector]=vec(6,1,1)
LettersAng["X2",angle]=ang(-0,306.86990356445,0)
LettersPos["Y1",vector]=vec(30,36,0)
LettersSca["Y1",vector]=vec(6,1,1)
LettersAng["Y1",angle]=ang(-0,53.130104064941,0)
LettersPos["Y2",vector]=vec(18,54,0)
LettersSca["Y2",vector]=vec(2.4142135623731,1,1)
LettersAng["Y2",angle]=ang(-0,135,0)
LettersPos["Z1",vector]=vec(30,12,0)
LettersSca["Z1",vector]=vec(4,1,1)
LettersAng["Z1",angle]=ang(-0,180,0)
LettersPos["Z2",vector]=vec(30,36,0)
LettersSca["Z2",vector]=vec(6,1,1)
LettersAng["Z2",angle]=ang(-0,53.130104064941,0)
LettersPos["Z3",vector]=vec(30,60,0)
LettersSca["Z3",vector]=vec(4,1,1)
LettersAng["Z3",angle]=ang(-0,180,0)
}

runOnChat(1)

if (lastSpoke()==owner()) {
    holoDeleteAll()
    for (II=1,lastSaid():length()){
        for (I=1,Letters[lastSaid():index(II):upper(),number]) {
            holoCreate(I+(II*10))
            holoPos(I+(II*10), entity():pos()+LettersPos[lastSaid():upper():index(II)+I:toString(),vector]+vec((II-1)*60,0,0))
            holoScale(I+(II*10), LettersSca[lastSaid():upper():index(II)+I:toString(),vector])
            holoAng(I+(II*10), LettersAng[lastSaid():upper():index(II)+I:toString(),angle])
            holoParent(I+(II*10),entity())
            holoColor(I+(II*10),vec(0,0,255))
        }
    }
}
