string FirstName(string name){ integer a = llSubStringIndex(name," "); if(a == -1) a = llSubStringIndex(name,"."); return llGetSubString(name,0,a-1); } string LastName(string name){ integer a = llSubStringIndex(name,"@"); if( a == -1) { a = llSubStringIndex(name," "); return llGetSubString(name,a+1,-1); } name = llGetSubString(name,0,a-1); a = llSubStringIndex(name,"."); return llGetSubString(name,a+1,-1); } string CleanName(string name){ // Removes Hypergrid @gridname.xxx:8002 integer a = llSubStringIndex(name,"@"); if( a == -1) return name; integer b = llSubStringIndex(name,"."); return llGetSubString(name,0,b-1) + " " + llGetSubString(name,b+1,a-2); } string FormalName(string name, key id){ string Formal; if(llList2Integer(llGetObjectDetails(id,[OBJECT_BODY_SHAPE_TYPE]),0)) Formal = "Mr"; else Formal = "Ms"; return Formal + " " + LastName(name); } default { state_entry() { } touch_end(integer i) { key ID = llDetectedKey(0); string name = llKey2Name(ID); llRegionSayTo(ID,0,"Your christian name: "+FirstName(name)); llRegionSayTo(ID,0,"Your last name: "+LastName(name)); llRegionSayTo(ID,0,"Your cleaned name: "+CleanName(name)); llRegionSayTo(ID,0,"Your formal name: "+FormalName(name,ID)); } }