XMREngine.builtins

From Dreamnation
Revision as of 15:13, 3 February 2015 by Admin (Talk | contribs) (Created page with " Some built-in functions not described elsewhere C#-style argument substring functions: string xmrSubstring (string s, integer offset) string xmrSubstring (string...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Some built-in functions not described elsewhere

 C#-style argument substring functions:
   string xmrSubstring (string s, integer offset)
   string xmrSubstring (string s, integer offset, integer length)
 Java-style argument substring function:
   string xmrJSubstring (string s, integer beg, integer end)
 C#-style string searches:
   integer xmrStringIndexOf (string haystack, string needle)
   integer xmrStringIndexOf (string haystack, string needle, integer startat)
   integer xmrLastStringIndexOf (string haystack, string needle)
   integer xmrLastStringIndexOf (string haystack, string needle, integer startat)
   integer xmrStringStartsWith (string haystack, string needle)
   integer xmrStringEndsWith (string haystack, string needle)
 These functions convert strings to the given type
 but unlike standard LSL policy of return something even if wrong,
 they will throw an exception on conversion error:
   float xmrString2Float (string s)
   integer xmrString2Integer (string s)
   rotation xmrString2Rotation (string s)
   vector xmrString2Vector (string s)
 These functions convert values to strings
 with a C#-style formatting argument.
 Use "" to take the C# default.
   string xmrFloat2String (float val, string fmt)
   string xmrInteger2String (integer val, string fmt)
   string xmrRotation2String (rotation val, string fmt)
   string xmrVector2String (vector val, string fmt)
 Seat an avatar on a prim:
   integer xmrSeatAvatar (integer owner)
     parameter:
       owner = 0 : seat avatar that has granted this script PERMISSION_TRIGGER_ANIMATION
               1 : seat avatar that owns the prim this script is in
     returns:
        0 : successful
       -1 : PERMISSION_TRIGGER_ANIMATION not granted
       -2 : no permissions requested by script
       -3 : avatar not present in region