Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on chat:
- # tęczowy tekst)
- player has permission "chatplus.tecza":
- set {_zabezpieczenie} to 0
- while message contains "&t":
- add 1 to {_zabezpieczenie}
- {_zabezpieczenie} is more than 10:
- stop
- set {_t} to first index of "&t" in message # pozycja tagu (&t) do formatowania
- set {_tf} to subtext of message from character ({_t}) to character (length of message) # tekst do formatowania ł±cznie z tekstem po nim
- replace "&t" in {_tf} with "" # usuwanie tagu z tekstu do formatowania
- set {_nc1} to (first index of "&" in {_tf} - 1) # pozycja ewentualnego nastepnego tagu
- {_nc1} is -1: # gdyby nie było następnego tagu
- set {_nc1} to (length of {_tf}) # przypisywana jest pozycja ostatniego znaku tekstu
- set {_nc2} to (first index of "@" in {_tf} - 1)
- {_nc2} is -1:
- set {_nc2} to (length of {_tf})
- 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)
- {_nc3} is -1:
- set {_nc3} to (length of {_tf})
- {_nc1} is less than {_nc2} and {_nc3}:
- set {_nc} to {_nc1}
- {_nc2} is less than {_nc3} and {_nc1}:
- set {_nc} to {_nc2}
- {_nc3} is less than {_nc1} and {_nc2}:
- set {_nc} to {_nc3}
- set {_tf} to subtext of {_tf} from characters 1 to ({_nc}) # usuwanie tekstu do formatowania od następnego tagu
- set {_tf::*} to {_tf} split at ""
- set {_nr} to 1 # predefiniowanie
- set {_w} to "" # pomocniczych zmiennych
- loop {_tf::*}:
- loop-value is "":
- delete {_tf::%loop-index%}
- loop-value is " ":
- set {_w} to "%{_w}% "
- loop-value is not "" or " ":
- {_nr} is 1:
- set {_c} to "&5"
- {_nr} is 2:
- set {_c} to "&1"
- {_nr} is 3:
- set {_c} to "&9"
- {_nr} is 4:
- set {_c} to "&2"
- {_nr} is 5:
- set {_c} to "&a"
- {_nr} is 6:
- set {_c} to "&e"
- {_nr} is 7:
- set {_c} to "&6"
- {_nr} is 8:
- set {_c} to "&c"
- {_nr} is 9:
- set {_c} to "&4"
- set {_w} to "%{_w}%%{_c}%%loop-value%"
- add 1 to {_nr}
- {_nr} is 10:
- set {_nr} to 1
- replace "&t%{_tf}%" in message with "%{_w}%&r"
Advertisement
Add Comment
Please, Sign In to add comment