User:Geopbyte Resident

From Second Life Wiki
Revision as of 07:32, 24 November 2011 by Geopbyte Resident (talk | contribs)
Jump to navigation Jump to search

[lsl] string out(vector in) {

   string x = (string)in.x;
   string y = (string)in.y;
   string z = (string)in.z;
   x = llGetSubString(x,0,3);
   y = llGetSubString(y,0,3);
   z = llGetSubString(z,0,3);
   x = llDumpList2String(llParseString2List(x,["."],[]),"");
   y = llDumpList2String(llParseString2List(y,["."],[]),"");
   z = llDumpList2String(llParseString2List(z,["."],[]),"");
   return x+y+z;

} vector new(integer in) {

   string out = (string)in;
   string x = llGetSubString(out,0,2);
   out = llDeleteSubString(out,0,2);
   string y = llGetSubString(out,0,2);
   out = llDeleteSubString(out,0,2);
   string z = llGetSubString(out,0,2);
   out = llDeleteSubString(out,0,2);
   x = llGetSubString(x,0,0)+"."+llGetSubString(x,1,2);
   y = llGetSubString(y,0,0)+"."+llGetSubString(y,1,2);
   z = llGetSubString(z,0,0)+"."+llGetSubString(z,1,2);
   return (vector)("<"+x+","+y+","+z+">");

} default {

   state_entry()
   {
       vector test = <1.00,0.95,0.38>;
       string output = out(test);
       llOwnerSay(output);
       llOwnerSay((string)new((integer)output));
   }

} [/lsl]