child.lslp 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // The line above should be left blank to avoid script errors in OpenSim.
  2. //child.lslp
  3. //
  4. /*
  5. * Part of the Sloodle project (www.sloodle.org)
  6. *
  7. * Copyright (c) 2011-06 contributors (see below)
  8. * Released under the GNU GPL v3
  9. * -------------------------------------------
  10. *
  11. * This program is free software: you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation, either version 3 of the License, or
  14. * (at your option) any later version.
  15. *
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU General Public License for more details.
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  23. *
  24. * All scripts must maintain this copyrite information, including the contributer information listed
  25. *
  26. * Contributors:
  27. * Paul Preibisch
  28. *
  29. * DESCRIPTION
  30. * Place this scrip into any child objects that at hexagon quizzer rezzes. That way, when the hexagon quizzer receives a die emssage
  31. * from the root hex, it can clean up any other objects it rezzes
  32. */
  33. integer SLOODLE_CHANNEL_PARENT=-1639277024;
  34. integer master_listener;
  35. key MASTERS_KEY;
  36. integer SLOODLE_CHANNEL_CHILDREN=-1639277023;
  37. default {
  38. on_rez(integer start_param) {
  39. llResetScript();
  40. }
  41. state_entry() {
  42. master_listener=llListen(SLOODLE_CHANNEL_PARENT, "", "", "");
  43. llSay(SLOODLE_CHANNEL_CHILDREN,"I AM YOUR CHILD");
  44. }
  45. listen(integer channel, string name, key id, string str) {
  46. if (MASTERS_KEY==NULL_KEY){
  47. MASTERS_KEY= id;
  48. //we now have the master's key, so stop listening to all other keys on the SLOODLE_CHANNEL_QUIZ_MASTER_RESPONSE channel
  49. //and only listen to the master on this channel from now on.
  50. llListenRemove(master_listener);
  51. master_listener=llListen(SLOODLE_CHANNEL_PARENT, "", MASTERS_KEY, "");
  52. }
  53. if (str=="I AM YOUR FATHER"){
  54. return;
  55. }else
  56. if (str=="die"){
  57. llDie();
  58. }
  59. }
  60. }