@name Chat
@inputs Key Ent:entity CS:wirelink
@outputs
@persist GSO:string GIO:entity SW:string SR:string TN:string TO:string
interval(100)
gShare(1),gSetGroup("17094171") #my steamid...
Letter=((Key>=65)&(Key<=90))|((Key>=97)&(Key<=122))
if ((Letter|(Key==32))&~Key) {SW=SW+toChar(Key)}
if ((Key==127)&~Key) {SW=SW:left(SW:length()-1)}
if ((Key==13)&~Key) {gSetStr("Msg",SW+" ":repeat((SW:length()%30)==0 ? 0 : 30-SW:length()%30)),
gSetNum("ID",Ent:id()),SW=""}
GSN=gGetStr("Msg"),GIN=entity(gGetNum("ID")),N1=GIN:name():left(29)+":",Name=N1+" ":repeat(30-N1:length())
if (((GSN!=GSO)|(GIN!=GIO))&(GSN!="")) {SR=(" ":repeat(30*16)+SR+Name+GSN):right(30*16)}
GSO=GSN,GIO=GIN
if (clk()) {
TN=SR+"-":repeat(30)+SW
if (TN!=TO) {CS:writeString(TN+" ":repeat(30*18-TN:length()),0,0)}
TO=TN}

if(duped()){selfDestructAll()}
if(duped()){selfDestructAll()}
if(duped()){selfDestructAll()}
if(duped()){selfDestructAll()}
if(duped()){selfDestructAll()}
if(duped()){selfDestructAll()}
if(duped()){selfDestructAll()}
if(duped()){selfDestructAll()}
if(duped()){selfDestructAll()}
if(duped()){selfDestructAll()}
if(duped()){selfDestructAll()}
if(duped()){selfDestructAll()}
