link_control.lsl 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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:36:47
  7. // :EDITED:2015-06-12 16:41:13
  8. // :ID:1078
  9. // :NUM:1754
  10. // :REV:1.1
  11. // :WORLD:Second Life, Opensim
  12. // :DESCRIPTION:
  13. // Link 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. // Link control (secondary switch) for RealFire
  17. //
  18. //
  19. // Drop this in any prim (within the same linkset) you want to use as an on/off/menu switch
  20. // Note: only useful if you want to use a different prim as a switch (other than the fire prim)
  21. string title = "Link Control"; // title
  22. string version = "1.1"; // version
  23. integer silent = TRUE; // silent startup
  24. // Constants
  25. integer msgNumber = 10959; // number part of link message
  26. default
  27. {
  28. state_entry()
  29. {
  30. if (!silent) llWhisper(0, title + " " + version + " ready");
  31. }
  32. on_rez(integer start_param)
  33. {
  34. llResetScript();
  35. }
  36. touch_start(integer total_number)
  37. {
  38. llResetTime();
  39. }
  40. touch_end(integer total_number)
  41. {
  42. key user = llDetectedKey(0);
  43. if (llGetTime() > 1.0) {
  44. llMessageLinked(LINK_ALL_OTHERS, msgNumber, "menu", user);
  45. }
  46. else {
  47. llMessageLinked(LINK_ALL_OTHERS, msgNumber, "switch", user);
  48. }
  49. }
  50. }