#-###############################-# # # # HeliosChat # # (old) # #-###############################-# options: #config chat-cooldown: 5 seconds chat-color-after-ping: white ping-color: light blue automessage-delay: 90 seconds use-prefix-in-automessage: true use-time-translate-function: true ad-command-on-name-click: /ban %{_p}% #messages prefix: &8[&cHeliosChat&8] admin-chat-prefix: &8[&cAdminChat&8]&7 broadcast-prefix: &8[&2Ogłoszenie&8] no-permission: &cNie masz dostępu do tej komendy! self-clearchat-message: &7Wyczyściłeś swój czat! global-clearchat-message: &7Czat został wyczyszczony przez %{_p}% chat-toggle-on: &aCzat został włączony! chat-toggle-off: &cCzat został wyłączony! automessage-toggle-on: &aAutomessage został włączony! automessage-toggle-off: &cAutomessage został wyłączony! automessage-message-added: &aPomyślnie dodałeś wiadomość automessage-list: &eAutomatyczne wiadomości automessage-message-incorrect: &cNiepoprawna wiadomość! automessage-message-number-incorrect: &cNiepoprawny numer wiadomości! automessage-is-enabled: &eAutomessage jest &aWłączone automessage-is-disabled: &eAutomessage jest &cWyłączone automessage-message-removed: &aUsunąłeś wiadomość chat-off-message: &cCzat jest teraz wyłączony! blocked-words-blocked: &aPomyślnie zablokowałeś słowo: %{_word}% blocked-words-unblocked: &aPomyślnie odblokowałeś słowo: %{_word}% blocked-words-message: &cUżyłeś słowo, które jest zablokowane! blocked-words-list: &e&lLista zablokowanych słów blocked-words-is-blocked: &cTo słowo jest już zablokowane! blocked-words-is-unblocked: &cTo słowo nie jest zablokowane! cooldown-message: &cNastępną wiadomość możesz napisać za %{_c}% correct-usage: &cPoprawne użycie ping-title: &cOznaczenie ping-subtitle: &7Zostałeś oznaczony przez &b%{_p}%! ad-notification-prefix: &8[&eAntyReklama&8]&c ad-hidden-message: &8[&bNajedź żeby zobaczyć tekst&8] function clearChat(p: player, global: boolean): if {_global} is true: loop 100 times: send " " to all players send "{@prefix} {@global-clearchat-message}" to all players else: loop 100 times: send " " to {_p} send "{@prefix} {@self-clearchat-message}" to {_p} #Tłumaczenie czasu by xAxee function timeTranslate(r: time span) :: string: if {@use-time-translate-function} is true: set {_r} to "%{_r}%" set {_en::*} to ("years", "year", "months", "month", "days", "day", "hours" , "hour", "minutes" , "minute", "seconds", "second" and "and") set {_pl::*} to ("lata", "rok", "miesiecy", "miesiac", "dni", "dzien", "godzin", "godzina", "minut", "minuta", "sekund", "sekunda" and "i") loop {_en::*}: replace all loop-value with {_pl::%loop-index%} in {_r} return {_r} return {_r} command /chat [] [] []: aliases: c, czat permission: helioschat.chat permission message: {@no-permission} trigger: if arg-1 is "clear" or "wyczysc": clearChat(player, true) stop if arg-1 is "toggle": if {chat-disabled} is true: clear {chat-disabled} send "{@prefix} {@chat-toggle-on}" stop set {chat-disabled} to true send "{@prefix} {@chat-toggle-off}" stop if arg-1 is "blockedwords": if arg-2 is "list": send "{@blocked-words-list}" loop {blockedwords::*}: if {blockedwords::%loop-index%} is set: send formatted "&8%loop-value%" stop if arg-2 is "add": if arg-3 is set: if {blockedwords::*} doesn't contain arg-3: add arg-3 to {blockedwords::*} set {_word} to arg-3 send "{@prefix} {@blocked-words-blocked}" stop send "{@prefix} {@blocked-words-is-blocked}" stop send "{@correct-usage}: /chat blockedwords add " stop if arg-2 is "remove": if arg-3 is set: if {blockedwords::*} contains arg-3: remove arg-3 from {blockedwords::*} set {_word} to arg-3 send "{@prefix} {@blocked-words-unblocked}" stop send "{@prefix} {@blocked-words-is-unblocked}" stop send "{@correct-usage}: /chat blockedwords remove " stop send "{@correct-usage}: /chat blockedwords " stop if arg-1 is "automessage": if arg-2 is "add": if arg-3 is set: add colored arg-3 to {automessage::*} send "{@prefix} {@automessage-message-added}" stop send "{@correct-usage}: /chat automessage add " stop if arg-2 is "remove": if arg-3 is integer: if {automessage::%arg-3%} is set: set {_arg-3} to arg-3 parsed as number set {_arg-3-1} to {_arg-3}+1 delete {automessage::%{_arg-3}%} set {automessage::%{_arg-3}%} to {automessage::%{_arg-3-1}%} delete {automessage::%{_arg-3-1}%} send "{@automessage-message-removed}" stop send "{@automessage-message-number-incorrect}" stop loop {automessage::*}: if uncolored loop-value is uncolored arg-3: remove loop-value from {automessage::*} send "{@automessage-message-removed}" stop send "{@automessage-message-incorrect}" stop if arg-2 is "list": send "{@automessage-list}" loop {automessage::*}: send formatted "&8%loop-index%. %loop-value%" if {automessage-disabled} is true: send "{@automessage-is-disabled}" stop send "{@automessage-is-enabled}" stop if arg-2 is "toggle": if {automessage-disabled} is true: clear {automessage-disabled} send "{@prefix} {@automessage-toggle-on}" stop set {automessage-disabled} to true send "{@prefix} {@automessage-toggle-off}" stop send "{@correct-usage}: /chat automessage " stop send "{@correct-usage}: /chat " command /cc []: trigger: if player has permission "helioschat.clear": clearChat(player, true) else: clearChat(player, false) on chat: set {_p} to player set message to message in lowercase if {chat-disabled} is true: if player don't have permission "helioschat.bypass.disabled": cancel event send "{@prefix} {@chat-off-message}" stop if difference between {cdchat::%player%} and now is less than {@chat-cooldown}: if player don't have permission "helioschat.bypass.cooldown": cancel event set {_c} to {@chat-cooldown} remove (difference between {cdchat::%player%} and now) from {_c} set {_c} to timeTranslate({_c}) send "{@prefix} {@cooldown-message}" stop set {cdchat::%player%} to now if player don't have permission "helioschat.bypass.blockedwords": set {_s} to message replace all " " with "" in {_s} loop {blockedwords::*}: if {_s} contains loop-value: cancel event send "{@prefix} {@blocked-words-message}" stop set {_msg::*} to message split at "" loop (size of {_msg::*}) times: if {_msg::%loop-number%} is {_msg::%loop-number +1%}: if {_msg::%loop-number%} is {_msg::%loop-number +2%}: if player don't have permission "helioschat.bypass.flood": cancel event stop if message contains ".pl" or " pl " or ".com" or " com " or ".eu" or " eu ": if player don't have permission "helioschat.bypass.ad": cancel event set {_p} to player's name send formatted "{@ad-notification-prefix}", "&cNick: &8%player%" and "&8[&bNajedź żeby zobaczyć tekst&8]" to all players where [player input has permission "helioschat.ad.notification"] if message contains "@": if player has permission "helioschat.ping.players": loop all players: message contains "@%loop-player%" replace all "@%loop-player%" with "<{@ping-color}>@%loop-player%<{@chat-color-after-ping}>" in message send title "{@ping-title}" with subtitle "{@ping-subtitle}" to loop-player if message contains "@everyone": if player has permission "helioschat.ping.everyone": replace all "@everyone" with "<{@ping-color}>@everyone<{@chat-color-after-ping}>" in message send title "{@ping-title}" with subtitle "{@ping-subtitle}" to all players command /adminchat : permission: helioschat.adminchat permission message: {@no-permission} aliases: /ac, /adminczat usage: {@correct-usage}: /adminchat trigger: send "{@admin-chat-prefix} %player% &b» &7%colored arg-1%" to all players where [player input has permission "helioschat.adminchat.see"] command /bc : permission: helioschat.broadcast permission message: {@no-permission} aliases: /broadcast, /bcast usage: {@correct-usage}: /bc trigger: if arg-2 is set: if arg-1 is "chat" or "czat": send "{@broadcast-prefix} &c» &7%colored arg-2%" to all players if arg-1 is "title": send title "{@broadcast-prefix}" with subtitle "&7%colored arg-2%" to all players for 10 second if arg-1 is "actionbar": send action bar "{@broadcast-prefix} &c» &7%colored arg-2%" to all players if arg-1 is "all": send "{@broadcast-prefix} &c» &7%colored arg-2%" to all players send title "{@broadcast-prefix}" with subtitle "&7%colored arg-2%" to all players for 10 second send action bar "{@broadcast-prefix} &c» &7%colored arg-2%" to all players on script load: while script script is loaded: loop {automessage::*}: {automessage-disabled} is not set if {@use-prefix-in-automessage} is true: send "{@prefix} %loop-value%" to all players else: send loop-value to all players wait {@automessage-delay} wait 10 seconds command /chatremove [] []: permission: helioschat.hiddencommand trigger: if arg-1 is "blockedwords" or "automessage": execute player command "c %arg-1% remove %arg-2%" execute player command "c blockedwords list"