function chat(): set {m0} to single value "tag" get of "plugins/rCode/language.yml" set {m1} to single value "permission" get of "plugins/rCode/language.yml" set {m2} to single value "code" get of "plugins/rCode/language.yml" set {m3} to single value "win" get of "plugins/rCode/language.yml" set {m4} to single value "currency-5" get of "plugins/rCode/language.yml" set {m5} to single value "currency-2" get of "plugins/rCode/language.yml" set {m6} to single value "currency-1" get of "plugins/rCode/language.yml" set {m7} to single value "help-1" get of "plugins/rCode/language.yml" set {m8} to single value "help-2" get of "plugins/rCode/language.yml" set {m9} to single value "help-3" get of "plugins/rCode/language.yml" set {m10} to single value "help-4" get of "plugins/rCode/language.yml" set {m11} to single value "status-1" get of "plugins/rCode/language.yml" set {m12} to single value "status-1-already" get of "plugins/rCode/language.yml" set {m13} to single value "status-2" get of "plugins/rCode/language.yml" set {m14} to single value "status-2-already" get of "plugins/rCode/language.yml" set {m15} to single value "account" get of "plugins/rCode/language.yml" set {m16} to single value "clean-used" get of "plugins/rCode/language.yml" set {m17} to single value "reload" get of "plugins/rCode/language.yml" set {m18} to single value "help-5" get of "plugins/rCode/language.yml" function load(): set {s0} to single value "code-length" get of "plugins/rCode/settings.yml" set {s1} to single value "time" get of "plugins/rCode/settings.yml" set {s2} to single value "min-reward" get of "plugins/rCode/settings.yml" set {s3} to single value "max-reward" get of "plugins/rCode/settings.yml" set {s4} to single value "updater-messages" get of "plugins/rCode/settings.yml" set {s5} to single value "clean-used" get of "plugins/rCode/settings.yml" set {s6} to single value "version" get of "plugins/rCode/settings.yml" set {s7} to single value "only-integers" get of "plugins/rCode/settings.yml" set {s8} to single value "admin-permission" get of "plugins/rCode/settings.yml" variables: {status} = true {code} = "" {code.status} = false {time} = 0 {varTime} = 0 {logging} = false on join: if {money::%player%} is not set: set {money::%player%} to 0 on script load: set {logging} to false send "[rCode] Loading rCode (%{s6}%)" to console if folder "plugins/rCode" doesn't exists: create folder "plugins/rCode" if file "plugins/rCode/settings.yml" doesn't exists: create file "plugins/rCode/settings.yml" set "code-length" to "8" in "plugins/rCode/settings.yml" set "time" to "5" in "plugins/rCode/settings.yml" set "min-reward" to "1" in "plugins/rCode/settings.yml" set "max-reward" to "500" in "plugins/rCode/settings.yml" set "updater-messages" to "true" in "plugins/rCode/settings.yml" set "clean-used" to "true" in "plugins/rCode/settings.yml" set "only-integers" to "false" in "plugins/rCode/settings.yml" set "admin-permission" to "rcode.admin" in "plugins/rCode/settings.yml" set "version" to "dev6" in "plugins/rCode/settings.yml" if file "plugins/rCode/language.yml" doesn't exists: create file "plugins/rCode/language.yml" set "tag" to "&7[&6rCode&7]" in yaml file "plugins/rCode/language.yml" set "permission" to "[ARG0] &cNie masz dostępu do tej komendy." in yaml file "plugins/rCode/language.yml" set "code" to "[ARG0] &fPrzepisz następujący kod, aby wygrać nagrodę: &a[ARG1]&f." in yaml file "plugins/rCode/language.yml" set "win" to "[ARG0] &fGracz &a[ARG1] &fprzepisał kod jako pierwszy i wygrał &e[ARG2] [ARG3]&f." in yaml file "plugins/rCode/language.yml" set "currency-5" to "dolarów" in yaml file "plugins/rCode/language.yml" set "currency-2" to "dolary" in yaml file "plugins/rCode/language.yml" set "currency-1" to "dolara" in yaml file "plugins/rCode/language.yml" set "help-1" to "[ARG0] &fPomoc &8(&e[ARG1]&8)&f:" in yaml file "plugins/rCode/language.yml" set "help-2" to "&e/rcode send &f- wysyła losowy kod na czat." in yaml file "plugins/rCode/language.yml" set "help-3" to "&e/rcode updater &f- sprawdza, czy skrypt jest aktualny." in yaml file "plugins/rCode/language.yml" set "help-4" to "&e/rcode enable/disable &f- włącza lub wyłącza wysyłanie kodu na czat." in yaml file "plugins/rCode/language.yml" set "help-5" to "&e/rcode reload &f- przeładowywuje konfigurację i pliki językowe." in yaml file "plugins/rCode/language.yml" set "status-1" to "&erCode&f został &awłączony&f." in yaml file "plugins/rCode/language.yml" set "status-2" to "&erCode&f został &cwyłączony&f." in yaml file "plugins/rCode/language.yml" set "status-1-already" to "&erCode &fjest już &awłączony&f." in yaml file "plugins/rCode/language.yml" set "status-2-already" to "&erCode &fjest już &cwyłączony&f." in yaml file "plugins/rCode/language.yml" set "account" to "[ARG0] &fTwój stan konta wynosi &e[ARG1] [ARG2]&f." in yaml file "plugins/rCode/language.yml" set "clean-used" to "[ARG0] &fTen kod został już wykorzystany." in yaml file "plugins/rCode/language.yml" set "reload" to "[ARG0] &fKonfiguracja i pliki językowe zostały przeładowane." in yaml file "plugins/rCode/language.yml" if file "plugins/rCode/stats.yml" doesn't exists: create file "plugins/rCode/stats.yml" set "sent" to "0" in yaml file "plugins/rCode/stats.yml" set "used" to "0" in yaml file "plugins/rCode/stats.yml" set "unused" to "0" in yaml file "plugins/rCode/stats.yml" set "all-prizes" to "0" in yaml file "plugins/rCode/stats.yml" send "[rCode] Enabling rCode (%{s6}%)" to console chat() load() if {status} is not set: set {status} to true wait 10 tick else: set {time} to "%{s1}%" parsed as number #to ma na celu spowodowanie tego, aby czat się nie bugował przez pierwszą minutę# loop 20 times: set {x} to 0 or 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9 or "a" or "A" or "b" or "B" or "c" or "C" or "d" or "D" or "e" or "E" or "f" or "F" or "g" or "G" or "h" or "H" or "k" or "K" or "l" or "L" or "m" or "M" or "n" or "N" or "o" or "O" or "p" or "P" or "q" or "Q" or "r" or "R" or "s" or "S" or "t" or "T" or "u" or "U" or "v" or "V" or "w" or "W" or "x" or "X" or "y" or "Y" or "z" or "Z" set {_code} to "%{_code}%%{x}%" set {code} to "%{_code}%" if {s4} is "true": send "[rCode] Starting updater thread" to console set {_yourVersion} to "%{s6}%" set {_getVersion} to "dev6" if {_yourVersion} is {_getVersion}: send "[rCode] You're currently running the latest stable version of rCode." to console else: set {_url} to result of connect to "nie ma i nie bedzie" send "[rCode] A new version of rCode is now avaiable (%{_url}%)." to console else: stop command /rcode []: executable by: players trigger: if player has permission "%{s8}%": if arg 1 is not set: set {_replaceText} to "%{m7}%" replace all "[ARG0]" with "%{m0}%" in {_replaceText} replace all "[ARG1]" with "%{s6}%" in {_replaceText} send "%{_replaceText}%" to player send "%{m8}%" to player send "%{m9}%" to player send "%{m18}%" to player send "%{m10}%" to player else if arg 1 is "updater": send "%{m0}% &fStarting updater thread" to player set {_yourVersion} to "%{s6}%" set {_getVersion} to "dev6" if {_yourVersion} is {_getVersion}: send "%{m0}% &fYou're currently running the latest stable version of rCode." to player else: set {_url} to result of connect to "nie ma i nie bedzie" send "%{m0}% &fA new version of rCode is now avaiable &8(&e%{_url}%&8)&f." to player else if arg 1 is "enable": if {status} is true: send "%{m0}% %{m12}%" to player else: send "%{m0}% %{m11}%" to player set {status} to true stop else if arg 1 is "disable": if {status} is false: send "%{m0}% %{m14}%" to player else: send "%{m0}% %{m13}%" to player set {status} to false stop else if arg 1 is "send": set {_loop} to "%{s0}%" parsed as number set {_code} to "" loop {_loop} times: set {x} to 0 or 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9 or "a" or "A" or "b" or "B" or "c" or "C" or "d" or "D" or "e" or "E" or "f" or "F" or "g" or "G" or "h" or "H" or "k" or "K" or "l" or "L" or "m" or "M" or "n" or "N" or "o" or "O" or "p" or "P" or "q" or "Q" or "r" or "R" or "s" or "S" or "t" or "T" or "u" or "U" or "v" or "V" or "w" or "W" or "x" or "X" or "y" or "Y" or "z" or "Z" set {_code} to "%{_code}%%{x}%" if {code.status} is true: set {_unu} to single value "unused" get of "plugins/rCode/stats.yml" set {_unufix} to "%{_unu}%" parsed as number add 1 to {_unufix} set "unused" to "%{_unufix}%" in yaml file "plugins/rCode/stats.yml" else if {code.status} is false: set {_use} to single value "used" get of "plugins/rCode/stats.yml" set {_usefix} to "%{_use}%" parsed as number add 1 to {_usefix} set "used" to "%{_usefix}%" in yaml file "plugins/rCode/stats.yml" set {code} to "%{_code}%" set {_m} to "%{m2}%" replace all "[ARG0]" with "%{m0}%" in {_m} replace all "[ARG1]" with "%{code}%" in {_m} broadcast "%{_m}%" set {code.status} to true set {_sent} to single value "sent" get of "plugins/rCode/stats.yml" set {_sentfix} to "%{_sent}%" parsed as number add 1 to {_sentfix} set "sent" to "%{_sentfix}%" in yaml file "plugins/rCode/stats.yml" set {logging} to true else if arg 1 is "reload": load() chat() set {_repText} to "%{m17}%" replace all "[ARG0]" with "%{m0}%" in {_repText} send "%{_repText}%" to player else: set {_replaceText} to "%{m7}%" replace all "[ARG0]" with "%{m0}%" in {_replaceText} replace all "[ARG1]" with "%{s6}%" in {_replaceText} send "%{_replaceText}%" to player send "%{m8}%" to player send "%{m9}%" to player send "%{m18}%" to player send "%{m10}%" to player else: set {_m} to "%{m1}%" replace all "[ARG0]" with "%{m0}%" in {_m} send "%{_m}%" to player on chat: if message contains "%{code}%": set {_5} to "%{s5}%" parsed as boolean if {code.status} is true: set {_min} to "%{s2}%" parsed as number set {_max} to "%{s3}%" parsed as number set {_integer} to "%{s7}%" parsed as boolean if {_integer} is true: set {_cur} to random integer between {_min} and {_max} else if {_integer} is false: set {_cur} to random number between {_min} and {_max} set {_m} to "%{m3}%" set {_p} to "%player%" parsed as offlineplayer replace all "[ARG0]" with "%{m0}%" in {_m} replace all "[ARG1]" with "%{_p}%" in {_m} replace all "[ARG2]" with "%{_cur}%" in {_m} if {_cur} is bigger or equal to 1: if {_cur} is smaller than 2: replace all "[ARG3]" with "%{m6}%" in {_m} if {_cur} is bigger or equal to 2: if {_cur} is smaller than 5: replace all "[ARG3]" with "%{m5}%" in {_m} if {_cur} is bigger or equal to 5: replace all "[ARG3]" with "%{m4}%" in {_m} if {_cur} is bigger or equal to 0: if {_cur} is smaller than 1: replace all "[ARG2]" with "%{m4}%" in {_m} broadcast "%{_m}%" add {_cur} to {money::%player%} set {_mon} to single value "all-prizes" get of "plugins/rCode/stats.yml" set {_monfix} to "%{_mon}%" parsed as number add {_cur} to {_monfix} set "all-prizes" to "%{_monfix}%" in yaml file "plugins/rCode/stats.yml" set {code.status} to false else if {code.status} is false: if {_5} is true: set {_m} to "%{m16}%" replace all "[ARG0]" with "%{m0}%" in {_m} send "%{_m}%" to player cancel event else if {_5} is false: stop every 1 minute: add 1 to {varTime} if {varTime} is {time}: if {logging} is true: if {code.status} is true: set {_unu} to single value "unused" get of "plugins/rCode/stats.yml" set {_unufix} to "%{_unu}%" parsed as number add 1 to {_unufix} set "unused" to "%{_unufix}%" in yaml file "plugins/rCode/stats.yml" else if {code.status} is false: set {_use} to single value "used" get of "plugins/rCode/stats.yml" set {_usefix} to "%{_use}%" parsed as number add 1 to {_usefix} set "used" to "%{_usefix}%" in yaml file "plugins/rCode/stats.yml" set {varTime} to 0 if {status} is true: set {_loop} to "%{s0}%" parsed as number set {_code} to "" loop {_loop} times: set {x} to 0 or 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9 or "a" or "A" or "b" or "B" or "c" or "C" or "d" or "D" or "e" or "E" or "f" or "F" or "g" or "G" or "h" or "H" or "k" or "K" or "l" or "L" or "m" or "M" or "n" or "N" or "o" or "O" or "p" or "P" or "q" or "Q" or "r" or "R" or "s" or "S" or "t" or "T" or "u" or "U" or "v" or "V" or "w" or "W" or "x" or "X" or "y" or "Y" or "z" or "Z" set {_code} to "%{_code}%%{x}%" set {code} to "%{_code}%" set {_m} to "%{m2}%" replace all "[ARG0]" with "%{m0}%" in {_m} replace all "[ARG1]" with "%{code}%" in {_m} broadcast "%{_m}%" set {code.status} to true set {_sent} to single value "sent" get of "plugins/rCode/stats.yml" set {_sentfix} to "%{_sent}%" parsed as number add 1 to {_sentfix} set "sent" to "%{_sentfix}%" in yaml file "plugins/rCode/stats.yml" set {logging} to true else: stop #Ta część skryptu będzie wykorzystana w jednej z dwóch następnych aktualizacji rCode# command /konto: trigger: set {_m} to "%{m15}%" replace all "[ARG0]" with "%{m0}%" in {_m} replace all "[ARG1]" with "%{money::%player%}%" in {_m} if {money::%player%} is 1: replace all "[ARG2]" with "%{m6}%" in {_m} if {money::%player%} is 2 or 3 or 4: replace all "[ARG2]" with "%{m5}%" in {_m} if {money::%player%} is bigger or equal to 5: replace all "[ARG2]" with "%{m4}%" in {_m} if {money::%player%} is 0: replace all "[ARG2]" with "%{m4}%" in {_m} send "%{_m}%" to player