Commit d17e7ec3 authored by Atsukio's avatar Atsukio 🐬

#38 Chat

- Changed Color codes to new text colors
- Uncommented replacing text to emoji
- Updated JSON to native JSON
- Merged and shortened code
- Commented old code
parent c0c39016
......@@ -14,27 +14,27 @@ variables:
{pchat.list::[sword]} = "o==[]::::::::::::::::>"
{pchat.list::[fliptable]} = "(╯°□°)╯︵ ┻━┻"
{pchat.list::[stareface]} = "ಠ_ಠ"
{pchat.list::&6} = "&6"
{pchat.list::&5} = "&5"
{pchat.list::&4} = "&4"
{pchat.list::&3} = "&3"
{pchat.list::&2} = "&2"
{pchat.list::&1} = "&1"
{pchat.list::&7} = "&7"
{pchat.list::&8} = "&8"
{pchat.list::&9} = "&9"
{pchat.list::&a} = "&a"
{pchat.list::&b} = "&b"
{pchat.list::&c} = "&c"
{pchat.list::&d} = "&d"
{pchat.list::&e} = "&e"
{pchat.list::&f} = "&f"
{pchat.list::&r} = "&r"
{pchat.list::&l} = "&l"
{pchat.list::&0} = "&0"
{pchat.list::&n} = "&n"
{pchat.list::&m} = "&m"
{pchat.list::&o} = "&o"
{pchat.list::&6} = "<orange>"
{pchat.list::&5} = "<purple>"
{pchat.list::&4} = "<red>"
{pchat.list::&3} = "<cyan>"
{pchat.list::&2} = "<green>"
{pchat.list::&1} = "<blue>"
{pchat.list::&7} = "<grey>"
{pchat.list::&8} = "<dark grey>"
{pchat.list::&9} = "<indigo>"
{pchat.list::&a} = "<light green>"
{pchat.list::&b} = "<light cyan>"
{pchat.list::&c} = "<light red>"
{pchat.list::&d} = "<magenta>"
{pchat.list::&e} = "<yellow>"
{pchat.list::&f} = "<white>"
{pchat.list::&r} = "<r>"
{pchat.list::&l} = "<b>"
{pchat.list::&0} = "<black>"
{pchat.list::&n} = "<u>"
{pchat.list::&m} = "<strike>"
{pchat.list::&o} = "<i>"
on chat:
if {auth.%player%} is not set:
......@@ -61,15 +61,16 @@ on chat:
loop all players:
set {_playercheck} to loop-player's name
if chat message contains "@%{_playercheck}%":
replace "@%{_playercheck}%" with "&[email protected]%{_playercheck}%&r" in message
replace "@%{_playercheck}%" with "<yellow>@%{_playercheck}%<r>" in message
if {pe.afk.%loop-player%} is set:
message "[&6AFK&f] &c%loop-player% &eis afk with message &7'%{pe.afk.%loop-player%}%'&e, he might not reply you."
message "[<orange>AFK<white>] <light red>%loop-player% <yellow>is afk with message <grey>'%{pe.afk.%loop-player%}%'<yellow>, he might not reply you."
if difference between now and {pchat.soundcheck.%loop-player%} is less than 5 seconds:
message "[&6PChat&f] &eNotification sound is not send because it's still in cooldown."
message "[<orange>PChat<white>] <yellow>Notification sound is not send because it's still in cooldown."
stop loop
playSound("%loop-player%" , "entity.experience_orb.pickup")
set {pchat.soundcheck.%loop-player%} to now
stop loop
command /test:
trigger:
......@@ -79,9 +80,9 @@ on chat:
if {auth.%player%} is not set:
cancel event
stop
loop {pchat.list::*}:
replace all loop-index with loop-value in message
set {_message} to message
#loop {pchat.list::*}:
# replace all loop-index with loop-value in message
set {_chat::1} to ""
set {_chat::2} to ""
......@@ -107,85 +108,89 @@ on chat:
set {_chat::1} to colored {_chat::1}
set {_chat::2} to colored {_chat::2}
if "%{pchat.firstplayer}%" is player's name:
if player has permission "potato.admin":
set {_rank} to "&4Admin"
else if player has permission "potato.alpha":
set {_rank} to "&aAlpha"
else if player has permission "potato.builder":
set {_rank} to "&dBuilder"
else if {pdonate.vip::%player%} is set:
set {_rank} to "&6VIP"
else:
set {_rank} to "&bPlayer"
cancel event
if {ptown.%player%} is set:
set {_playertown} to {ptown.%player%}
if {ptown.%player%} is not set:
set {_playertown} to "Townless"
log "<%player%> %message%" to "chat/%{day}%-%{month}%-%{year}%.log"
if {re.%player%.day} is more than 0:
if {_link} is set:
json("@a", "<&9%player's display name%||ttp:Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.day}% day(s) %{re.%player%.hour}% hour(s) %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%||&f> %{_chat::1}%||||&b&o&n[Click me]||url:%{_link}%|| %{_chat::2}%")
stop
json("@a", "<&9%player's display name%||ttp:Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.day}% day(s) %{re.%player%.hour}% hour(s) %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%||&f> %{_message}%")
#send json "<&9%player's display name%" tooltip "Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.day}% day(s) %{re.%player%.hour}% hour(s) %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%" then "&f> %{_message}%" to all players
set {pchat.previouschat} to player's name
stop
if {re.%player%.hour} is more than 0:
if {_link} is set:
json("@a", "<&9%player's display name%||ttp:Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.hour}% hour(s) %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%||&f> %{_chat::1}%||||&b&o&n[Click me]||url:%{_link}%|| %{_chat::2}%")
stop
json("@a", "<&9%player's display name%||ttp:Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.hour}% hour(s) %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%||&f> %{_message}%")
#send json "<&9%player's display name%" tooltip "Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.hour}% hour(s) %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%" then "&f> %{_message}%" to all players
set {pchat.previouschat} to player's name
stop
else:
if {_link} is set:
json("@a", "<&9%player's display name%||ttp:Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%||&f> %{_chat::1}%||||&b&o&n[Click me]||url:%{_link}%|| %{_chat::2}%")
stop
json("@a", "<&9%player's display name%||ttp:Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%||&f> %{_message}%")
# send json "<&9%player's display name%" tooltip "Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%" then "&f> %{_message}%" to all players
set {pchat.previouschat} to player's name
stop
set {_color} to "<indigo>"
if "%{pchat.secondplayer}%" is player's name:
if player has permission "potato.admin":
set {_rank} to "&4Admin"
else if player has permission "potato.alpha":
set {_rank} to "&aAlpha"
else if player has permission "potato.builder":
set {_rank} to "&dBuilder"
else if {pdonate.vip::%player%} is set:
set {_rank} to "&6VIP"
else:
set {_rank} to "&bPlayer"
cancel event
if {ptown.%player%} is set:
set {_playertown} to {ptown.%player%}
if {ptown.%player%} is not set:
set {_playertown} to "Townless"
log "<%player%> %message%" to "chat/%{day}%-%{month}%-%{year}%.log"
if {re.%player%.day} is more than 0:
if {_link} is set:
json("@a", "<&d%player's display name%||ttp:Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.day}% day(s) %{re.%player%.hour}% hour(s) %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%||&f> %{_chat::1}%||||&b&o&n[Click me]||url:%{_link}%|| %{_chat::2}%")
stop
json("@a", "<&d%player's display name%||ttp:Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.day}% day(s) %{re.%player%.hour}% hour(s) %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%||&f> %{_message}%")
#send json "<&d%player's display name%" tooltip "Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.day}% day(s) %{re.%player%.hour}% hour(s) %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%" then "&f> %{_message}%" to all players
set {pchat.previouschat} to player's name
set {_color} to "<magenta>"
if player has permission "potato.admin":
set {_rank} to "<red>Admin<r>"
else if player has permission "potato.alpha":
set {_rank} to "<light green>Alpha<r>"
else if player has permission "potato.builder":
set {_rank} to "<magenta>Builder<r>"
else if {pdonate.vip::%player%} is set:
set {_rank} to "<orange>VIP<r>"
else:
set {_rank} to "<light cyan>Player<r>"
cancel event
if {ptown.%player%} is set:
set {_playertown} to {ptown.%player%}
if {ptown.%player%} is not set:
set {_playertown} to "Townless"
log "<%player%> %message%" to "chat/%{day}%-%{month}%-%{year}%.log"
if {re.%player%.day} is more than 0:
if {_link} is set:
message "<tooltip:Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.day}% day(s) %{re.%player%.hour}% hour(s) %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%><%{_color}%%player's display name%<r><white>> %{_chat::1}%<link:%{_link}%><light cyan><i><u>[Click me]<r>%{_chat::2}%"
stop
if {re.%player%.hour} is more than 0:
if {_link} is set:
json("@a", "<&d%player's display name%||ttp:Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.hour}% hour(s) %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%||&f> %{_chat::1}%||||&b&o&n[Click me]||url:%{_link}%|| %{_chat::2}%")
stop
json("@a", "<&d%player's display name%||ttp:Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.hour}% hour(s) %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%||&f> %{_message}%")
#send json "<&d%player's display name%" tooltip "Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.hour}% hour(s) %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%" then "&f> %{_message}%" to all players
set {pchat.previouschat} to player's name
message "<tooltip:Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.day}% day(s) %{re.%player%.hour}% hour(s) %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%><%{_color}%%player's display name%<r><white>> %{_message}%"
#send json "<%{_color}%%player's display name%" tooltip "Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.day}% day(s) %{re.%player%.hour}% hour(s) %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%" then "<white>> %{_message}%" to all players
set {pchat.previouschat} to player's name
stop
if {re.%player%.hour} is more than 0:
if {_link} is set:
message "<tooltip:Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.hour}% hour(s) %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%><%{_color}%%player's display name%<r><white>> %{_chat::1}%<link:%{_link}%><light cyan><i><u>[Click me]<r>%{_chat::2}%"
stop
else:
if {_link} is set:
json("@a", "<&d%player's display name%||ttp:Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%||&f> %{_chat::1}%||||&b&o&n[Click me]||url:%{_link}%|| %{_chat::2}%")
stop
json("@a", "<&d%player's display name%||ttp:Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%||&f> %{_message}%")
#send json "<&d%player's display name%" tooltip "Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%" then "&f> %{_message}%" to all players
set {pchat.previouschat} to player's name
message "<tooltip:Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.hour}% hour(s) %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%><%{_color}%%player's display name%<r><white>> %{_message}%"
#send json "<%{_color}%%player's display name%" tooltip "Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.hour}% hour(s) %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%" then "<white>> %{_message}%" to all players
set {pchat.previouschat} to player's name
stop
else:
if {_link} is set:
message "<tooltip:Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%><%{_color}%%player's display name%<r><white>> %{_chat::1}%<link:%{_link}%><light cyan><i><u>[Click me]<r>%{_chat::2}%"
stop
message "<tooltip:Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%><%{_color}%%player's display name%<r><white>> %{_message}%"
# send json "<%{_color}%%player's display name%" tooltip "Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%" then "<white>> %{_message}%" to all players
set {pchat.previouschat} to player's name
stop
# if "%{pchat.secondplayer}%" is player's name:
# if player has permission "potato.admin":
# set {_rank} to "<red>Admin"
# else if player has permission "potato.alpha":
# set {_rank} to "<light green>Alpha"
# else if player has permission "potato.builder":
# set {_rank} to "<magenta>Builder"
# else if {pdonate.vip::%player%} is set:
# set {_rank} to "<orange>VIP"
# else:
# set {_rank} to "<light cyan>Player"
# cancel event
# if {ptown.%player%} is set:
# set {_playertown} to {ptown.%player%}
# if {ptown.%player%} is not set:
# set {_playertown} to "Townless"
# log "<%player%> %message%" to "chat/%{day}%-%{month}%-%{year}%.log"
# if {re.%player%.day} is more than 0:
# if {_link} is set:
# json("@a", "<<magenta>%player's display name%||ttp:Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.day}% day(s) %{re.%player%.hour}% hour(s) %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%||<white>> %{_chat::1}%||||<light cyan><i><u>[Click me]||url:%{_link}%|| %{_chat::2}%")
# stop
# json("@a", "<<magenta>%player's display name%||ttp:Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.day}% day(s) %{re.%player%.hour}% hour(s) %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%||<white>> %{_message}%")
# #send json "<<magenta>%player's display name%" tooltip "Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.day}% day(s) %{re.%player%.hour}% hour(s) %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%" then "<white>> %{_message}%" to all players
# set {pchat.previouschat} to player's name
# stop
# if {re.%player%.hour} is more than 0:
# if {_link} is set:
# json("@a", "<<magenta>%player's display name%||ttp:Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.hour}% hour(s) %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%||<white>> %{_chat::1}%||||<light cyan><i><u>[Click me]||url:%{_link}%|| %{_chat::2}%")
# stop
# json("@a", "<<magenta>%player's display name%||ttp:Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.hour}% hour(s) %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%||<white>> %{_message}%")
# #send json "<<magenta>%player's display name%" tooltip "Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.hour}% hour(s) %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%" then "<white>> %{_message}%" to all players
# set {pchat.previouschat} to player's name
# stop
# else:
# if {_link} is set:
# json("@a", "<<magenta>%player's display name%||ttp:Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%||<white>> %{_chat::1}%||||<light cyan><i><u>[Click me]||url:%{_link}%|| %{_chat::2}%")
# stop
# json("@a", "<<magenta>%player's display name%||ttp:Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%||<white>> %{_message}%")
# #send json "<<magenta>%player's display name%" tooltip "Rank: %{_rank}% %newline%Town: %{_playertown}% %newline%Playtime: %{re.%player%.minute}% minute(s) %{re.%player%.second}% second(s) %newline%Sent: %now%" then "<white>> %{_message}%" to all players
# set {pchat.previouschat} to player's name
# stop
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment