diff options
| author | Dave Seikel | 2018-05-20 23:17:24 +1000 |
|---|---|---|
| committer | Dave Seikel | 2018-05-20 23:17:24 +1000 |
| commit | 9dd74045373c39d8a35a59f3c2801b0348a44a9b (patch) | |
| tree | b3cdc4ba800ffa44b98291ce12a0eb1c9ad809e4 /~ball.lsl | |
| parent | Initial commit (diff) | |
| download | MLP-lite-9dd74045373c39d8a35a59f3c2801b0348a44a9b.zip MLP-lite-9dd74045373c39d8a35a59f3c2801b0348a44a9b.tar.gz MLP-lite-9dd74045373c39d8a35a59f3c2801b0348a44a9b.tar.bz2 MLP-lite-9dd74045373c39d8a35a59f3c2801b0348a44a9b.tar.xz | |
Initial commit.
This is the current alpha version, it was time to put it somewhere.
Diffstat (limited to '~ball.lsl')
| -rw-r--r-- | ~ball.lsl | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/~ball.lsl b/~ball.lsl new file mode 100644 index 0000000..4d6bb2d --- /dev/null +++ b/~ball.lsl | |||
| @@ -0,0 +1,63 @@ | |||
| 1 | // | ||
| 2 | // MLP lite v3.0 for OpenSim | ||
| 3 | // Based on the original MLP - MULTI-LOVE-POSE V1.2 - Copyright (c) 2006, by Miffy Fluffy (BSD License) | ||
| 4 | // This code has bounced around the Second Life and OpenSim for over a decade, with various people working on it. | ||
| 5 | // MLP lite for OpenSim is almost a complete rewrite by onefang rejected. | ||
| 6 | |||
| 7 | key Boss; | ||
| 8 | integer Number; | ||
| 9 | integer isBall; | ||
| 10 | |||
| 11 | |||
| 12 | default | ||
| 13 | { | ||
| 14 | state_entry() | ||
| 15 | { | ||
| 16 | integer perm = llGetObjectPermMask(MASK_OWNER); | ||
| 17 | |||
| 18 | if (0 == (perm & (PERM_COPY | PERM_MOVE | PERM_MODIFY))) | ||
| 19 | { | ||
| 20 | llOwnerSay("DANGER, CAN'T COPY, MODIFY, OR MOVE THIS OBJECT!"); | ||
| 21 | llSay(DEBUG_CHANNEL, "DANGER, CAN'T COPY, MODIFY, OR MOVE THIS OBJECT!"); | ||
| 22 | } | ||
| 23 | } | ||
| 24 | |||
| 25 | on_rez(integer num) | ||
| 26 | { | ||
| 27 | string objectName = llGetObjectName(); | ||
| 28 | |||
| 29 | isBall = ("~ball" == objectName); | ||
| 30 | if (isBall) // This is only coz OpenSim 8.2 doesn't know PRIM_SIT_TARGET. | ||
| 31 | llSitTarget(<0.0, 0.0, -0.1>, ZERO_ROTATION); | ||
| 32 | Boss = osGetRezzingObject(); | ||
| 33 | if (NULL_KEY != Boss) | ||
| 34 | { | ||
| 35 | Number = num; | ||
| 36 | osMessageObject(Boss, "ALIVE|" + num); | ||
| 37 | llSetTimerEvent(600.0); | ||
| 38 | } | ||
| 39 | } | ||
| 40 | |||
| 41 | changed(integer change) | ||
| 42 | { | ||
| 43 | if ((CHANGED_LINK == change) && isBall) | ||
| 44 | osMessageObject(Boss, "AVATAR|" + Number + "|" + (string) llAvatarOnSitTarget()); | ||
| 45 | } | ||
| 46 | |||
| 47 | dataserver(key query_id, string str) | ||
| 48 | { | ||
| 49 | if (query_id == Boss) | ||
| 50 | { | ||
| 51 | if ("LIVE" == str) | ||
| 52 | llSetTimerEvent(600.0); | ||
| 53 | else if ("DIE" == str) | ||
| 54 | llDie(); | ||
| 55 | } | ||
| 56 | } | ||
| 57 | |||
| 58 | timer() | ||
| 59 | { // not heard "LIVE" from ~MLP for a while: suicide | ||
| 60 | llDie(); | ||
| 61 | } | ||
| 62 | } | ||
| 63 | |||
