Advertisement
Guest User

Untitled

a guest
Oct 11th, 2014
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. #ChatFAQ by 8bitfusion!
  2. #This skript should do nicely to stop people who didn't read the post!
  3. command /chatfaq <text> <text> [<text>]:
  4. permission:skript.op
  5. trigger:
  6. if arg-1 is "add":
  7. if arg-2 is not "add", "remove" or "reset":
  8. set {FAQs::%arg-2%} to arg-2
  9. message "<orange>Added %arg-2% to Frequently Asked Questions!"
  10. else:
  11. message "<red>You cannot use a keyword as an FAQ name!"
  12. else if arg-1 is "remove":
  13. if {FAQs::%arg-2%} is set:
  14. remove arg-2 from {FAQs::*}
  15. delete {Keywords.%arg-2%::*}
  16. delete {Text.FAQ::%arg-2%}
  17. message "<orange>Removed %arg-2% from Frequently Asked Questions!"
  18. else if arg-1 is "settext":
  19. if {FAQs::%arg-2%} is set:
  20. if arg-3 is set:
  21. set {Text.FAQ::%arg-2%} to arg-3
  22. message "Text %arg-3% added to FAQ %arg-2%!"
  23. else:
  24. message "<red>You must define the text!"
  25. else:
  26. message "<red>No FAQ exists with name %arg-2%!"
  27. else if arg-1 is "formattext":
  28. if {FAQs::%arg-2%} is set:
  29. if arg-3 is set:
  30. set {Text.FAQ::%arg-2%} to "§%arg-3%%{Text.FAQ::%arg-2%}%"
  31. message "§%arg-3%%arg-2%’s text will look like this!"
  32. else:
  33. message "<red>You must define the formatting code!"
  34. else:
  35. message "<red>No FAQ exists with name %arg-2%!"
  36. else if arg-1 is "addkeyword":
  37. if {FAQs::%arg-2%} is set:
  38. if arg-3 is set:
  39. set {Keywords.%arg-2%::%arg-3%} to arg-3
  40. message "<orange>Keyword %arg-3% added to FAQ %arg-2%!"
  41. else:
  42. message "<red>You must define the formatting code!"
  43. else:
  44. message "<red>No FAQ exists with name %arg-2%!"
  45. else if arg-1 is "resetkeywords":
  46. if {FAQs::%arg-2%} is set:
  47. delete {Keywords.%arg-2%::*}
  48. message "<orange>Keywords for %arg-2% have been reset!"
  49. else:
  50. message "<red>No FAQ exists with name %arg-2%!"
  51. else if arg-1 is "reset":
  52. loop {FAQs::*}:
  53. delete {Keywords.%{FAQs::%loop-value%}%::*}
  54. delete {Text.FAQ::*}
  55. delete {FAQs::*}
  56. message "<orange>All FAQs have been reset!"
  57. on chat:
  58. loop {FAQs::*}:
  59. loop {Keywords.%{FAQs::%loop-value%}%::*}:
  60. if "%message%" contains "%loop-value-2%":
  61. cancel event
  62. message "%{Text.FAQ::%loop-value-1%}%"
  63. exit loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement