// Davan Camus, 2005 October // marker for the solar observatory // responds to commands for size, color &c // a little of everything integer gCommandChannel = 80; integer gListenerNumber = 0; integer gTimeToLive = 0; integer gTimeToShowText = 0; // timeout for llSetText() integer gDebug = 0; integer gTickDuration = 20; // long interval, script politeness list gTouchReport = []; // when touched, deliver this whole list, line by line. init() { llListenRemove(gListenerNumber); gListenerNumber = llListen(gCommandChannel,"","",""); llSetTimerEvent(gTickDuration); llSetText("",<0,0,0>,0); } default { on_rez(integer n) { gCommandChannel = n; init(); } state_entry() { init(); } touch_start(integer total_number) { // give our message string s; integer lines = llGetListLength(gTouchReport); integer i; for(i = 0; i < lines; i++) { if(i) s += "\n"; string line = llList2String(gTouchReport,i); s += line; llSay(0,line); } llSetText(s,<1,1,1>,1); gTimeToShowText = 60; } listen(integer channel,string name,key id,string message) { list messageL = llParseString2List(message,["++"],[]); string c = llList2String(messageL,0); string arg1 = llList2String(messageL,1); if(c == "color") { vector color = (vector)arg1; llSetColor(color,ALL_SIDES); } else if(c == "size") { vector size = (vector)arg1; llSetScale(size); } else if(c == "data") { gTouchReport = llListInsertList(gTouchReport,[arg1],100); } else if(c == "ttl") { gTimeToLive = llList2Integer(messageL,1); } else if(c == "name") { llSetObjectName(arg1); } else if(c == "desc") { llSetObjectDesc(arg1); } else if(c == "done") { llListenRemove(gListenerNumber); } } timer() { if(gTimeToShowText) { gTimeToShowText -= gTickDuration; if(gTimeToShowText <= 0) { gTimeToShowText = 0; llSetText("",<0,0,0>,0); } } if(gTimeToLive) { gTimeToLive -= gTickDuration; if(gTimeToLive <= 0) { integer a; for(a = 0; a < 4; a++) { llSetColor(<1,1,1>,ALL_SIDES); llSleep(.3); llSetColor(<0,0,0>,ALL_SIDES); llSleep(.3); } llDie(); } } } } // end of file