Commit 63573032 authored by Tommy Ang's avatar Tommy Ang 🤣

Fix link in chat

parent b2840157
......@@ -80,16 +80,14 @@ on chat:
set {_message} to message
set {_chat::1} to ""
set {_chat::2} to ""
if {_message} contains "http://" or "https://":
set {_toadd} to 1
set {_found} to 0
set {_message::*} to {_message} split at " "
set {_chat::2} to the first 2 characters of {_message::1}
# set {_chat::2} to the first 2 characters of {_message::1}
loop {_message::*}:
if "%loop-value%" contains "http://" or "https://":
if {_found} is 0:
message "%loop-value%"
set {_link} to loop-value
set {_toadd} to 2
set {_found} to 1
......@@ -122,21 +120,21 @@ on chat:
log "<%player%> %message%" to "chat/%{day}%-%{month}%-%{year}%.log"
if {re.%player%.day} is more than 0:
if {_link} is set:
message formatted "<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}%" to all players
message formatted "<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>%{_link}%<r> %{_chat::2}%" to all players
stop
message formatted "<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}%" to all players
set {pchat.previouschat} to player's name
stop
if {re.%player%.hour} is more than 0:
if {_link} is set:
message formatted "<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}%" to all players
message formatted "<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>%{_link}%<r> %{_chat::2}%" to all players
stop
message formatted "<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}%" to all players
set {pchat.previouschat} to player's name
stop
else:
if {_link} is set:
message formatted "<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}%" to all players
message formatted "<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>%{_link}%<r> %{_chat::2}%" to all players
stop
message formatted "<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}%" to all players
set {pchat.previouschat} to player's name
......
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