public void TestCastLSLIntegerItemToLSLInteger()
        {
            LSL_Types.LSLInteger testValue = new LSL_Types.LSLInteger(123);
            LSL_Types.list       testList  = new LSL_Types.list(testValue);

            Assert.AreEqual(testValue, (LSL_Types.LSLInteger)testList.Data[0]);
        }
示例#2
0
 public void default_event_touch_start(LSL_Types.LSLInteger num_detected)
 {
     LSL_Types.LSLInteger y = -3;
     LSL_Types.LSLInteger x = 14 + 6;
     y = 12 + 45 + 20 + x + 23 + 1 + x + y;
     y = 12 + -45 + -20 + x + 23 + -1 + x + y;
 }
        public void TestGetLSLIntegerItemForLSLIntegerItem()
        {
            LSL_Types.LSLInteger testValue = new LSL_Types.LSLInteger(999911);
            LSL_Types.list       testList  = new LSL_Types.list(testValue);

            Assert.AreEqual(testValue, testList.GetLSLIntegerItem(0));
        }
示例#4
0
        public void default_event_touch_start(LSL_Types.LSLInteger num_detected)
        {
            goto here;
            llOwnerSay("Uh oh, the jump didn't work");
here:
            llOwnerSay("After the jump");
        }
示例#5
0
        public bool PostScriptEvent(UUID itemID, string name, Object[] p)
        {
            Object[] lsl_p = new Object[p.Length];
            for (int i = 0; i < p.Length; i++)
            {
                if (p[i] is int)
                {
                    lsl_p[i] = new LSL_Types.LSLInteger((int)p[i]);
                }
                else if (p[i] is string)
                {
                    lsl_p[i] = new LSL_Types.LSLString((string)p[i]);
                }
                else if (p[i] is Vector3)
                {
                    lsl_p[i] = new LSL_Types.Vector3(((Vector3)p[i]).X, ((Vector3)p[i]).Y, ((Vector3)p[i]).Z);
                }
                else if (p[i] is Quaternion)
                {
                    lsl_p[i] = new LSL_Types.Quaternion(((Quaternion)p[i]).X, ((Quaternion)p[i]).Y, ((Quaternion)p[i]).Z, ((Quaternion)p[i]).W);
                }
                else if (p[i] is float)
                {
                    lsl_p[i] = new LSL_Types.LSLFloat((float)p[i]);
                }
                else
                {
                    lsl_p[i] = p[i];
                }
            }

            return(PostScriptEvent(itemID, new EventParams(name, lsl_p, new DetectParams[0])));
        }
 public void default_event_touch_start(LSL_Types.LSLInteger num_detected)
 {
     LSL_Types.LSLInteger y = -3;
     LSL_Types.LSLInteger x = 14 + 6;
     y = 12 + 45 + 20 + x++ + (23 + 1) + ++x + --y;
     y = (12 + -45 + -20 + x-- + 23) + -1 + x-- + ++y;
 }
 public void default_event_touch_start(LSL_Types.LSLInteger num_detected)
 {
     LSL_Types.LSLInteger x = 0;
     LSL_Types.LSLInteger y = 0;
     x  = y = 5;
     x += y -= 5;
     llOwnerSay("x is: " + (LSL_Types.LSLString)(x) + ", y is: " + (LSL_Types.LSLString)(y));
 }
 public void default_event_touch_start(LSL_Types.LSLInteger num_detected)
 {
     LSL_Types.LSLInteger x = 0x23;
     LSL_Types.LSLInteger x = 0x2f34B;
     LSL_Types.LSLInteger x = 0x2F34b;
     LSL_Types.LSLInteger x = 0x2F34B;
     LSL_Types.LSLInteger x = 0x2f34b;
 }
 public void default_event_touch_start(LSL_Types.LSLInteger num_detected)
 {
     LSL_Types.LSLString s1 = "this is a string.";
     LSL_Types.LSLString s2 = "this is a string " + "with an escaped \" inside it.";
     s1 = s2 + " and this " + "is a string with // comments.";
     LSL_Types.LSLString onemore   = "[\^@]";
     LSL_Types.LSLString multiline = "Good evening Sir,\n        my name is Steve.\n        I come from a rough area.\n        I used to be addicted to crack\n        but now I am off it and trying to stay clean.\n        That is why I am selling magazine subscriptions.";
 }
        public void TestGetLSLFloatItemForLSLIntegerItem()
        {
            LSL_Types.LSLInteger testValue      = new LSL_Types.LSLInteger(3060987);
            LSL_Types.LSLFloat   testFloatValue = new LSL_Types.LSLFloat(testValue);
            LSL_Types.list       testList       = new LSL_Types.list(testValue);

            Assert.AreEqual(testFloatValue, testList.GetLSLFloatItem(0));
        }
示例#11
0
 public void default_event_touch_start(LSL_Types.LSLInteger num_detected)
 {
     llSay(2000, onefunc());
     LSL_Types.LSLInteger x = 2;
     x *= 3;
     x /= 14 + -2;
     x %= 10;
 }
 public GLOBALS()
 {
     this.V_listThx            = (new LSL_Types.list());
     this.V_notecard           = "TEMPLATE_THX";
     this.V_indexLigneNotecard = new LSL_Types.LSLInteger(0);
     this.V_length             = 0;
     this.V_getReadRequest     = "";
     this.V_getLength          = "";
 }
 public void default_event_touch_start(LSL_Types.LSLInteger num_detected)
 {
     LSL_Types.LSLInteger x = 2;
     LSL_Types.LSLInteger y = 1;
     LSL_Types.LSLInteger z = x ^ y;
     x = ~z;
     x = ~(y && z);
     y = x >> z;
     z = y << x;
 }
        public void TestImplicitCastLSLIntegerToLSLFloat()
        {
            LSL_Types.LSLFloat testFloat;

            foreach (int number in m_intList)
            {
                testFloat = new LSL_Types.LSLInteger(number);
                Assert.That(testFloat.value, new DoubleToleranceConstraint(number, _lowPrecisionTolerance));
            }
        }
示例#15
0
 public GLOBALS()
 {
     this.V_gNotecard      = "Config";
     this.V_gLineRequestID = "";
     this.V_gReadRequestID = "";
     this.V_gLineTotal     = 0;
     this.V_gLineIndex     = 0;
     this.V_gDataLines     = new LSL_Types.list();
     this.V_gStatus        = "";
 }
示例#16
0
 public void default_event_touch_start(LSL_Types.LSLInteger num_detected)
 {
     LSL_Types.LSLInteger y = 0;
     LSL_Types.LSLInteger x = 14 + 6;
     y = 12 - 3;
     y = 12 * 3;
     y = 12 / 3;
     y = 12 | 3;
     y = 12 & 3;
     y = 12 % 3;
     y = 12 + 45 - 20 * x / 23 | 1 & x + y;
 }
 public void default_event_touch_start(LSL_Types.LSLInteger num_detected)
 {
     LSL_Types.LSLInteger x = 1;
     LSL_Types.LSLInteger y = 0;
     while (x)
     {
         llSay(0, "To infinity, and beyond!");
     }
     while (0 || (x && 0))
     {
         llSay(0, "Never say never.");
         return;
     }
 }
示例#18
0
 public void default_event_touch_start(LSL_Types.LSLInteger num_detected)
 {
     LSL_Types.LSLInteger x = 1;
     LSL_Types.LSLInteger y = 0;
     do
     {
         llSay(0, "And we're doing...");
     }while (x);
     do
     {
         llSay(0, "I like it here. I wish we could stay here forever.");
         y--;
     }while (y);
 }
 public void default_event_touch_start(LSL_Types.LSLInteger num_detected)
 {
     LSL_Types.LSLString  s = "";
     LSL_Types.LSLInteger x = 1;
     s = (LSL_Types.LSLString)(x++);
     s = (LSL_Types.LSLString)(x);
     s = (LSL_Types.LSLString)(new LSL_Types.Vector3(0.0, 0.0, 0.0));
     s = (LSL_Types.LSLString)(new LSL_Types.Quaternion(1.0, 1.0, 1.0, 1.0));
     s = (LSL_Types.LSLInteger)("1");
     s = (LSL_Types.LSLString)(llSomethingThatReturnsInteger());
     s = (LSL_Types.LSLString)(134);
     s = (LSL_Types.LSLString)(x ^ y | (z && l)) + (LSL_Types.LSLString)(x + y - 13);
     llOwnerSay("s is: " + s);
 }
        public void TestConcatenateInteger()
        {
            LSL_Types.list testList = new LSL_Types.list(new LSL_Types.LSLInteger(1), new LSL_Types.LSLInteger('a'), new LSL_Types.LSLString("test"));
            testList += new LSL_Types.LSLInteger(20);

            Assert.AreEqual(4, testList.Length);
            Assert.AreEqual(new LSL_Types.LSLInteger(20), testList.Data[3]);
            Assert.AreEqual(typeof(LSL_Types.LSLInteger), testList.Data[3].GetType());

            LSL_Types.list secondTestList = testList + new LSL_Types.LSLInteger(2);

            Assert.AreEqual(5, secondTestList.Length);
            Assert.AreEqual(new LSL_Types.LSLInteger(2), secondTestList.Data[4]);
            Assert.AreEqual(typeof(LSL_Types.LSLInteger), secondTestList.Data[4].GetType());
        }
示例#21
0
 public void default_event_state_entry()
 {
     LSL_Types.LSLInteger x = 0;
     while (x = 14)
     {
         llOwnerSay("x is: " + (LSL_Types.LSLString)(x));
     }
     if (x = 24)
     {
         llOwnerSay("x is: " + (LSL_Types.LSLString)(x));
     }
     do
     {
         llOwnerSay("x is: " + (LSL_Types.LSLString)(x));
     }while (x = 44);
 }
 public void default_event_touch_start(LSL_Types.LSLInteger num_detected)
 {
     LSL_Types.LSLInteger i = 0;
     LSL_Types.LSLInteger j = 14;
     LSL_Types.LSLFloat   f = 0.0;
     LSL_Types.LSLFloat   g = 14.0;
     LSL_Types.LSLString  s = "";
     LSL_Types.LSLString  t = "Hi there";
     LSL_Types.list       l = new LSL_Types.list();
     LSL_Types.list       m = new LSL_Types.list(1, 2, 3);
     LSL_Types.Vector3    v = new LSL_Types.Vector3(0.0, 0.0, 0.0);
     LSL_Types.Vector3    w = new LSL_Types.Vector3(1.0, 0.1, 0.5);
     LSL_Types.Quaternion r = new LSL_Types.Quaternion(0.0, 0.0, 0.0, 0.0);
     LSL_Types.Quaternion u = new LSL_Types.Quaternion(0.8, 0.7, 0.6, llSomeFunc());
     LSL_Types.LSLString  k = "";
     LSL_Types.LSLString  n = "ping";
 }
示例#23
0
 public void default_event_touch_start(LSL_Types.LSLInteger num_detected)
 {
     LSL_Types.LSLInteger x = 1;
     LSL_Types.LSLInteger y = 0;
     for (x = 10; x >= 0; x--)
     {
         llOwnerSay("Launch in T minus " + x);
         IncreaseRocketPower();
     }
     for (x = 0, y = 6; y > 0 && x != y; x++, y--)
     {
         llOwnerSay("Hi " + x + ", " + y);
     }
     for (x = 0, y = 6; !y; x++, y--)
     {
         llOwnerSay("Hi " + x + ", " + y);
     }
 }
示例#24
0
 public void default_event_touch_start(LSL_Types.LSLInteger num_detected)
 {
     LSL_Types.LSLFloat y = 1.0;
     y = 1.0E3;
     y = 1.0e3;
     y = 1.0E+3;
     y = 1.0e+3;
     y = 1.0E-3;
     y = 1.0e-3;
     y = -1.0E3;
     y = -1.0e3;
     y = -1.0E+3;
     y = -1.0e+3;
     y = -1.0E-3;
     y = -1.0e-3;
     y = 12.0 + -1.0E3 - 1.0e-2;
     LSL_Types.Vector3 v = new LSL_Types.Vector3(0.0, 0.0, 0.0);
 }
 public void default_event_touch_start(LSL_Types.LSLInteger num_detected)
 {
     LSL_Types.LSLFloat y = 1.1;
     y = 1.123E3;
     y = 1.123e3;
     y = 1.123E+3;
     y = 1.123e+3;
     y = 1.123E-3;
     y = 1.123e-3;
     y = .4;
     y = -1.123E3;
     y = -1.123e3;
     y = -1.123E+3;
     y = -1.123e+3;
     y = -1.123E-3;
     y = -1.123e-3;
     y = -.4;
     y = 12.3 + -1.45E3 - 1.20e-2;
 }
示例#26
0
        public bool PostObjectEvent(UUID itemID, string name, Object[] p)
        {
            SceneObjectPart part = m_Scene.GetSceneObjectPart(itemID);

            if (part == null)
            {
                return(false);
            }

            Object[] lsl_p = new Object[p.Length];
            for (int i = 0; i < p.Length; i++)
            {
                if (p[i] is int)
                {
                    lsl_p[i] = new LSL_Types.LSLInteger((int)p[i]);
                }
                else if (p[i] is string)
                {
                    lsl_p[i] = new LSL_Types.LSLString((string)p[i]);
                }
                else if (p[i] is Vector3)
                {
                    lsl_p[i] = new LSL_Types.Vector3(((Vector3)p[i]).X, ((Vector3)p[i]).Y, ((Vector3)p[i]).Z);
                }
                else if (p[i] is Quaternion)
                {
                    lsl_p[i] = new LSL_Types.Quaternion(((Quaternion)p[i]).X, ((Quaternion)p[i]).Y, ((Quaternion)p[i]).Z, ((Quaternion)p[i]).W);
                }
                else if (p[i] is float)
                {
                    lsl_p[i] = new LSL_Types.LSLFloat((float)p[i]);
                }
                else
                {
                    lsl_p[i] = p[i];
                }
            }

            return(PostObjectEvent(part.LocalId, new EventParams(name, lsl_p, new DetectParams[0])));
        }
示例#27
0
 public void default_event_touch_start(LSL_Types.LSLInteger num_detected)
 {
     llSay(2000, onefunc());
     twofunc();
 }
 public void default_event_touch_start(LSL_Types.LSLInteger num_detected)
 {
     llOwnerSay("Testing, 1, 2, 3");
     llSay(0, "I can hear you!");
     some_custom_function(1, 2, 3 + x, 4, "five", "arguments");
 }
 public void default_event_touch_start(LSL_Types.LSLInteger num_detected)
 {
     LSL_Types.LSLInteger x = 1;
     LSL_Types.LSLInteger y = 0;
     if (x && y)
     {
         llSay(0, "Hello");
     }
     if (x || y)
     {
         llSay(0, "Hi");
         LSL_Types.LSLInteger r = 3;
         return;
     }
     if (x && y || z)
     {
         llSay(0, "x is true");
     }
     else
     {
         llSay(0, "x is false");
     }
     if (x == y)
     {
         llSay(0, "x is true");
     }
     else
     if (y < x)
     {
         llSay(0, "y is true");
     }
     else
     {
         llSay(0, "Who needs x and y anyway?");
     }
     if (x > y)
     {
         llSay(0, "x is true");
     }
     else
     if (y <= x)
     {
         llSay(0, "uh-oh, y is true, exiting");
         return;
     }
     else
     {
         llSay(0, "Who needs x and y anyway?");
     }
     if (x >= y)
     {
         llSay(0, "x is true");
     }
     else
     if (y != x)
     {
         llSay(0, "y is true");
     }
     else
     if (!z)
     {
         llSay(0, "z is true");
     }
     else
     if (!(a && b))
     {
         llSay(0, "a is true");
     }
     else
     if (b)
     {
         llSay(0, "b is true");
     }
     else
     if (v)
     {
         llSay(0, "v is true");
     }
     else
     {
         llSay(0, "Everything is lies!");
     }
 }
示例#30
0
 public void default_event_touch_start(LSL_Types.LSLInteger num_detected)
 {
 }
示例#31
0
 LSL_Types.LSLString onefunc(LSL_Types.LSLString addition)
 {
     globalInt -= 2;
     globalString += addition;
     return "Hi " + "from " + "onefunc()! " + globalString;
 }