Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
archiv:opensim:downloads:scripts:sleep [2024/01/24 16:39] – Externe Bearbeitung 127.0.0.1 | archiv:opensim:downloads:scripts:sleep [Unbekanntes Datum] (aktuell) – Externe Bearbeitung (Unbekanntes Datum) 127.0.0.1 | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | ===== Sleep ===== | ||
+ | |||
+ | Schlaf-Stellung. | ||
+ | |||
+ | < | ||
+ | // Francis wuz here | ||
+ | integer broadcast = 20; | ||
+ | |||
+ | // A More Neutral Sleeping Position | ||
+ | //vector target = < | ||
+ | //rotation targetRot = < | ||
+ | |||
+ | // A More relaxed sleeping position | ||
+ | vector target = < | ||
+ | rotation targetRot = < | ||
+ | |||
+ | integer debugRotation = FALSE; | ||
+ | key sitAgent = NULL_KEY; | ||
+ | integer gotPermission = FALSE; | ||
+ | |||
+ | integer time = 0; | ||
+ | default | ||
+ | { | ||
+ | state_entry() | ||
+ | { | ||
+ | llSetSitText( " | ||
+ | llSitTarget( target, targetRot ); | ||
+ | if ( debugRotation ) { | ||
+ | llListen( 1977, " | ||
+ | llListen( 1978, " | ||
+ | } | ||
+ | } | ||
+ | listen(integer channel, string name, key id, string message ) { | ||
+ | if ( channel == 1977 ) | ||
+ | targetRot = (rotation) message; | ||
+ | else | ||
+ | target = (vector) message; | ||
+ | | ||
+ | llSitTarget( target, targetRot ); | ||
+ | if ( time == 0 ) | ||
+ | llSay(0, (string) targetRot + ", " + (string)target ); | ||
+ | time = (time +1) % 50; | ||
+ | } | ||
+ | changed(integer change) { | ||
+ | if (change & CHANGED_LINK) | ||
+ | { | ||
+ | key agent = llAvatarOnSitTarget(); | ||
+ | if ( sitAgent == NULL_KEY && agent != NULL_KEY ) { | ||
+ | // Someone new sitting down | ||
+ | sitAgent = agent; | ||
+ | llRequestPermissions(sitAgent, | ||
+ | } | ||
+ | else if ( sitAgent != NULL_KEY && agent == NULL_KEY) { | ||
+ | // sitting down person got up - wake up :) | ||
+ | if ( gotPermission ) | ||
+ | llStopAnimation(" | ||
+ | // Reset the script because we don't have a way of releasing permissions :) | ||
+ | llResetScript(); | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | run_time_permissions(integer parm) { | ||
+ | if(parm == PERMISSION_TRIGGER_ANIMATION) { | ||
+ | gotPermission = TRUE; | ||
+ | llStartAnimation(" | ||
+ | } | ||
+ | } | ||
+ | | ||
+ | } | ||
+ | </ | ||