From 9dd74045373c39d8a35a59f3c2801b0348a44a9b Mon Sep 17 00:00:00 2001 From: Dave Seikel Date: Sun, 20 May 2018 23:17:24 +1000 Subject: Initial commit. This is the current alpha version, it was time to put it somewhere. --- ~ball.lsl | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 ~ball.lsl (limited to '~ball.lsl') diff --git a/~ball.lsl b/~ball.lsl new file mode 100644 index 0000000..4d6bb2d --- /dev/null +++ b/~ball.lsl @@ -0,0 +1,63 @@ +// +// MLP lite v3.0 for OpenSim +// Based on the original MLP - MULTI-LOVE-POSE V1.2 - Copyright (c) 2006, by Miffy Fluffy (BSD License) +// This code has bounced around the Second Life and OpenSim for over a decade, with various people working on it. +// MLP lite for OpenSim is almost a complete rewrite by onefang rejected. + +key Boss; +integer Number; +integer isBall; + + +default +{ + state_entry() + { + integer perm = llGetObjectPermMask(MASK_OWNER); + + if (0 == (perm & (PERM_COPY | PERM_MOVE | PERM_MODIFY))) + { + llOwnerSay("DANGER, CAN'T COPY, MODIFY, OR MOVE THIS OBJECT!"); + llSay(DEBUG_CHANNEL, "DANGER, CAN'T COPY, MODIFY, OR MOVE THIS OBJECT!"); + } + } + + on_rez(integer num) + { + string objectName = llGetObjectName(); + + isBall = ("~ball" == objectName); + if (isBall) // This is only coz OpenSim 8.2 doesn't know PRIM_SIT_TARGET. + llSitTarget(<0.0, 0.0, -0.1>, ZERO_ROTATION); + Boss = osGetRezzingObject(); + if (NULL_KEY != Boss) + { + Number = num; + osMessageObject(Boss, "ALIVE|" + num); + llSetTimerEvent(600.0); + } + } + + changed(integer change) + { + if ((CHANGED_LINK == change) && isBall) + osMessageObject(Boss, "AVATAR|" + Number + "|" + (string) llAvatarOnSitTarget()); + } + + dataserver(key query_id, string str) + { + if (query_id == Boss) + { + if ("LIVE" == str) + llSetTimerEvent(600.0); + else if ("DIE" == str) + llDie(); + } + } + + timer() + { // not heard "LIVE" from ~MLP for a while: suicide + llDie(); + } +} + -- cgit v1.1