website/resources/txt/lore.sk
2022-09-07 12:29:20 +03:00

57 lines
1.9 KiB
Plaintext
Executable File

#override with lore expression so I can make veeery custom lores
#TODO I think Spigot API has a way to get last color code, that would highly reduce count of code needed for this
expression %itemstack% with lore %strings%:
get:
set {_item} to expression 1
set {_lore::*} to expressions 2
loop {_lore::*}:
if loop-value contains "||":
set {_list::*} to loop-value split at "||"
delete {_lore::%loop-index%}
loop {_list::*}:
add 1 to {_i}
set {_lore::%loop-index-1%.%{_i}%} to loop-value-2
loop {_lore::*}:
length of uncolored loop-value is higher than 25
delete {_lore::%loop-index%}
set {_index} to loop-index parsed as a number
set {_line} to loop-value
set {_line::*} to {_line} split at " "
set {_colors} to loop-value
set {_color} to ""
delete {_last}
{_firstline} is not set:
while first index of "§" in {_colors} is not -1:
add 1 to {_nolag}
if {_nolag} is higher than 1000:
send "LAGG lore" to ops
stop
set {_c} to first index of "§" in {_colors}
set {_final} to substring of {_colors} from characters {_c} to {_c}+1
set {_color} to "%{_color}%%{_final}%"
set {_last} to {_final}
set {_colors} to substring of {_colors} from characters {_c}+1 to length of {_colors}
else:
set {_firstline} to true
loop {_line::*}:
if {_text} is not set:
set {_text} to "%{_color}%%loop-value-2%"
else:
set {_text} to "%{_text}% %loop-value-2%"
if length of uncolored {_text} is not less than 25:
add 0.0001 to {_adder}
set {_A} to {_index}+{_adder}
set {_lore::%{_A}%} to {_text}
delete {_text}
{_text} is set:
add 0.0002 to {_adder}
set {_A} to {_index}+{_adder}
set {_lore::%{_A}%} to {_text}
delete {_text}
set lore of {_item} to {_lore::*}
return {_item}