sloodle_tracker_button.lslp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. //
  2. // The line above should be left blank to avoid script errors in OpenSim.
  3. // This file is part of SLOODLE Tracker.
  4. // It provides the button functionality.
  5. // Copyright (c) 2009-11 Sloodle community (various contributors)
  6. // SLOODLE Tracker is free software: you can redistribute it and/or modify
  7. // it under the terms of the GNU General Public License as published by
  8. // the Free Software Foundation, either version 3 of the License, or
  9. // (at your option) any later version.
  10. // SLOODLE Tracker is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. // GNU General Public License for more details.
  14. // You should have received a copy of the GNU General Public License.
  15. // If not, see <http://www.gnu.org/licenses/>
  16. //
  17. // Contributors:
  18. // Peter R. Bloomfield
  19. // Julio Lopez (SL: Julio Solo)
  20. // Michael Callaghan (SL: HarmonyHill Allen)
  21. // Kerri McCusker (SL: Kerri Macchi)
  22. // A project developed by the Serious Games and Virtual Worlds Group.
  23. // Intelligent Systems Research Centre.
  24. // University of Ulster, Magee
  25. integer CHANNEL = 447851; // Channel for the tasks to comunicate
  26. string MY_TYPE = "button"; // What type of tracker tool is this?
  27. default
  28. {
  29. touch_start(integer total_number)
  30. {
  31. // Inform the main script of each avatar who has touched this object
  32. integer i = 0;
  33. for (i = 0; i < total_number; i++)
  34. {
  35. llMessageLinked(LINK_THIS, CHANNEL, "INTERACTION|"+MY_TYPE+"|0", llDetectedKey(i));
  36. }
  37. }
  38. link_message(integer sender_num, integer num, string sval, key kval)
  39. {
  40. // Was this an interaction response?
  41. if (sval == "INTERACTION_RESPONSE" && kval != NULL_KEY)
  42. {
  43. llSay(0, llKey2Name(kval) + " touched this button.");
  44. }
  45. }
  46. }
  47. // Please leave the following line intact to show where the script lives in Git:
  48. // SLOODLE LSL Script Git Location: mod/tracker-1.0/objects/default/assets/sloodle_tracker_button.lslp