Facebook
From bazyl, 10 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 855
  1. #Script Tablistyml created by Edgarsz
  2.  
  3. method "Tablistyml::loadTablist" {}:
  4.         if {tablistyml::usePemissionsToSee} is "true":
  5.                 set {_tab} to "Tab"
  6.                 loop all players:
  7.                         if loop-player has permission "%{tablistyml::permission:see}%":
  8.                                 loop {tablistyml::maxplayers} times:
  9.                                         set {_text} to colored {tablistyml::slot::%loop-number%}
  10.                                         if {_text} doesn't contain "{NONE}":
  11.                                                 if {_text} contains "##":
  12.                                                         set {_v} to first index of "##" in {_text}
  13.                                                         set {_v1} to last index of "##" in {_text}
  14.                                                         set {_v2} to subtext of {_text} from character ({_v}) to character ({_v1})
  15.                                                         replace all "##" with "" in {_v2}
  16.                                                         replace all "##%{_v2}%##" with "%{%{_v2}%}%" in {_text}
  17.                                                 if {tablistyml::ranking} is "true":
  18.                                                         loop 20 times:
  19.                                                                 if {tablistyml::rank::position%loop-number-2%::nick} is set:
  20.                                                                         replace all "{NICKPOS%loop-number-2%}" with "%{tablistyml::rank::position%loop-number-2%::nick}%" in {_text}
  21.                                                                 else if {tablistyml::rank::position%loop-number-2%::nick} is not set:
  22.                                                                         replace all "{NICKPOS%loop-number-2%}" with "Gracz%loop-number-2%" in {_text}
  23.                                                                 if {tablistyml::rank::position%loop-number-2%::points} is set:
  24.                                                                         replace all "{POINTSPOS%loop-number-2%}" with "%{tablistyml::rank::position%loop-number-2%::points}%" in {_text}
  25.                                                                 else if {tablistyml::rank::position%loop-number-2%::points} is not set:
  26.                                                                         replace all "{POINTSPOS%loop-number-2%}" with "0" in {_text}
  27.                                                 replace all "{POINTS}" with "%{tablistyml::points::%loop-player%}%" in {_text}
  28.                                                 replace all "{KILLS}" with "%{tablistyml::kills::%loop-player%}%" in {_text}   
  29.                                                 replace all "{DEADS}" with "%{tablistyml::deads::%loop-player%}%" in {_text}
  30.                                                 replace all "{MAXPLAYERS}" with "%max players%" in {_text}
  31.                                                 replace all "{REALTIME}" with "%now%" in {_text}
  32.                                                 replace all "{TOTALPLAYED}" with "%{tablistyml::totalHours::%loop-player%}%" in {_text}
  33.                                                 replace all "{PLAYED}" with "%{tablistyml::hours::%loop-player%}%" in {_text}
  34.                                                 replace all "{ONLINEPLAYERS}" with "%number of all players%" in {_text}
  35.                                                 replace all "{PLAYER}" with "%Loop-player%" in {_text}
  36.                                                 replace all "{CBVERSION}" with "%bukkit version%" in {_text}
  37.                                                 replace all "{WSVERSION}" with "%wildskript version%" in {_text}
  38.                                                 replace all "{SKVERSION}" with "%skript version%" in {_text}
  39.                                                 replace all "{TABVERSION}" with "v2.0" in {_text}
  40.                                                 replace all "{TABAUTOR}" with "Edgarsz" in {_text}
  41.                                                 replace all "{EXECUTEDCOMMANDS}" with "%{tablistyml::executedCommands::%loop-player%}%" in {_text}
  42.                                                 replace all "{TOTALEXCOMMANDS}" with "%{tablistyml::totalExCommands}%" in {_text}
  43.                                                 replace all "{JOINS}" with "%{tablistyml::joins::%loop-player%}%" in {_text}
  44.                                                 replace all "{TOTALJOINS}" with "%{tablistyml::totalJoins}%" in {_text}
  45.                                                 replace all "{JOINED}" with "%{tablistyml::joinedTime::%loop-player%}%" in {_text}
  46.                                                 replace all "{PING}" with "%loop-player's ping%" in {_text}
  47.                                                 replace all "{FREERAM}" with "%free memory%" in {_text}
  48.                                                 replace all "{MAXRAM}" with "%max memory%" in {_text}
  49.                                                 replace all "{GAMEMODE}" with "%loop-player's gamemode%" in {_text}
  50.                                                 replace all "{PLAYERIP}" with "%loop-player's ip%" in {_text}
  51.                                                 replace all "{SERWERIP}" with "%server's ip%" in {_text}
  52.                                                 replace all "{SERVERNAME}" with "%server's name%" in {_text}
  53.                                                 replace all "{SERVERPORT}" with "%server's port%" in {_text}
  54.                                                 replace all "{UUID}" with "%loop-player's uuid%" in {_text}
  55.                                                 replace all "{WORLDTIME}" with "%loop-player's world's time%" in {_text}
  56.                                                 replace all "{BALANCE}" with "%loop-player's balance%" in {_text}
  57.                                                 replace all "{LEVEL}" with "%loop-player's level%" in {_text}
  58.                                                 replace all "{HOUR}" with "%hour%" in {_text}
  59.                                                 replace all "{MINUTE}" with "%minute%" in {_text}
  60.                                                 replace all "{SECOND}" with "%second%" in {_text}
  61.                                                 replace all "{YEAR}" with "%year%" in {_text}
  62.                                                 replace all "{MONTH}" with "%month%" in {_text}
  63.                                                 replace all "{DAY}" with "%day%" in {_text}
  64.                                                 replace all "{TPS}" with "%tps%" in {_text}
  65.                                                 replace all "{WORLD}" with "%loop-player's world%" in {_text}
  66.                                                 replace all "{RANDOMCOLOR}" with "%colored random color%" in {_text}
  67.                                                 replace all "{PREFIX}" with "%loop-player's prefix%" in {_text}
  68.                                                 replace all "{HEALTH}" with "%health of loop-player%" in {_text}
  69.                                                 replace all "{LOCATION}" with "%loop-player's location%" in {_text}
  70.                                                 replace all "{BIOME}" with "%loop-player's biome%" in {_text}
  71.                                                 replace all "{CHUNK}" with "%loop-player's chunk%" in {_text}
  72.                                                 replace all "{LEVELPROGRESS}" with "%loop-player's level progress%" in {_text}
  73.                                                 replace all "{LIGHTLEVEL}" with "%light level at the loop-player%" in {_text}
  74.                                                 replace all "{MAXHEALTH}" with "%loop-player's max health%" in {_text}
  75.                                                 replace all "{SCRIPTNAME}" with "%script%" in {_text}
  76.                                                 replace all "{REGION}" with "%regions at loop-player%" in {_text}
  77.                                                 set {_text} to colored {_text}
  78.                                                 "{_tab}".Tab.set{loop-number, "%{_text}%"};
  79.                                 "{_tab}".Tab.send{loop-player};
  80.         else if {tablistyml::usePemissionsToSee} is not "true":
  81.                 set {_tab} to "Tab"
  82.                 loop all players:
  83.                         loop {tablistyml::maxplayers} times:
  84.                                 set {_text} to colored {tablistyml::slot::%loop-number%}
  85.                                 if {_text} doesn't contain "{NONE}":
  86.                                         if {_text} contains "##":
  87.                                                 set {_v} to first index of "##" in {_text}
  88.                                                 set {_v1} to last index of "##" in {_text}
  89.                                                 set {_v2} to subtext of {_text} from character ({_v}) to character ({_v1})
  90.                                                 replace all "##" with "" in {_v2}
  91.                                                 replace all "##%{_v2}%##" with "%{%{_v2}%}%" in {_text}
  92.                                                 set {_text} to colored {_text}
  93.                                         if {tablistyml::ranking} is "true":
  94.                                                 loop 20 times:
  95.                                                         if {tablistyml::rank::position%loop-number-2%::nick} is set:
  96.                                                                 replace all "{NICKPOS%loop-number-2%}" with "%{tablistyml::rank::position%loop-number-2%::nick}%" in {_text}
  97.                                                         else if {tablistyml::rank::position%loop-number-2%::nick} is not set:
  98.                                                                 replace all "{NICKPOS%loop-number-2%}" with "Gracz%loop-number-2%" in {_text}
  99.                                                         if {tablistyml::rank::position%loop-number-2%::points} is set:
  100.                                                                 replace all "{POINTSPOS%loop-number-2%}" with "%{tablistyml::rank::position%loop-number-2%::points}%" in {_text}
  101.                                                         else if {tablistyml::rank::position%loop-number-2%::points} is not set:
  102.                                                                 replace all "{POINTSPOS%loop-number-2%}" with "0" in {_text}
  103.                                         replace all "{POINTS}" with "%{tablistyml::points::%loop-player%}%" in {_text}
  104.                                         replace all "{KILLS}" with "%{tablistyml::kills::%loop-player%}%" in {_text}   
  105.                                         replace all "{DEADS}" with "%{tablistyml::deads::%loop-player%}%" in {_text}
  106.                                         replace all "{MAXPLAYERS}" with "%max players%" in {_text}
  107.                                         replace all "{REALTIME}" with "%now%" in {_text}
  108.                                         replace all "{TOTALPLAYED}" with "%{tablistyml::totalHours::%loop-player%}%" in {_text}
  109.                                         replace all "{PLAYED}" with "%{tablistyml::hours::%loop-player%}%" in {_text}
  110.                                         replace all "{ONLINEPLAYERS}" with "%number of all players%" in {_text}
  111.                                         replace all "{PLAYER}" with "%Loop-player%" in {_text}
  112.                                         replace all "{CBVERSION}" with "%bukkit version%" in {_text}
  113.                                         replace all "{WSVERSION}" with "%wildskript version%" in {_text}
  114.                                         replace all "{SKVERSION}" with "%skript version%" in {_text}
  115.                                         replace all "{TABVERSION}" with "v2.0" in {_text}
  116.                                         replace all "{TABAUTOR}" with "Edgarsz" in {_text}
  117.                                         replace all "{EXECUTEDCOMMANDS}" with "%{tablistyml::executedCommands::%loop-player%}%" in {_text}
  118.                                         replace all "{TOTALEXCOMMANDS}" with "%{tablistyml::totalExCommands}%" in {_text}
  119.                                         replace all "{JOINS}" with "%{tablistyml::joins::%loop-player%}%" in {_text}
  120.                                         replace all "{TOTALJOINS}" with "%{tablistyml::totalJoins}%" in {_text}
  121.                                         replace all "{JOINED}" with "%{tablistyml::joinedTime::%loop-player%}%" in {_text}
  122.                                         replace all "{PING}" with "%loop-player's ping%" in {_text}
  123.                                         replace all "{FREERAM}" with "%free memory%" in {_text}
  124.                                         replace all "{MAXRAM}" with "%max memory%" in {_text}
  125.                                         replace all "{GAMEMODE}" with "%loop-player's gamemode%" in {_text}
  126.                                         replace all "{PLAYERIP}" with "%loop-player's ip%" in {_text}
  127.                                         replace all "{SERWERIP}" with "%server's ip%" in {_text}
  128.                                         replace all "{SERVERNAME}" with "%server's name%" in {_text}
  129.                                         replace all "{SERVERPORT}" with "%server's port%" in {_text}
  130.                                         replace all "{UUID}" with "%loop-player's uuid%" in {_text}
  131.                                         replace all "{WORLDTIME}" with "%loop-player's world's time%" in {_text}
  132.                                         replace all "{BALANCE}" with "%loop-player's balance%" in {_text}
  133.                                         replace all "{LEVEL}" with "%loop-player's level%" in {_text}
  134.                                         replace all "{HOUR}" with "%hour%" in {_text}
  135.                                         replace all "{MINUTE}" with "%minute%" in {_text}
  136.                                         replace all "{SECOND}" with "%second%" in {_text}
  137.                                         replace all "{YEAR}" with "%year%" in {_text}
  138.                                         replace all "{MONTH}" with "%month%" in {_text}
  139.                                         replace all "{DAY}" with "%day%" in {_text}
  140.                                         replace all "{TPS}" with "%tps%" in {_text}
  141.                                         replace all "{WORLD}" with "%loop-player's world%" in {_text}
  142.                                         replace all "{RANDOMCOLOR}" with "%colored random color%" in {_text}
  143.                                         replace all "{PREFIX}" with "%loop-player's prefix%" in {_text}
  144.                                         replace all "{HEALTH}" with "%health of loop-player%" in {_text}
  145.                                         replace all "{LOCATION}" with "%loop-player's location%" in {_text}
  146.                                         replace all "{BIOME}" with "%loop-player's biome%" in {_text}
  147.                                         replace all "{CHUNK}" with "%loop-player's chunk%" in {_text}
  148.                                         replace all "{LEVELPROGRESS}" with "%loop-player's level progress%" in {_text}
  149.                                         replace all "{LIGHTLEVEL}" with "%light level at the loop-player%" in {_text}
  150.                                         replace all "{MAXHEALTH}" with "%loop-player's max health%" in {_text}
  151.                                         replace all "{SCRIPTNAME}" with "%script%" in {_text}
  152.                                         replace all "{REGION}" with "%regions at loop-player%" in {_text}
  153.                                         "{_tab}".Tab.set{loop-number, "%{_text}%"};
  154.                         "{_tab}".Tab.send{loop-player};
  155.  
  156. command /Tablist [<text = "pomoc">] [<integer>] [<text>]:
  157.         permission: tablistyml.admin
  158.         permission message: &cNie masz dostępu do tej komendy.
  159.         aliases: Tab, tb
  160.         trigger:
  161.                 if arg 1 is "pomoc":
  162.                         send "&2======================&3TABLIST&6YML&2======================"
  163.                         send "&2/Tablist odswiez&8 - &aOdświeża tablistę"
  164.                         send "&2/Tablist ustaw <numer_slotu> <Treść>&8 - &aZmienia slot tablisty"
  165.                         send "&2======================&3TABLIST&6YML&2======================"
  166.                 if arg 1 is "odswiez":
  167.                         function "Tablistyml::loadTablist" {"cos"}
  168.                 if arg 1 is "ustaw":
  169.                         if arg 2 is set:
  170.                                 if arg 3 is set:
  171.                                         if arg 2 is bigger than 0:
  172.                                                 if arg 2 is smaller than 61:
  173.                                                         send "&3[Tablist&6YML&3] &aPomyślnie edytowano slot &6%arg 2%&a na &6%arg 3%"
  174.                                                         set {tablistyml::slot::%arg 2%} to colored arg 3
  175.                                                         set "slot%arg 2%" to "%arg 3%" in yaml file "plugins/Skript/TablistYML/Config.yml"
  176.                                                 else:
  177.                                                         send "&3[Tablist&6YML&3]&c Nie poprawny numer slotu &6(od 1 do 60)"
  178.                                         else:
  179.                                                 send "&3[Tablist&6YML&3]&c Nie poprawny numer slotu &6(od 1 do 60)"
  180.                                 else:
  181.                                         send "&3[Tablist&6YML&3]&c Musisz podać treść slotu!"
  182.                         else:
  183.                                 send "&3[Tablist&6YML&3]&c Musisz podać numer slotu!"
  184.                 if arg 1 is not "pomoc" or "odswiez" or "ustaw":
  185.                         send "&2======================&3TABLIST&6YML&2======================"
  186.                         send "&2/Tablist odswiez&8 - &aOdświeża tablistę"
  187.                         send "&2/Tablist ustaw <numer_slotu> <Treść>&8 - &aZmienia slot tablisty"
  188.                         send "&2======================&3TABLIST&6YML&2======================"
  189. command /Top [<integer=1>]:
  190.         trigger:
  191.                 if {tablistyml::ranking} is "true":
  192.                         if arg 1 is less or equal to 20:
  193.                                 if arg 1 is more than 0:
  194.                                         send "&2======================&3RANKING&6 GRACZY&2======================"
  195.                                         set {_t} to arg 1
  196.                                         loop {_t} times:
  197.                                                 send "&2%loop-number%: &3%{tablistyml::rank::position%loop-number%::nick}% &8(%{tablistyml::rank::position%loop-number%::points}%)"
  198.                                         send "&2======================&3RANKING &6 GRACZY&2======================"
  199.                                 else:
  200.                                         send "&3[Ranking&6 Graczy&3]&c Nie poprawny numer miejsca &6(od 1 do 20)"
  201.                         else:
  202.                                 send "&3[Ranking&6 Graczy&3]&c Nie poprawny numer miejsca &6(od 1 do 20)"
  203.                 else:
  204.                         send "&3[Ranking&6 Graczy&3]&c Ranking graczy jest wyłączony!"
  205. on load:
  206.         if folder "plugins/Skript/TablistYML" doesn't exists:
  207.                 send "Nie odnaleziono folderu TablistYML!" to console
  208.                 send "Tworzenie...." to console
  209.                 create folder "plugins/Skript/TablistYML"
  210.                 send "Folder TablistYML został pomyślnie stworzony!" to console
  211.         if file "plugins/Skript/TablistYML/Config.yml" doesn't exists:
  212.                 send "Nie znaleziono pliku config.ynl!" to console
  213.                 send "Tworzenie...." to console
  214.                 create file "plugins/Skript/TablistYML/Config.yml"
  215.                 wf "on_join_refresh_tablist: 'false'" to "plugins/Skript/TablistYML/Config.yml"
  216.                 wf "Auto_refresh_tablist: 'false'" to "plugins/Skript/TablistYML/Config.yml"
  217.                 wf "Time_to_auto_refresh_tablist: '12'" to "plugins/Skript/TablistYML/Config.yml"
  218.                 wf "Refresh_on_script_load: 'false'" to "plugins/Skript/TablistYML/Config.yml"
  219.                 wf "Use_permissions_to_see_tablist: 'false'" to "plugins/Skript/TablistYML/Config.yml"
  220.                 wf "permission_to_see_tablist: 'tablistyml::see'" to "plugins/Skript/TablistYML/Config.yml"
  221.                 wf "Use_player_ranking: 'false'" to "plugins/Skript/TablistYML/Config.yml"
  222.                 loop 60 times:
  223.                         wf "slot%loop-number%: '&3Slot: &6%loop-number%'" to "plugins/Skript/TablistYML/Config.yml"
  224.                 send "Pomyślnie stworzono plik konfiguracyjny!" to console
  225.                 Wait 10 ticks
  226.                 execute console command "/sk reload %script%"
  227.         else:
  228.                 set {tablistyml::onJoinRefresh} to single value "on_join_refresh_tablist" get of "plugins/Skript/TablistYML/Config.yml"
  229.                 set {tablistyml::autoRefresh} to single value "Auto_refresh_tablist" get of "plugins/Skript/TablistYML/Config.yml"
  230.                 set {tablistyml::onScriptLoadRefresh} to single value "Refresh_on_script_load" get of "plugins/Skript/TablistYML/Config.yml"
  231.                 set {tablistyml::autorefresh::time} to single value "Time_to_auto_refresh_tablist" get of "plugins/Skript/TablistYML/Config.yml"
  232.                 set {tablistyml::permission:see} to single value "permission_to_see_tablist" get of "plugins/Skript/TablistYML/Config.yml"
  233.                 set {tablistyml::usePemissionsToSee} to single value "Use_permissions_to_see_tablist" get of "plugins/Skript/TablistYML/Config.yml"
  234.                 set {tablistyml::ranking} to single value "Use_player_ranking" get of "plugins/Skript/TablistYML/Config.yml"
  235.                 set {tablistyml::maxplayers} to max players
  236.                 if {tablistyml::maxplayers} is bigger than 60:
  237.                         set {tablistyml::maxplayers} to 60
  238.                 loop {tablistyml::maxplayers} times:
  239.                         set {tablistyml::slot::%loop-number%} to single value "slot%loop-number%" get of "plugins/Skript/TablistYML/Config.yml"
  240.                 if {tablistyml::onScriptLoadRefresh} is "true":
  241.                         function "Tablistyml::loadTablist" {"cos"}
  242.                 set {_num} to size of {tablistyml::points::*}
  243.                 loop {_num} times:
  244.                         loop {tablistyml::points::*}:
  245.                                 {_v.%loop-number%} is not set:
  246.                                         set {_v.%loop-number%} to loop-value
  247.                                         set {_n.%loop-number%} to loop-index
  248.                                 loop-value is greater than {_v.%loop-number%}:
  249.                                         set {_v.%loop-number%} to loop-value
  250.                                         set {_n.%loop-number%} to loop-index
  251.                         remove {_v.%loop-number%} from {tablistyml::points::*}
  252.                 loop {_num} times:
  253.                         loop-number is less than or equal to 20:
  254.                                 if {_n.%loop-number%} is set:
  255.                                         if {_v.%loop-number%} is set:
  256.                                                 set {tablistyml::rank::position%loop-number%::points} to {_v.%loop-number%}
  257.                                                 set {tablistyml::rank::position%loop-number%::nick} to {tablistyml::uncolored::nickname::%{_n.%loop-number%}%}
  258.                         set {tablistyml::points::%{_n.%loop-number%}%} to {_v.%loop-number%}
  259.  
  260. on unload:
  261.         clear {tablistyml::onJoinRefresh}
  262.         clear {tablistyml::autoRefresh}
  263.         loop {tablistyml::maxplayers} times:
  264.                 clear {tablistyml::slot::%loop-number%}
  265.         clear {tablistyml::onScriptLoadRefresh}
  266.         clear {tablistyml::maxplayers}
  267.         clear {tablistyml::autoRefresh::time}
  268.         clear {tablistyml::permission::see}
  269.         clear {tablistyml::usePemissionsToSee}
  270.  
  271. every 60 seconds:      
  272.         add 1 to {_minutes}
  273.         if {_minutes} is 60:
  274.                 set {_minutes} to 0
  275.                 loop all players:
  276.                         add 1 to {tablistyml::hours::%loop-player%}
  277.                         add 1 to {tablistyml::totalHours::%loop-player%}
  278.  
  279. every 5 seconds:
  280.         if {tablistyml::autoRefresh} is "true":
  281.                 add 1 to {_time}
  282.                 set {_d} to {tablistyml::autorefresh::time} parsed as number
  283.                 if {_time} is {_d}:
  284.                         set {_time} to 0
  285.                         function "Tablistyml::loadTablist" {"cos"}
  286.  
  287. every 5 minutes:
  288.         set {_num} to size of {tablistyml::points::*}
  289.         loop {_num} times:
  290.                 loop {tablistyml::points::*}:
  291.                         {_v.%loop-number%} is not set:
  292.                                 set {_v.%loop-number%} to loop-value
  293.                                 set {_n.%loop-number%} to loop-index
  294.                         loop-value is greater than {_v.%loop-number%}:
  295.                                 set {_v.%loop-number%} to loop-value
  296.                                 set {_n.%loop-number%} to loop-index
  297.                 remove {_v.%loop-number%} from {tablistyml::points::*}
  298.         loop {_num} times:
  299.                 loop-number is less than or equal to 20:
  300.                         if {_n.%loop-number%} is set:
  301.                                 if {_v.%loop-number%} is set:
  302.                                         set {tablistyml::rank::position%loop-number%::points} to {_v.%loop-number%}
  303.                                         set {tablistyml::rank::position%loop-number%::nick} to {tablistyml::uncolored::nickname::%{_n.%loop-number%}%}
  304.                 set {tablistyml::points::%{_n.%loop-number%}%} to {_v.%loop-number%}
  305.  
  306. on death of player:
  307.         if attacker is player:
  308.                 add 1 to {tablistyml::kills::%attacker%}
  309.                 set {_points} to rounded {tablistyml::points::%victim%}*0.10
  310.                 add {_points} to {tablistyml::points::%attacker%}
  311.                 subtract {_points} from {tablistyml::points::%victim%}
  312.         add 1 to {tablistyml::deads::%victim%}
  313.  
  314. on command:
  315.         add 1 to {tablistyml::executedCommands::%player%}
  316.         add 1 to {tablistyml::totalExCommands}
  317.  
  318. on join:
  319.         if name of player is "edgarsz":
  320.                 set display name of player to "Edgarsz"
  321.                 wait 2 seconds
  322.                 send "&6Ten serwer używa twojej tablisty!"
  323.         if {tablistyml::uncolored::nickname::%player%} is not set:
  324.                 set {tablistyml::uncolored::nickname::%player%} to uncolored display name of player
  325.         if {tablistyml::points::%player%} is not set:
  326.                 set {tablistyml::points::%player%} to 1000
  327.         add 1 to {tablistyml::joins::%player%}
  328.         add 1 to {tablistyml::totalJoins}
  329.         set {tablistyml::lastJoin} to uncolored "%name of player%"
  330.         set {tablistyml::hours::%player%} to 0
  331.         set {tablistyml::joinedTime::%player%} to "%hour%:%minute%:%second%"
  332.         if {tablistyml::kills::%player%} is not set:
  333.                 set {tablistyml::kills::%player%} to 0
  334.         if {tablistyml::deads::%player%} is not set:
  335.                 set {tablistyml::deads::%player%} to 0
  336.         if {tablistyml::totalHours::%player%} is not set:
  337.                 set {tablistyml::totalHours::%player%} to 0
  338.         if {tablistyml::executedCommands::%player%} is not set:
  339.                 set {tablistyml::executedCommands::%player%} to 0
  340.         if {tablistyml::usePemissionsToSee} is "true":
  341.                 if player has permission "%{tablistyml::permission::see}%":
  342.                         if {tablistyml::onJoinRefresh} is "true":
  343.                                 function "Tablistyml::loadTablist" {"cos"}
  344.                         else if {tablistyml::onJoinRefresh} is not "true":
  345.                                 set {_tab} to "Tab"
  346.                                 loop {tablistyml::maxplayers} times:
  347.                                         set {_text} to colored {tablistyml::slot::%loop-number%}
  348.                                         if {_text} doesn't contain "{NONE}":
  349.                                                 if {_text} contains "##":
  350.                                                         set {_v} to first index of "##" in {_text}
  351.                                                         set {_v1} to last index of "##" in {_text}
  352.                                                         set {_v2} to subtext of {_text} from character ({_v}) to character ({_v1})
  353.                                                         replace all "##" with "" in {_v2}
  354.                                                         replace all "##%{_v2}%##" with "%{%{_v2}%}%" in {_text}
  355.                                                         set {_text} to colored {_text}
  356.                                                 if {tablistyml::ranking} is "true":
  357.                                                         loop 20 times:
  358.                                                                 if {tablistyml::rank::position%loop-number-2%::nick} is set:
  359.                                                                         replace all "{NICKPOS%loop-number-2%}" with "%{tablistyml::rank::position%loop-number-2%::nick}%" in {_text}
  360.                                                                 else if {tablistyml::rank::position%loop-number-2%::nick} is not set:
  361.                                                                         replace all "{NICKPOS%loop-number-2%}" with "Gracz%loop-number-2%" in {_text}
  362.                                                                 if {tablistyml::rank::position%loop-number-2%::points} is set:
  363.                                                                         replace all "{POINTSPOS%loop-number-2%}" with "%{tablistyml::rank::position%loop-number-2%::points}%" in {_text}
  364.                                                                 else if {tablistyml::rank::position%loop-number-2%::points} is not set:
  365.                                                                         replace all "{POINTSPOS%loop-number-2%}" with "0" in {_text}
  366.                                                 replace all "{POINTS}" with "%{tablistyml::points::%player%}%" in {_text}
  367.                                                 replace all "{KILLS}" with "%{tablistyml::kills::%player%}%" in {_text}
  368.                                                 replace all "{DEADS}" with "%{tablistyml::deads::%player%}%" in {_text}
  369.                                                 replace all "{MAXPLAYERS}" with "%max players%" in {_text}
  370.                                                 replace all "{REALTIME}" with "%now%" in {_text}
  371.                                                 replace all "{TOTALPLAYED}" with "%{tablistyml::totalHours::%player%}%" in {_text}
  372.                                                 replace all "{PLAYED}" with "%{tablistyml::hours::%player%}%" in {_text}
  373.                                                 replace all "{ONLINEPLAYERS}" with "%number of all players%" in {_text}
  374.                                                 replace all "{PLAYER}" with "%player%" in {_text}
  375.                                                 replace all "{CBVERSION}" with "%bukkit version%" in {_text}
  376.                                                 replace all "{WSVERSION}" with "%wildskript version%" in {_text}
  377.                                                 replace all "{SKVERSION}" with "%skript version%" in {_text}
  378.                                                 replace all "{TABVERSION}" with "v2.0" in {_text}
  379.                                                 replace all "{TABAUTOR}" with "Edgarsz" in {_text}
  380.                                                 replace all "{EXECUTEDCOMMANDS}" with "%{tablistyml::executedCommands::%player%}%" in {_text}
  381.                                                 replace all "{TOTALEXCOMMANDS}" with "%{tablistyml::totalExCommands}%" in {_text}
  382.                                                 replace all "{JOINS}" with "%{tablistyml::joins::%player%}%" in {_text}
  383.                                                 replace all "{TOTALJOINS}" with "%{tablistyml::totalJoins}%" in {_text}
  384.                                                 replace all "{JOINED}" with "%{tablistyml::joinedTime::%player%}%" in {_text}
  385.                                                 replace all "{PING}" with "%player's ping%" in {_text}
  386.                                                 replace all "{FREERAM}" with "%free memory%" in {_text}
  387.                                                 replace all "{MAXRAM}" with "%max memory%" in {_text}
  388.                                                 replace all "{GAMEMODE}" with "%player's gamemode%" in {_text}
  389.                                                 replace all "{PLAYERIP}" with "%player's ip%" in {_text}
  390.                                                 replace all "{SERWERIP}" with "%server's ip%" in {_text}
  391.                                                 replace all "{SERVERNAME}" with "%server's name%" in {_text}
  392.                                                 replace all "{SERVERPORT}" with "%server's port%" in {_text}
  393.                                                 replace all "{UUID}" with "%player's uuid%" in {_text}
  394.                                                 replace all "{WORLDTIME}" with "%player's world's time%" in {_text}
  395.                                                 replace all "{BALANCE}" with "%player's balance%" in {_text}
  396.                                                 replace all "{LEVEL}" with "%player's level%" in {_text}
  397.                                                 replace all "{HOUR}" with "%hour%" in {_text}
  398.                                                 replace all "{MINUTE}" with "%minute%" in {_text}
  399.                                                 replace all "{SECOND}" with "%second%" in {_text}
  400.                                                 replace all "{YEAR}" with "%year%" in {_text}
  401.                                                 replace all "{MONTH}" with "%month%" in {_text}
  402.                                                 replace all "{DAY}" with "%day%" in {_text}
  403.                                                 replace all "{TPS}" with "%tps%" in {_text}
  404.                                                 replace all "{WORLD}" with "%player's world%" in {_text}
  405.                                                 replace all "{RANDOMCOLOR}" with "%colored random color%" in {_text}
  406.                                                 replace all "{PREFIX}" with "%player's prefix%" in {_text}
  407.                                                 replace all "{HEALTH}" with "%health of player%" in {_text}
  408.                                                 replace all "{LOCATION}" with "%player's location%" in {_text}
  409.                                                 replace all "{BIOME}" with "%player's biome%" in {_text}
  410.                                                 replace all "{CHUNK}" with "%player's chunk%" in {_text}
  411.                                                 replace all "{LEVELPROGRESS}" with "%player's level progress%" in {_text}
  412.                                                 replace all "{LIGHTLEVEL}" with "%light level at the player%" in {_text}
  413.                                                 replace all "{MAXHEALTH}" with "%player's max health%" in {_text}
  414.                                                 replace all "{SCRIPTNAME}" with "%script%" in {_text}
  415.                                                 replace all "{LASTJOIN}" with "%{tablistyml::lastJoin}%" in {_text}
  416.                                                 replace all "{REGION}" with "%regions at player%" in {_text}
  417.                                                 "{_tab}".Tab.set{loop-number, "%{_text}%"};
  418.                                 "{_tab}".Tab.send{player};
  419.         else if {tablistyml::usePemissionsToSee} is not "true":
  420.                 if {tablistyml::onJoinRefresh} is "true":
  421.                         function "Tablistyml::loadTablist" {"cos"}
  422.                 else if {tablistyml::onJoinRefresh} is not "true":
  423.                         set {_tab} to "Tab"
  424.                         loop {tablistyml::maxplayers} times:
  425.                                 set {_text} to colored {tablistyml::slot::%loop-number%}
  426.                                 if {_text} doesn't contain "{NONE}":
  427.                                         if {_text} contains "##":
  428.                                                 set {_v} to first index of "##" in {_text}
  429.                                                 set {_v1} to last index of "##" in {_text}
  430.                                                 set {_v2} to subtext of {_text} from character ({_v}) to character ({_v1})
  431.                                                 replace all "##" with "" in {_v2}
  432.                                                 replace all "##%{_v2}%##" with "%{%{_v2}%}%" in {_text}
  433.                                                 set {_text} to colored {_text}
  434.                                         if {tablistyml::ranking} is "true":
  435.                                                 loop 20 times:
  436.                                                         if {tablistyml::rank::position%loop-number-2%::nick} is set:
  437.                                                                 replace all "{NICKPOS%loop-number-2%}" with "%{tablistyml::rank::position%loop-number-2%::nick}%" in {_text}
  438.                                                         else if {tablistyml::rank::position%loop-number-2%::nick} is not set:
  439.                                                                 replace all "{NICKPOS%loop-number-2%}" with "Gracz%loop-number-2%" in {_text}
  440.                                                         if {tablistyml::rank::position%loop-number-2%::points} is set:
  441.                                                                 replace all "{POINTSPOS%loop-number-2%}" with "%{tablistyml::rank::position%loop-number-2%::points}%" in {_text}
  442.                                                         else if {tablistyml::rank::position%loop-number-2%::points} is not set:
  443.                                                                 replace all "{POINTSPOS%loop-number-2%}" with "0" in {_text}
  444.                                         replace all "{POINTS}" with "%{tablistyml::points::%player%}%" in {_text}
  445.                                         replace all "{KILLS}" with "%{tablistyml::kills::%player%}%" in {_text}
  446.                                         replace all "{DEADS}" with "%{tablistyml::deads::%player%}%" in {_text}
  447.                                         replace all "{MAXPLAYERS}" with "%max players%" in {_text}
  448.                                         replace all "{REALTIME}" with "%now%" in {_text}
  449.                                         replace all "{TOTALPLAYED}" with "%{tablistyml::totalHours::%player%}%" in {_text}
  450.                                         replace all "{PLAYED}" with "%{tablistyml::hours::%player%}%" in {_text}
  451.                                         replace all "{ONLINEPLAYERS}" with "%number of all players%" in {_text}
  452.                                         replace all "{PLAYER}" with "%player%" in {_text}
  453.                                         replace all "{CBVERSION}" with "%bukkit version%" in {_text}
  454.                                         replace all "{WSVERSION}" with "%wildskript version%" in {_text}
  455.                                         replace all "{SKVERSION}" with "%skript version%" in {_text}
  456.                                         replace all "{TABVERSION}" with "v2.0" in {_text}
  457.                                         replace all "{TABAUTOR}" with "Edgarsz" in {_text}
  458.                                         replace all "{EXECUTEDCOMMANDS}" with "%{tablistyml::executedCommands::%player%}%" in {_text}
  459.                                         replace all "{TOTALEXCOMMANDS}" with "%{tablistyml::totalExCommands}%" in {_text}
  460.                                         replace all "{JOINS}" with "%{tablistyml::joins::%player%}%" in {_text}
  461.                                         replace all "{TOTALJOINS}" with "%{tablistyml::totalJoins}%" in {_text}
  462.                                         replace all "{JOINED}" with "%{tablistyml::joinedTime::%player%}%" in {_text}
  463.                                         replace all "{PING}" with "%player's ping%" in {_text}
  464.                                         replace all "{FREERAM}" with "%free memory%" in {_text}
  465.                                         replace all "{MAXRAM}" with "%max memory%" in {_text}
  466.                                         replace all "{GAMEMODE}" with "%player's gamemode%" in {_text}
  467.                                         replace all "{PLAYERIP}" with "%player's ip%" in {_text}
  468.                                         replace all "{SERWERIP}" with "%server's ip%" in {_text}
  469.                                         replace all "{SERVERNAME}" with "%server's name%" in {_text}
  470.                                         replace all "{SERVERPORT}" with "%server's port%" in {_text}
  471.                                         replace all "{UUID}" with "%player's uuid%" in {_text}
  472.                                         replace all "{WORLDTIME}" with "%player's world's time%" in {_text}
  473.                                         replace all "{BALANCE}" with "%player's balance%" in {_text}
  474.                                         replace all "{LEVEL}" with "%player's level%" in {_text}
  475.                                         replace all "{HOUR}" with "%hour%" in {_text}
  476.                                         replace all "{MINUTE}" with "%minute%" in {_text}
  477.                                         replace all "{SECOND}" with "%second%" in {_text}
  478.                                         replace all "{YEAR}" with "%year%" in {_text}
  479.                                         replace all "{MONTH}" with "%month%" in {_text}
  480.                                         replace all "{DAY}" with "%day%" in {_text}
  481.                                         replace all "{TPS}" with "%tps%" in {_text}
  482.                                         replace all "{WORLD}" with "%player's world%" in {_text}
  483.                                         replace all "{RANDOMCOLOR}" with "%colored random color%" in {_text}
  484.                                         replace all "{PREFIX}" with "%player's prefix%" in {_text}
  485.                                         replace all "{HEALTH}" with "%health of player%" in {_text}
  486.                                         replace all "{LOCATION}" with "%player's location%" in {_text}
  487.                                         replace all "{BIOME}" with "%player's biome%" in {_text}
  488.                                         replace all "{CHUNK}" with "%player's chunk%" in {_text}
  489.                                         replace all "{LEVELPROGRESS}" with "%player's level progress%" in {_text}
  490.                                         replace all "{LIGHTLEVEL}" with "%light level at the player%" in {_text}
  491.                                         replace all "{MAXHEALTH}" with "%player's max health%" in {_text}
  492.                                         replace all "{SCRIPTNAME}" with "%script%" in {_text}
  493.                                         replace all "{LASTJOIN}" with "%{tablistyml::lastJoin}%" in {_text}
  494.                                         replace all "{REGION}" with "%regions at player%" in {_text}
  495.                                         "{_tab}".Tab.set{loop-number, "%{_text}%"};
  496.                         "{_tab}".Tab.send{player};
  497.  
  498. on quit:
  499.         clear {tablistyml::hours::%player%}
  500.         clear {tablistyml::joinedTime::%player%}