remote_receiver.lsl 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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:21
  7. // :EDITED:2015-06-12 16:41:13
  8. // :ID:1078
  9. // :NUM:1760
  10. // :REV:1.2
  11. // :WORLD:Second Life, Opensim
  12. // :DESCRIPTION:
  13. // Remote receiver 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 receiver for RealFire
  17. //
  18. // Drop this into the same prim where the FIRE SCRIPT is located
  19. // Note: only useful if you are also using the remote control script
  20. string title = "Remote Receiver"; // title
  21. string version = "1.2"; // version
  22. integer silent = TRUE; // silent startup
  23. // Constants
  24. integer remoteChannel = -975102; // remote channel
  25. integer msgNumber = 10959; // number part of link message
  26. string separator = ";;"; // separator for region messages
  27. // Functions
  28. string getGroup()
  29. {
  30. string str = llStringTrim(llGetObjectDesc(), STRING_TRIM);
  31. if (llToLower(str) == "(no description)" || str == "") str = "Default";
  32. return str;
  33. }
  34. default
  35. {
  36. state_entry()
  37. {
  38. llListen(remoteChannel, "", "", "");
  39. if (!silent) llWhisper(0, title + " " + version + " ready");
  40. }
  41. on_rez(integer start_param)
  42. {
  43. llResetScript();
  44. }
  45. listen(integer channel, string name, key id, string msg)
  46. {
  47. if (channel != remoteChannel) return;
  48. list msgList = llParseString2List(msg, [separator], []);
  49. string group = llList2String(msgList, 0);
  50. string command = llList2String(msgList, 1);
  51. key user = (key)llList2String(msgList, 2);
  52. if (group == getGroup() || group == "Default" || getGroup() == "Default") {
  53. llMessageLinked(LINK_THIS, msgNumber, command, user);
  54. }
  55. }
  56. }