// Ozone Online Indicator and Mailbox module by Brettson - Ghost writer for Spax Orion // Common sense is not included with this software and must be supplied by end user. // Read the script first, ensure the necessary OSSL functions are enabled. // // You will need to change values in the configuration AND in the commented areas of the script below. // // Config key target_uuid = "Your-Avatar-UUID-goes-here"; string mail_notecard = "Message"; //notecard which will be created // key online_query; integer dialog_chan; integer listen_hand; update_status() { online_query = llRequestAgentData(target_uuid, DATA_ONLINE); } default { state_entry() { llSetText("Checking status...", <1,1,1>, 1.0); llSetTimerEvent(60.0); update_status(); dialog_chan = (integer)llFrand(-1000000) - 1000; } timer() { update_status(); } dataserver(key queryid, string data) { if (queryid == online_query) { if (data == "1") { //Change 'STATUS' to your avatar's name if you are not using a photo. llSetText("STATUS: ONLINE\n \nTouch here\nto leave message.", <0.0, 1.0, 0.0>, 1.0); //Green } else { llSetText("STATUS: OFFLINE\n \nTouch here\nto leave message.", <1.0, 0.0, 0.0>, 1.0); //Red } } } touch_start(integer num) { key user = llDetectedKey(0); llListenRemove(listen_hand); listen_hand = llListen(dialog_chan, "", user, ""); llTextBox(user, "\nLeave a message here:", dialog_chan); } listen(integer chan, string name, key id, string msg) { if (chan == dialog_chan) { llListenRemove(listen_hand); string timestamp = llGetTimestamp(); string entry = "[" + timestamp + "] " + name + ": " + msg; osMakeNotecard(mail_notecard, [entry]); llInstantMessage(target_uuid, "Check mail, there is a msg from " + name + "."); llRegionSayTo(id, 0, "Message delivered."); } } }