HiSzPaNVIP

Untitled

Aug 23rd, 2016
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. on chat:
  2.  
  3. # tęczowy tekst)
  4. player has permission "chatplus.tecza":
  5. set {_zabezpieczenie} to 0
  6. while message contains "&t":
  7. add 1 to {_zabezpieczenie}
  8. {_zabezpieczenie} is more than 10:
  9. stop
  10. set {_t} to first index of "&t" in message # pozycja tagu (&t) do formatowania
  11.  
  12. set {_tf} to subtext of message from character ({_t}) to character (length of message) # tekst do formatowania ł±cznie z tekstem po nim
  13. replace "&t" in {_tf} with "" # usuwanie tagu z tekstu do formatowania
  14.  
  15. set {_nc1} to (first index of "&" in {_tf} - 1) # pozycja ewentualnego nastepnego tagu
  16. {_nc1} is -1: # gdyby nie było następnego tagu
  17. set {_nc1} to (length of {_tf}) # przypisywana jest pozycja ostatniego znaku tekstu
  18. set {_nc2} to (first index of "@" in {_tf} - 1)
  19. {_nc2} is -1:
  20. set {_nc2} to (length of {_tf})
  21. set {_nc3} to (first index of "&f[&e%rounded x location of player%&f|&e%rounded y location of player%&f|&e%rounded z location of player%&f]" in {_tf} - 1)
  22. {_nc3} is -1:
  23. set {_nc3} to (length of {_tf})
  24.  
  25. {_nc1} is less than {_nc2} and {_nc3}:
  26. set {_nc} to {_nc1}
  27. {_nc2} is less than {_nc3} and {_nc1}:
  28. set {_nc} to {_nc2}
  29. {_nc3} is less than {_nc1} and {_nc2}:
  30. set {_nc} to {_nc3}
  31.  
  32. set {_tf} to subtext of {_tf} from characters 1 to ({_nc}) # usuwanie tekstu do formatowania od następnego tagu
  33.  
  34. set {_tf::*} to {_tf} split at ""
  35. set {_nr} to 1 # predefiniowanie
  36. set {_w} to "" # pomocniczych zmiennych
  37. loop {_tf::*}:
  38. loop-value is "":
  39. delete {_tf::%loop-index%}
  40. loop-value is " ":
  41. set {_w} to "%{_w}% "
  42. loop-value is not "" or " ":
  43. {_nr} is 1:
  44. set {_c} to "&5"
  45. {_nr} is 2:
  46. set {_c} to "&1"
  47. {_nr} is 3:
  48. set {_c} to "&9"
  49. {_nr} is 4:
  50. set {_c} to "&2"
  51. {_nr} is 5:
  52. set {_c} to "&a"
  53. {_nr} is 6:
  54. set {_c} to "&e"
  55. {_nr} is 7:
  56. set {_c} to "&6"
  57. {_nr} is 8:
  58. set {_c} to "&c"
  59. {_nr} is 9:
  60. set {_c} to "&4"
  61. set {_w} to "%{_w}%%{_c}%%loop-value%"
  62. add 1 to {_nr}
  63. {_nr} is 10:
  64. set {_nr} to 1
  65. replace "&t%{_tf}%" in message with "%{_w}%&r"
Advertisement
Add Comment
Please, Sign In to add comment