Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

// ********************** // STRINGS // ********************** string gBase = "http://www.phpserver.com/sl/silo/siloappend.

php"; string myKey = "/k39fhs8asisb48nje9/"; string objName = ""; string uniUrl = ""; // ********************** // MAIN ENTRY // ********************** default { state_entry() { objName = llGetObjectName(); llOwnerSay("In object " + objName + " the php_ss script is in default mo de."); // llSetTimerEvent(180.0); llSensorRepeat( "", NULL_KEY, AGENT, 96.0, PI, 180.0 ); uniUrl = gBase + myKey + objName; } sensor(integer numberDetected) { // Do sensing, send message to php script // Get avatar key, name, position, time // Put all this in a string string data = "Time=" + llGetTimestamp() + "; "; integer i = 0; while(numberDetected > i++)//skips the first item which suits this appli cation { string msg = "agent=" + llDetectedName(i) + "; pos=" + (string)llDet ectedPos(i); llHTTPRequest(uniUrl, [ HTTP_METHOD, "PUT" ], data + msg); llSleep(1.0); } } no_sensor() { // Sensing detected nothing // Send little message with time to php script string data = "Time=" + llGetTimestamp() + "; Nothing detected"; llHTTPRequest(uniUrl, [ HTTP_METHOD, "PUT" ], data); } }

You might also like