remote_control.lsl 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // :SHOW:1
  2. // :CATEGORY:Fire
  3. // :NAME:Realfire by Rene
  4. // :AUTHOR:Rene10957 Resident
  5. // :KEYWORDS: light,lamp,lighting
  6. // :CREATED:2015-06-11 14:37:20
  7. // :EDITED:2015-06-12 16:41:13
  8. // :ID:1078
  9. // :NUM:1759
  10. // :REV:1.1
  11. // :WORLD:Second Life, Opensim
  12. // :DESCRIPTION:
  13. // Remote control (secondary switch) for RealFire
  14. // :CODE:
  15. //:LICENSE: CC0 (Public Domain). To the extent possible under law, Rene10957 has waived all copyright and related or neighboring rights.For more information, see http://creativecommons.org/publicdomain/zero/1.0/.
  16. // Remote control (secondary switch) for RealFire
  17. //
  18. // Drop this in an external prim you want to use as an extra on/off/menu switch
  19. // Note: only useful if you need an external switch for a single fire
  20. //
  21. // A switch can be bound to a fire by entering the same word in the description of both prims
  22. // Alternatively, you can use the network switch to control up to 9 fires
  23. string title = "Remote Control"; // title
  24. string version = "1.1"; // version
  25. integer silent = TRUE; // silent startup
  26. // Constants
  27. integer remoteChannel = -975102; // remote channel
  28. string separator = ";;"; // separator for region messages
  29. // Functions
  30. string getGroup()
  31. {
  32. string str = llStringTrim(llGetObjectDesc(), STRING_TRIM);
  33. if (llToLower(str) == "(no description)" || str == "") str = "Default";
  34. return str;
  35. }
  36. default
  37. {
  38. state_entry()
  39. {
  40. if (!silent) llWhisper(0, title + " " + version + " ready");
  41. }
  42. on_rez(integer start_param)
  43. {
  44. llResetScript();
  45. }
  46. touch_start(integer total_number)
  47. {
  48. llResetTime();
  49. }
  50. touch_end(integer total_number)
  51. {
  52. key user = llDetectedKey(0);
  53. string command;
  54. if (llGetTime() > 1.0) command = "menu";
  55. else command = "switch";
  56. list msgList = [getGroup(), command, user];
  57. string msgData = llDumpList2String(msgList, separator);
  58. llRegionSay(remoteChannel, msgData);
  59. }
  60. }