command rankup [<STRING>]:
trigger:
set {_p} to player
{_p} is online:
set {_next} to {skyblock::ranks::%{skyblock::ranks::%getPlayerRank({_p}, false)%::short} + 1%}
send nl and " &f&l&m " and nl to {_p}
send "&7 - &fOyuncu: &e%{_p}%" to {_p}
send "&7 - &fRütbe: &r%getPlayerRank({_p}, true)% &f&l>&r %colored {skyblock::ranks::%{_next}%::prefix} ? "&aYok"%" to {_p}
nextLevel({_p}) is set: #eğer oyuncu son seviyeyse, artık bunları göstermenin anlamı yok :)
send "&7 - &fPuan:&d %getPoint({_p})%" to {_p}
send "&7 - &fGerekli puan: &e%getRequiredNextLevel({_p})%" to {_p}
send "&7 - &fİlerleme: %progressBar(getPoint({_p}), 100, "|", 50, "&a&lBitti") ? "&cYok"%" to {_p}
else:
send "&7 - &dSon seviyesiniz ;)" to {_p}
send nl and " &f&l&m " to {_p}
updatePlayerRank({_p})
else:
send "&cBöyle bir oyuncu bulunamadı/aktif değil!" to {_p}
command rankupadmin [<text>] [<text>] [<text>] [<text>]:
permission: admin.rankup
permission message: &cBu komutu kullanamazsın!
trigger:
set {_p} to sender
arg 1 is "info":
arg 2 is set:
hasRank(arg 2) is true:
send nl and "&3[RANKS] &e%arg 2%&b adlı rütbenin bilgileri:" to {_p}
send "&7 - &fSıra: &d##%{skyblock::ranks::%arg 2%::short}%" to {_p}
send "&7 - &fİsim: &b%{skyblock::ranks::%arg 2%::name}%" to {_p}
send "&7 - &fPrefix: &d%colored {skyblock::ranks::%arg 2%::prefix}%" to {_p}
send "&7 - &fPuan: &a%{skyblock::ranks::%arg 2%::point}%" to {_p}
send "&7 - &fYetki: &agroup.%{skyblock::ranks::%arg 2%::name}%" and nl to {_p}
else:
send "&3[RANKS] &cBöyle bir rank bulunamadı!" to {_p}
else:
send "&3[RANKS] &cLütfen bir rank adı girin!" to {_p}
arg 1 is "create":
arg 2 is set:
hasRank(arg 2) is not set:
arg 3 is set:
arg 4 is set:
set {_lastCreatedRank} to "%{skyblock::ranks::%size of {skyblock::ranks::*}%} ? "Null"%"
{skyblock::ranks::%{_lastCreatedRank}%::point} ? 0 < (arg 3 parsed as number):
add arg 2 to {skyblock::ranks::*}
set {skyblock::ranks::%arg 2%::short} to size of {skyblock::ranks::*}
set {skyblock::ranks::%arg 2%::name} to arg 2
set {skyblock::ranks::%arg 2%::point} to (arg 3 parsed as number)
set {skyblock::ranks::%arg 2%::prefix} to arg 4
send nl and "&3[RANKS] &e%arg 2%&b adlı rütbe oluşturuldu:" to {_p}
send "&7 - &fSıra: &d##%{skyblock::ranks::%arg 2%::short}%" to {_p}
send "&7 - &fİsim: &b%{skyblock::ranks::%arg 2%::name}%" to {_p}
send "&7 - &fPrefix: &d%colored {skyblock::ranks::%arg 2%::prefix}%" to {_p}
send "&7 - &fPuan: &a%{skyblock::ranks::%arg 2%::point}%" to {_p}
send "&7 - &fYetki: &agroup.%{skyblock::ranks::%arg 2%::name}%" and nl to {_p}
else:
send "&3[RANKS] &cEklediğiniz rütbenin puanı, bir önceki rütbeden yüksek olmak zorunda!" to {_p}
send "&3[RANKS] &5Bir önceki rütbe: &d%{_lastCreatedRank}% &c|&6 Puanı:&e %{skyblock::ranks::%{_lastCreatedRank}%::point} ? 0%"
else:
send "&3[RANKS] &cLütfen prefix'i girin!" to {_p}
else:
send "&3[RANKS] &cLütfen gerekli puanı'ı girin!" to {_p}
else:
send "&3[RANKS] &cBu rank zaten mevcut!" to {_p}
else:
send "&3[RANKS] &cLütfen bir rank adı girin!" to {_p}
arg 1 is "remove":
arg 2 is set:
hasRank(arg 2) is true:
remove arg 2 from {skyblock::ranks::*}
delete {skyblock::ranks::%arg 2%::*}
send "&3[RANKS] &a%arg 2%&b silindi!" to {_p}
else:
send "&3[RANKS] &cBöyle bir rank bulunamadı!" to {_p}
else:
send "&3[RANKS] &cLütfen bir rank adı girin!" to {_p}
arg 1 is "reset":
delete {skyblock::ranks::*}
send "&3[RANKS] &aRütbeler sıfırlandı!" to {_p}
arg 1 is "list":
send nl and " &f&l&m " and nl to {_p}
loop {skyblock::ranks::*}:
send "&f- &6%loop-value% &8|&e&o /%command% info %loop-value%" to {_p}
send nl and " &f&l&m " and nl to {_p}
function updatePlayerRank(p: PLAYER) :: BOOLEAN:
nextLevel({_p}) is set:
set {_point} to getPoint({_p})
set {_needPoint} to getRequiredNextLevel({_p})
{_point} >= {_needPoint}:
execute console command "lp user %{_p}% parent set %nextLevel({_p})%"
play sound "ENTITY_PLAYER_LEVELUP" with volume 0.5 to {_p}
slidingText({_p}, " Tebrikler, seviye atladın!", "&fYeni seviye: %getPlayerRank({_p}, true)%")
return true
return false
function nextLevel(p: PLAYER) :: STRING:
return {skyblock::ranks::%{skyblock::ranks::%getPlayerRank({_p}, false)%::short} + 1%}
function hasRank(rank: STRING) :: BOOLEAN:
return true if {skyblock::ranks::*} contains {_rank}
function getPoint(p: PLAYER) :: INTEGER:
return placeholder "Level_aoneblock_island_level" from {_p} parsed as number
function getPlayerRank(p: PLAYER, state: BOOLEAN) :: STRING:
loop reversed {skyblock::ranks::*}:
{_p} has permission "group.%loop-value in lowercase%":
return loop-value if {_state} is false, else colored {skyblock::ranks::%loop-value in lowercase%::prefix}
return colored "&7default"
function getRequiredNextLevel(p: PLAYER) :: INTEGER:
return {skyblock::ranks::%{skyblock::ranks::%{skyblock::ranks::%getPlayerRank({_p}, false)%::short} + 1%}%::point} - getPoint({_p}) ? 0
local function progressBar(current: INTEGER, total: INTEGER, symbol: STRING, size: INTEGER, fullBar: STRING) :: STRING:
loop {_size} times:
set {_progress} to "%{_progress} ? ""%%{_symbol}%"
set {_full} to "%subtext of {_progress} from indices 1 to (({_current} / {_total}) * {_size} * (length of {_symbol})) ? ""%"
set {_void} to "&7%subtext of {_progress} from indices (({_current} / {_total}) * {_size} * (length of {_symbol}))+1 to (length of {_progress}) ? " "%"
{_current} >= {_total}:
set {_full} to "||||||||||||||||||||||||||||||||||||||||||||||||||"
return "%colored rainbow({_full}, 50, 0.5)%%{_void}%"
local function slidingText(p: PLAYER, t: STRING, s: STRING):
set {_length} to length of {_t}
set {_displayLength} to 15
loop {_length} times:
(loop-value + {_displayLength}) is greater than {_length}:
set {_display} to subtext of {_t} from loop-value to {_length}
else:
set {_display} to subtext of {_t} from loop-value to (loop-value + {_displayLength})
set {_coloredDisplay} to rainbow({_display}, 40, 0.6)
send title {_coloredDisplay} with subtitle {_s} to {_p} for 1 seconds with fadein 0 second and fade out 1 second
wait 3 tick
send title "&f" with subtitle "&f" to {_p} for 1 seconds
local function rainbow(input: STRING, wrapAmount: NUMBER = -1, lightness: NUMBER = 0.5) :: STRING:
set {_delta} to 360 / ({_wrapAmount} if {_wrapAmount} > 0, else length of {_input})
set {_lightnessModifier} to (({_lightness}*2)-1) * 255
set {_angle} to 90
loop length of {_input} times:
set {_character} to character at loop-value in {_input}
{_character} or (character at (loop-value - 1) in {_input}) is "§":
"abcdefklmnor0123456789" contains {_character}:
set {_format} to (join {_format} and "&%{_character}%") if {_character} is not "r", else ("")
continue
loop 3 times:
set {_n::%loop-value-2%} to (0.5 * (sin(({_angle} + (loop-number-2*120-120))) + 1)) * 255 + {_lightnessModifier}
set {_output} to join {_output}, convertRGB({_n::*}), {_format} and {_character}
remove {_delta} from {_angle}
return colored {_output}
local function convertRGB(number: NUMBERS) :: STRING:
loop {_number::*}:
set {_r} to join {_r}, (character at (mod((floor(min(max(loop-value, 0), 255) / 16)), 16) + 1) in "0123456789ABCDEF") and (character at ((mod(min(max(loop-value, 0), 255), 16)) + 1) in "0123456789ABCDEF")
return colored "<##%{_r}%>"