// IMPORTANT NOTE // // If you recompile this script, you'll need to sit on a prim // before it reports moving_start and moving_end correctly. // This is an old SL bug that hasn't been fixed yet. >:( // // Resetting the script will not trigger this bug. //Written by Sean Gorham integer gReportOn; // These are per-report counts of events. integer gC; // collision integer gCE; // collision_end integer gCS; // collision_start integer gLC; // land_collision integer gLCE; // land_collision_end integer gLCS; // land_collision_start integer gME; // moving_end integer gMS; // moving_start // These are total counts of events. integer gTC; // collision integer gTCE; // collision_end integer gTCS; // collision_start integer gTLC; // land_collision integer gTLCE; // land_collision_end integer gTLCS; // land_collision_start integer gTME; // moving_end integer gTMS; // moving_start report() { llOwnerSay("Total events at runtime, total/this run" + (string)llGetTime() + ":"); llOwnerSay("collision: " + (string)gTC + "/" + (string)gC); llOwnerSay("collision_end: " + (string)gTCE + "/" + (string)gCE); llOwnerSay("collision_start: " + (string)gTCS + "/" + (string)gCS); llOwnerSay("land_collision: " + (string)gTLC + "/" + (string)gLC); llOwnerSay("land_collision_end: " + (string)gTLCE + "/" + (string)gLCE); llOwnerSay("land_collision_start: " + (string)gTLCS + "/" + (string)gLCS); llOwnerSay("moving_end: " + (string)gTME + "/" + (string)gME); llOwnerSay("moving_start: " + (string)gTMS + "/" + (string)gMS); llOwnerSay("= = = = ="); gC = gCE = gCS = gLC = gLCE = gLCS = gME = gMS = 0; } reportOff() { llSetTimerEvent(0.0); gReportOn = FALSE; gC = gCE = gCS = gLC = gLCE = gLCS = gME = gMS = 0; gTC = gTCE = gTCS = gTLC = gTLCE = gTLCS = gTME = gTMS = 0; llOwnerSay("Reporting off."); } reportOn() { gReportOn = TRUE; llOwnerSay("Reporting on."); report(); llSetTimerEvent(10.0); } default { on_rez(integer rezParameter) { llResetScript(); } state_entry() { reportOff(); } timer() { report(); } touch_start(integer numberDetected) { if(llDetectedKey(0) == llGetOwner()) { if(gReportOn == TRUE) { reportOff(); } else { reportOn(); } } } collision(integer numberDetected) { gC; gTC; } collision_end(integer numberDetected) { gCE++; gTCE++; } collision_start(integer numberDetected) { gCS++; gTCS++; } land_collision(vector Position) { gLC; gTLC; } land_collision_end(vector position) { gLCE++; gTLCE++; } land_collision_start(vector position) { gLCS++; gTLCS++; } moving_end() { gME++; gTME++; } moving_start() { gMS++; gTMS++; } }