2 // testing of an opensim bug, where there was a new requirement that
3 // the object have a sit target before any changed events will be fired.
5 // this script is licensed by the GPL v3 which is documented at: http://www.gnu.org/licenses/gpl.html
6 // do not use it in objects without fully realizing you are implicitly accepting that license.
9 integer link_changes = 0;
13 state_entry() { if (llSubStringIndex(llGetObjectName(), "huffotronic") < 0) state real_default; }
14 on_rez(integer parm) { state rerun; }
16 state rerun { state_entry() { state default; } }
21 llSitTarget(<0, 0, 0.1>, ZERO_ROTATION);
22 //above line makes things work. comment it out, and put in new object, and
23 // the object will not get changed events.
24 llSay(0, "sit to run the test...");
27 on_rez(integer count) { llResetScript(); }
29 changed(integer chang) {
30 llSay(0, "got into changed event...");
31 if (! (chang & CHANGED_LINK) ) {
32 llSay(0, "change was not a link, leaving.");
33 return; // not for us.
35 llSay(0, "into changed event, CHANGED_LINK...");
37 key av_sitting = llAvatarOnSitTarget();
38 if (av_sitting == NULL_KEY) {
39 llSay(0, "avatar stood up since key is null");
41 llSay(0, "avatar sat down: " + llDetectedName(0));
45 touch_start(integer count) {
46 llSay(0, "there have been " + (string)link_changes
47 + " 'changed' events for links since the last reset.");