Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
archiv:opensim:downloads:scripts:online_indicator [2024/01/24 16:39] – Externe Bearbeitung 127.0.0.1 | archiv:opensim:downloads:scripts:online_indicator [Unbekanntes Datum] (aktuell) – Externe Bearbeitung (Unbekanntes Datum) 127.0.0.1 | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | ===== Online Indicator ===== | ||
+ | |||
+ | < | ||
+ | //////////////////////////////////////////////////////////////////////////////////////////////// | ||
+ | // Copyright (c) 2008 by Kristy Fanshaw | ||
+ | //////////////////////////////////////////////////////////////////////////////////////////////// | ||
+ | // This program is free software: you can redistribute it and/or modify | ||
+ | // it under the terms of the GNU General Public License as published by // | ||
+ | // the Free Software Foundation, either version 3 of the License, or // | ||
+ | // (at your option) any later version. | ||
+ | // // | ||
+ | // Vendor System is distributed in the hope that it will be useful, | ||
+ | // but WITHOUT ANY WARRANTY; without even the implied warranty of // | ||
+ | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
+ | // GNU General Public License for more details. | ||
+ | // // | ||
+ | // To get a copy of the GNU General Public License, see < | ||
+ | //////////////////////////////////////////////////////////////////////////////////////////////// | ||
+ | |||
+ | key user_key = " | ||
+ | integer time = 30; // time within the message should be written. | ||
+ | string url = " | ||
+ | key blank = " | ||
+ | string name; | ||
+ | key toucher; | ||
+ | string status; | ||
+ | |||
+ | default | ||
+ | { | ||
+ | state_entry() | ||
+ | { | ||
+ | llSetText("", | ||
+ | llSetTexture(blank, | ||
+ | llRequestAgentData( user_key, DATA_NAME); | ||
+ | } | ||
+ | dataserver(key queryid, string data) | ||
+ | { | ||
+ | name = data; | ||
+ | llSetObjectName(name + "' | ||
+ | state show; | ||
+ | } | ||
+ | } | ||
+ | state show | ||
+ | { | ||
+ | state_entry() | ||
+ | { | ||
+ | llSetTimerEvent(10); | ||
+ | } | ||
+ | timer() | ||
+ | { | ||
+ | llHTTPRequest( url + (string)user_key, | ||
+ | llRequestAgentData( user_key, DATA_ONLINE); | ||
+ | } | ||
+ | on_rez(integer start_param) | ||
+ | { | ||
+ | llSetText("", | ||
+ | llSetTexture(blank, | ||
+ | } | ||
+ | http_response(key request_id, | ||
+ | { | ||
+ | if (llSubStringIndex(body, | ||
+ | { | ||
+ | integer start_UUID = llSubStringIndex(body,"< | ||
+ | integer end_UUID = llSubStringIndex(body," | ||
+ | string profile_pic = llGetSubString(body, | ||
+ | llSetTexture((key)profile_pic, | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | llSetTexture(blank, | ||
+ | } | ||
+ | } | ||
+ | dataserver(key queryid, string data) | ||
+ | { | ||
+ | if ( data == " | ||
+ | { | ||
+ | status = " is online"; | ||
+ | |||
+ | llSetText(name + status, < | ||
+ | } | ||
+ | else if (data == " | ||
+ | { | ||
+ | status = " is offline"; | ||
+ | |||
+ | llSetText(name + status, < | ||
+ | } | ||
+ | |||
+ | } | ||
+ | touch_start(integer num_detected) | ||
+ | { | ||
+ | toucher = llDetectedKey(0); | ||
+ | state msg; | ||
+ | } | ||
+ | } | ||
+ | state msg | ||
+ | { | ||
+ | | ||
+ | { | ||
+ | llListen(0,"", | ||
+ | llInstantMessage(toucher, | ||
+ | llInstantMessage(toucher, | ||
+ | llSetTimerEvent(time); | ||
+ | } | ||
+ | listen(integer ch, string name, key id, string msg) | ||
+ | { | ||
+ | llInstantMessage(user_key, | ||
+ | llInstantMessage(toucher, | ||
+ | llListenRemove(0); | ||
+ | state show; | ||
+ | } | ||
+ | timer() | ||
+ | { | ||
+ | llInstantMessage(toucher, | ||
+ | llListenRemove(0); | ||
+ | state show; | ||
+ | } | ||
+ | } | ||
+ | </ | ||