1
0

llResetLandPassList.lsl 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. //Commands are:
  2. ///5 ban:full_avatar_name
  3. ///5 tempban:full_avatar_name
  4. ///5 unban:full_avatar_name
  5. ///5 pass:full_avatar_name
  6. ///5 unpass:full_avatar_name
  7. ///5 clearban
  8. ///5 clearpass
  9. string command;
  10. default
  11. {
  12. state_entry()
  13. {
  14. llListen(5, "", llGetOwner(), "");
  15. }
  16. on_rez(integer param)
  17. {
  18. llResetScript();
  19. }
  20. listen(integer chan, string name, key id, string message)
  21. {
  22. if (command != "")
  23. {
  24. llOwnerSay("Sorry, still processing last command, try again in a second.");
  25. }
  26. list args = llParseString2List(message,[":"],[]);
  27. command = llToLower(llList2String(args,0));
  28. if (command == "clearbans")
  29. {
  30. llResetLandBanList();
  31. }
  32. if (command == "clearpass")
  33. {
  34. llResetLandPassList();
  35. }
  36. else
  37. {
  38. llSensor(llList2String(args,1),NULL_KEY,AGENT,96,PI);
  39. }
  40. }
  41. no_sensor()
  42. {
  43. command = "";
  44. }
  45. sensor(integer num)
  46. {
  47. integer i;
  48. for (i=0; i< num; ++i)
  49. {
  50. if (command == "ban")
  51. {
  52. // Ban indefinetely
  53. llAddToLandBanList(llDetectedKey(i),0.0);
  54. }
  55. if (command == "tempban")
  56. {
  57. // Ban for 1 hour.
  58. llAddToLandBanList(llDetectedKey(i),1.0);
  59. }
  60. if (command == "unban")
  61. {
  62. llRemoveFromLandBanList(llDetectedKey(i));
  63. }
  64. if (command == "pass")
  65. {
  66. // Add to land pass list for 1 hour
  67. llAddToLandPassList(llDetectedKey(i),1.0);
  68. }
  69. if (command == "unpass")
  70. {
  71. llRemoveFromLandPassList(llDetectedKey(i));
  72. }
  73. }
  74. command = "";
  75. }
  76. }