Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
archiv:opensim:downloads:scripts:grafitti_board [2024/01/24 16:39] – Externe Bearbeitung 127.0.0.1 | archiv:opensim:downloads:scripts:grafitti_board [Unbekanntes Datum] (aktuell) – Externe Bearbeitung (Unbekanntes Datum) 127.0.0.1 | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | ===== Grafitti Board ===== | ||
+ | |||
+ | Zeigt einen Text auf einem Prim der im Chat eingegeben wird. | ||
+ | |||
+ | < | ||
+ | // Grafitti board 0.0.2 for OpenSim | ||
+ | // By Justin Clark-Casey (justincc) | ||
+ | // http:// | ||
+ | |||
+ | // This script is available under the BSD License | ||
+ | |||
+ | string text = ""; | ||
+ | |||
+ | integer LISTENING_CHANNEL = 43; | ||
+ | |||
+ | // XXX Only putting this here as well to get around OpenSim' | ||
+ | string LISTENING_CHANNEL_STRING = " | ||
+ | |||
+ | // FIXME: Should be dynamic! | ||
+ | integer CHARS_WIDTH = 42; | ||
+ | |||
+ | // Add some additional graffiti | ||
+ | addGraffiti(string message) | ||
+ | { | ||
+ | while (llStringLength(message) > CHARS_WIDTH) | ||
+ | { | ||
+ | text += " | ||
+ | message = llDeleteSubString(message, | ||
+ | } | ||
+ | |||
+ | text += " | ||
+ | } | ||
+ | |||
+ | // Clear the existing graffiti | ||
+ | clearGraffiti() | ||
+ | { | ||
+ | text = ""; | ||
+ | } | ||
+ | |||
+ | // Actually fires the graffiti out to the dynamic texture module | ||
+ | draw() | ||
+ | { | ||
+ | //llSay(0, text); | ||
+ | string drawList = " | ||
+ | |||
+ | osSetDynamicTextureData("", | ||
+ | } | ||
+ | |||
+ | default | ||
+ | { | ||
+ | state_entry() | ||
+ | { | ||
+ | llSetText( | ||
+ | "Say /" + LISTENING_CHANNEL_STRING + " < | ||
+ | + " Say /" + LISTENING_CHANNEL_STRING | ||
+ | + " !clear to clear board", | ||
+ | <0.0, 1.0, 0.0>, 1.0); | ||
+ | |||
+ | llListen(LISTENING_CHANNEL, | ||
+ | |||
+ | addGraffiti(" | ||
+ | addGraffiti(" | ||
+ | draw(); | ||
+ | } | ||
+ | |||
+ | listen(integer channel, string name, key id, string message) | ||
+ | { | ||
+ | if (message == " | ||
+ | { | ||
+ | clearGraffiti(); | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | addGraffiti(message); | ||
+ | } | ||
+ | |||
+ | draw(); | ||
+ | } | ||
+ | } | ||
+ | </ | ||