Advertisement
Guest User

TIGACRAFT_NOTES.txt

a guest
Feb 19th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.03 KB | None | 0 0
  1. $${
  2. //CONFIG:
  3. &rpg_note = "/note";
  4. &rpg_notes = "/notes";
  5. &rpg_note_add = "/note add";
  6. &rpg_note_edit = "/note edit";
  7. &rpg_note_remove = "/note delete";
  8. &rpg_note_send = "/note send";
  9. &rpg_note_timer = "/note timer";
  10. ifbeginswith(%CHAT%,"%&rpg_note%");
  11. //note list:
  12. ifbeginswith(%CHAT%,"%&rpg_notes%");
  13. if(%@&tigacraft_notes% != "");
  14. split("</note>","%@&tigacraft_notes%",&notes[]);
  15. arraysize(&notes[],#size);
  16. else;
  17. #size = 0;
  18. endif;
  19. #i = -1;
  20. lograw([{"text":"§bYou have §e%#size% §bnotes:§r "},{"text":"§8[§bupdate§8]§r ","hoverEvent":{"action":"show_text","value":"§8Command: §7%&rpg_notes%"},"clickEvent":{"action":"run_command","value":"%&rpg_notes%"}},{"text":"§8[§aadd§8]§r","hoverEvent":{"action":"show_text","value":"§8Command: §7%&rpg_note_add%"},"clickEvent":{"action":"suggest_command","value":"%&rpg_note_add% "}}]);
  21. DO(%#size%);
  22. inc(#i);
  23. match(%&notes[%#i%]%,"<note:(.*?)>(.*)",{&id,&note});
  24. lograw([{"text":"§f- §8[§eEdit§8]§r ","hoverEvent":{"action":"show_text","value":"§eEdit this note"},"clickEvent":{"action":"suggest_command","value":"%&rpg_note_edit% %&id% %&note%"}},{"text":"§8[§cDelete§8]§r ","hoverEvent":{"action":"show_text","value":"§cDelete this note!"},"clickEvent":{"action":"run_command","value":"%&rpg_note_remove% %&id%"}},{"text":"§8[§asend§8]§r ","hoverEvent":{"action":"show_text","value":"Sende diese Nachricht per ECHO Befehl in den Chat!"},"clickEvent":{"action":"run_command","value":"%&rpg_note_send% %&id%"}},{"text":"§8[§6%#i%§8]:§r %&note%","hoverEvent":{"action":"show_text","value":"%&note%"},"clickEvent":{"action":"suggest_command","value":""}}]);
  25. LOOP();
  26. endif;
  27. //note add:
  28. ifmatches(%CHAT%,"^%&rpg_note_add% (.*?) (.*)");
  29. match(%CHAT%,"^%&rpg_note_add% (.*?) (.*)",{&id,&note});
  30. ifmatches(%@&tigacraft_notes%,"<note:%&id%>(.*)<\/note>");
  31. log("§cEs existiert bereits eine Note mit diesem Namen! (%&id%)");
  32. else;
  33. if(%@&tigacraft_notes% != "");
  34. split("</note>","%@&tigacraft_notes%",&notes[]);
  35. arraysize(&notes[],#size);
  36. else;
  37. #size = 0;
  38. endif;
  39.  
  40. @&tigacraft_notes = "%@&tigacraft_notes%<note:%&id%>%&note%</note>";
  41. lograw({"text":"§aDie Nachricht wurde gespeichert.","hoverEvent":{"action":"show_text","value":"[%#size%] %&note%"}});
  42. endif;
  43. endif;
  44. //note delete:
  45. ifmatches(%CHAT%,"^%&rpg_note_remove% (.*)");
  46. match(%CHAT%,"^%&rpg_note_remove% (.*)",{&id});
  47. regexreplace(@&tigacraft_notes,"<note:%&id%>(.*?)<\/note>","");
  48. lograw({"text":"§cDie Nachricht wurde gelöscht!"});
  49. endif;
  50. //note edit:
  51. ifmatches(%CHAT%,"^%&rpg_note_edit% (.*?) (.*)");
  52. match(%CHAT%,"^%&rpg_note_edit% (.*?) (.*)",{&id,&text});
  53. regexreplace(@&tigacraft_notes,"<note:%&id%>(.*?)<\/note>","<note:%&id%>%&text%<\/note>");
  54. lograw({"text":"§eDie Nachricht wurde geändert."});
  55. endif;
  56. //note send:
  57. ifmatches(%CHAT%,"^%&rpg_note_send% (.*)");
  58. match(%CHAT%,"^%&rpg_note_send% (.*)",{&id});
  59. match(%@&tigacraft_notes%,"<note:%&id%>(.*)<\/note>",{&note});
  60. ifmatches(%&note%,"\|");
  61. split("|","%&note%",&notes[]);
  62. arraysize(&notes[],#size);
  63. #i = -1;
  64. #t = 0;
  65. DO(%#size%);
  66. inc(#i);
  67. exec("TIGACRAFT_ECHO.txt","TIGACRAFT: Echo","%&notes[%#i%]%","%#t%");
  68. #t = #t + 1;
  69. LOOP();
  70. else;
  71. echo("%&note%");
  72. endif;
  73. endif;
  74. filter();
  75. endif;
  76. }$$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement