Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #---------------------------------
- #----------- TPS CHECK -----------
- #--------- PAR BLASKO ------------
- #---------------------------------
- options:
- version: 1.2.2
- on load: #Checks if the variables (server) are created
- if {lag.verif} is not set:
- set {lag.verif} to true
- if {lag.logs.player} is not set:
- set {lag.logs.player} to true
- if {lag.logs.server} is not set:
- set {lag.logs.server} to true
- on join: #Checks if varibles (players) are created, and displays a message displaying server stability
- if {lag.verif.%player%} is not set:
- set {lag.verif.%player%} to true
- if {lag.gui.%player%} is not set:
- set {lag.gui.%player%} to false
- set {_tps} to tps
- message "&8&m-----------------------------------------------------"
- if {_tps} is between 0 and 10:
- message "&7The server is : &cunstable"
- if {_tps} is between 11 and 14:
- message "&7The server is : &6little unstable"
- if {_tps} is between 15 and 18:
- message "&7The server is : &estable"
- if {_tps} is between 19 and 20:
- message "&7The server is : &afluid"
- message "&7TPS = &a%{_tps}%"
- message "&8&m-----------------------------------------------------"
- every 5 minutes: #Lance checks
- make all players execute command "/lag check"
- if {lag.verif} is true:
- set {_tps} to tps
- log "TPS = %{_tps}%"
- set {_freememory} to free memory
- set {_maxmemory} to max memory
- set {_usememory} to ({_maxmemory} - {_freememory})
- set {_maxmemory} to {_maxmemory}/1048576
- set {_freememory} to {_freememory}/1048576
- set {_usememory} to {_usememory}/1048576
- set {_maxplayer} to max players
- wait 1 tick
- log "Free memory : %{_freememory}% / %{_maxmemory}%"
- log "Players : %number of players% / %{_maxplayer}%"
- if {_tps} is between 0 and 14:
- broadcast "&4➤ &cThe server is unstable -> TPS = &r%{_tps}%"
- if {lag.logs.server} is true:
- create file "plugins/TPSCheck/TPS/year_%year%/month_%month%/day_%day%/hour_%hour%/minute_%minute%/rapport.txt"
- wf "Server Stability Report - %now%" to "plugins/TPSCheck/TPS/year_%year%/month_%month%/day_%day%/hour_%hour%/minute_%minute%/rapport.txt"
- wf "-----------------------------------------------" to "plugins/TPSCheck/TPS/year_%year%/month_%month%/day_%day%/hour_%hour%/minute_%minute%/rapport.txt"
- wf "TPS : %{_tps}%" to "plugins/TPSCheck/TPS/year_%year%/month_%month%/day_%day%/hour_%hour%/minute_%minute%/rapport.txt"
- wf "Free memory : %{_freememory}% MB" to "plugins/TPSCheck/TPS/year_%year%/month_%month%/day_%day%/hour_%hour%/minute_%minute%/rapport.txt"
- wf "Maximum memory : %{_maxmemory}% MB" to "plugins/TPSCheck/TPS/year_%year%/month_%month%/day_%day%/hour_%hour%/minute_%minute%/rapport.txt"
- wf "Memory usage : %{_usememory}% MB" to "plugins/TPSCheck/TPS/year_%year%/month_%month%/day_%day%/hour_%hour%/minute_%minute%/rapport.txt"
- wf "Number of connected players : %number of players% / %{_maxplayer}%" to "plugins/TPSCheck/TPS/year_%year%/month_%month%/day_%day%/hour_%hour%/minute_%minute%/rapport.txt"
- wf "" to "plugins/TPSCheck/TPS/year_%year%/month_%month%/day_%day%/hour_%hour%/minute_%minute%/rapport.txt"
- if {_tps} is between 0 and 10:
- wf "state : unstable" to "plugins/TPSCheck/TPS/year_%year%/month_%month%/day_%day%/hour_%hour%/minute_%minute%/rapport.txt"
- if {_tps} is between 11 and 14:
- wf "state : little unstable" to "plugins/TPSCheck/TPS/year_%year%/month_%month%/day_%day%/hour_%hour%/minute_%minute%/rapport.txt"
- if {_tps} is between 15 and 18:
- wf "state : stable" to "plugins/TPSCheck/TPS/year_%year%/month_%month%/day_%day%/hour_%hour%/minute_%minute%/rapport.txt"
- if {_tps} is between 19 and 20:
- wf "state : fluid" to "plugins/TPSCheck/TPS/year_%year%/month_%month%/day_%day%/hour_%hour%/minute_%minute%/rapport.txt"
- log "A report was create | Location : plugins/TPSCheck/TPS/year_%year%/month_%month%/day_%day%/hour_%hour%/minute_%minute%/rapport.txt"
- delete {_freememory}
- delete {_maxmemory}
- delete {_usememory}
- delete {_maxplayer}
- command /lag [<text>] [<text>] [<text>]: #the main control Skript
- aliases: ping, lag
- trigger:
- if argument 1 is "help": #Displays commands Skript
- message ""
- message "&e&m-----------------&e⬛&6 TPSCheck - Help &e&m⬛-------------------"
- message ""
- message "&a➤ &d/tpscheck &7: Lets see your ping and TPS."
- message "&a➤ &d/tpscheck option &7: Displays options."
- if player has permission "tpscheck.admin":
- message ""
- message "&c➤ &d/tpscheck admin &7: Displays settings Skript."
- message "&c➤ &d/tpscheck reload &7: Can charge the Skript."
- message ""
- message "&b➤ &7For these commands, the &c/tpscheck &7 may be replaced by &c/lag &7or &c/ping&7."
- message ""
- message "&e&m-----------------------------------------------------"
- message ""
- if argument 1 is "check": #Command used to conduct the audit every five minutes (if the player allows checks)
- if {lag.verif.%player%} is true:
- set {ping.%player%} to player's ping
- log "Ping de %player% (UUID = %uuid of player%) = %{ping.%player%}%ms"
- if {lag.logs.player} is true:
- create file "plugins/TPSCheck/Ping/year_%year%/month_%month%/day_%day%/hour_%hour%/minute_%minute%/%player%.txt"
- wf "Informations - %player% - %now%" to "plugins/TPSCheck/Ping/year_%year%/month_%month%/day_%day%/hour_%hour%/minute_%minute%/%player%.txt"
- wf "-------------------------------------------" to "plugins/TPSCheck/Ping/year_%year%/month_%month%/day_%day%/hour_%hour%/minute_%minute%/%player%.txt"
- wf "UUID = %player's UUID%" to "plugins/TPSCheck/Ping/year_%year%/month_%month%/day_%day%/hour_%hour%/minute_%minute%/%player%.txt"
- wf "Ping = %{ping.%player%}%" to "plugins/TPSCheck/Ping/year_%year%/month_%month%/day_%day%/hour_%hour%/minute_%minute%/%player%.txt"
- wf "World = %player's world%" to "plugins/TPSCheck/Ping/year_%year%/month_%month%/day_%day%/hour_%hour%/minute_%minute%/%player%.txt"
- wf "Position :" to "plugins/TPSCheck/Ping/year_%year%/month_%month%/day_%day%/hour_%hour%/minute_%minute%/%player%.txt"
- wf "X = %x-coordinate of player's location%" to "plugins/TPSCheck/Ping/year_%year%/month_%month%/day_%day%/hour_%hour%/minute_%minute%/%player%.txt"
- wf "Y = %y-coordinate of player's location%" to "plugins/TPSCheck/Ping/year_%year%/month_%month%/day_%day%/hour_%hour%/minute_%minute%/%player%.txt"
- wf "Z = %z-coordinate of player's location%" to "plugins/TPSCheck/Ping/year_%year%/month_%month%/day_%day%/hour_%hour%/minute_%minute%/%player%.txt"
- if {ping.%player%} is greater than or equal to 250:
- message "&4➤ &cYour connection is unstable -> Your ping : &r%{ping.%player%}%ms"
- message "&7[&cLag&7] &4➤ This check is performed every five minutes, you can disable it in the settings : &c/lag option"
- if argument 1 is "option" or "options": #Displays individual options editable by all players
- set {ping.%player%} to player's ping
- set {_tps} to tps
- open chest with 3 rows named "&9>> &lOptions&9 <<" to player
- wait 2 tick
- format slot 0 of player with crafting table named "&6>> &lHelp&6 <<" with lore "&7Adjust settings TPSCheck||&7from this menu." to be unstealable
- if player has permission "tpscheck.admin":
- format slot 7 of player with anvil named "&rOptions Skript" to run [make player execute command "/lag admin"]
- format slot 8 of player with name tag named "&ractualize" to run [make player execute command "/lag option"]
- if {lag.gui.%player%} is true:
- format slot 12 of player with light green clay named "&eInterface /lag..." with lore "&7State : &aActive||&r||&7If you enable the GUI option, when you||&7execute the command &c/lag&7, a GUI opens||&7to display information such as TPS, Ping, ...||&7while if the option is disabled, the command||&7&c/lag&7 display this information in chat." to run [make player execute command "/lag option gui"]
- else:
- format slot 12 of player with red clay named "&eInterface /lag..." with lore "&7State : &cInnactif||&r||&7If you enable the GUI option, when you||&7execute the command &c/lag&7, a GUI opens||&7to display information such as TPS, Ping, ...||&7while if the option is disabled, the command||&7&c/lag&7 this information in chat." to run [make player execute command "/lag option gui"]
- if {lag.verif.%player%} is true:
- format slot 14 of player with light green clay named "&eVérification..." with lore "&7State : &aActive||&r||&7If you enable this option, a verification||&7will make all &c5&7 minutes and you||&7indicate if your connection is slow." to run [make player execute command "/lag option verif"]
- else:
- format slot 14 of player with red clay named "&eVérification..." with lore "&7State : &cInnactif||&r||&7If you enable this option, a verification||&7will make all &c5&7 minutes and you||&7indicate if your connection is slow." to run [make player execute command "/lag option verif"]
- format slot 17 of player with book named "&rInformation" with lore "&7TPS : &a%{_tps}%||&7Ping : &a%{ping.%player%}%" to be unstealable
- format slot 18 of player with paper named "&eTPSCheck :" with lore "&7Created by : &aBlasko (Akion)||&7Version : &a{@version}" to be unstealable
- format slot 26 of player with arrow named "&rclose" to close
- if argument 2 is "gui":
- if {lag.gui.%player%} is false:
- set {lag.gui.%player%} to true
- message "&7[&cLag&7] &a➤ GUI &aactivated&7"
- play raw sound "random.orb" at player with pitch 1 volume 10
- make player execute command "/lag option"
- stop
- if {lag.gui.%player%} is true:
- set {lag.gui.%player%} to false
- message "&7[&cLag&7] &a➤ GUI &cdisabled&7"
- play raw sound "random.orb" at player with pitch 1 volume 10
- make player execute command "/lag option"
- stop
- if argument 2 is "verif":
- if {lag.verif.%player%} is false:
- set {lag.verif.%player%} to true
- message "&7[&cLag&7] &a➤ Verification &aactivated&7"
- play raw sound "random.orb" at player with pitch 1 volume 10
- make player execute command "/lag option"
- stop
- if {lag.verif.%player%} is true:
- set {lag.verif.%player%} to false
- message "&7[&cLag&7] &a➤ Verification &cdisabled&7"
- play raw sound "random.orb" at player with pitch 1 volume 10
- make player execute command "/lag option"
- stop
- if argument 1 is not set: #If the order is carried out without any arguments, it's the TPS and table that will appear in chat or in a GUI (according to user preferences)
- set {ping.%player%} to player's ping
- set {_tps} to tps
- if {lag.gui.%player%} is true:
- set {_maxplayer} to max players
- open chest with 3 rows named "&9>> &lLag&9 <<" to player
- wait 1 tick
- format slot 0 of player with crafting table named "&6>> &lHelp&6 <<" with lore "&r&7If you enable the GUI option, when you run||&r&7the command &c/lag&7, a GUI will open to display||&r&7information (TPS, Ping, etc...), while if the option is||&r&7disabled, the command &c/lag&7 view this information||&r&7chat." to be unstealable
- format slot 8 of player with name tag named "&ractualize" to run [make player execute command "/lag"]
- format slot 12 of player with light blue clay named "&eTPS : &a%{_tps}%" with lore "&7The TPS indicate whether the||&7server is overloaded.||&r||&r&a20 = &bperfect" to be unstealable
- format slot 13 of player with blue clay named "&ePing : &a%{ping.%player%}%" with lore "&7The table shows the time||&7response with the server." to be unstealable
- format slot 14 of player with player head named "&eNumber of Players : &a%number of players%&7/%{_maxplayer}%" to be unstealable
- format slot 17 of player with anvil named "&rOptions" to run [make player execute command "/lag option"]
- if player has permission "tpscheck.admin":
- format slot 7 of player with anvil named "&rOptions Skript" to run [make player execute command "/lag admin"]
- format slot 18 of player with paper named "&eTPSCheck :" with lore "&7Created by : &aBlasko (Akion)||&7Version : &a{@version}" to be unstealable
- format slot 26 of player with arrow named "&rClose" to close
- else:
- message "&e&m-----------------------------------------------------"
- if sender is player:
- if {ping.%player%} is between 0 and 199:
- message "&6Your ping : &a%{ping.%player%}%ms"
- if {ping.%player%} is between 200 and 349:
- message "&6Your ping : &e%{ping.%player%}%ms"
- if {ping.%player%} is between 350 and 499:
- message "&6Your ping : &6%{ping.%player%}%ms"
- if {ping.%player%} is between 500 and 999:
- message "&6Your ping : &c%{ping.%player%}%ms"
- if {ping.%player%} is greater than 1000:
- message "&6Your ping : &4%{ping.%player%}%ms"
- message "&7The table indicates the response time with the server"
- message "&6TPS : &a%{_tps}%"
- message "&7The TPS indicate if the server is overloaded, &a20 = &bperfect"
- message "&e%now%"
- message "&e&m-----------------------------------------------------"
- if argument 1 is "reload": #Script can charge in case of any problems
- if player has permission "tpscheck.admin":
- wait 1 tick #Allows to make a 'button' in a GUI (without this function, the item will not stand in its place will be duplicated by the user)
- make player execute command "/sk reload tpscheck"
- else:
- message "&cYou do not have permission."
- if argument 1 is "admin": #Displays options (server) the Skript
- if player has permission "tpscheck.admin":
- if argument 2 is not set: #Basic menu
- set {ping.%player%} to player's ping
- set {_tps} to tps
- open chest with 3 rows named "&c>> &lOptions&c <<" to player
- wait 2 tick
- format slot 0 of player with crafting table named "&6>> &lHelp&6 <<" with lore "&7Adjust settings TPSCheck||&7from this menu." to be unstealable
- format slot 8 of player with name tag named "&ractualize" to run [make player execute command "/lag admin"]
- format slot 7 of player with eye of ender named "&rReload Skript" to run [make player execute command "/lag reload"]
- format slot 12 of player with book and quill named "&eCreating logs" with lore "&7If the option is enabled, the server will create||&7logs (TPS, Ping every of players) all||&7five minutes.||&r||&8lick to access settings..." to run [make player execute command "/lag admin logs"]
- if {lag.verif} is true:
- format slot 14 of player with light green clay named "&eServer verification" with lore "&7state : &aActive||&r||&7If you enable this option, a verification||&7will make all &c5&7 minutes and you||&7indicate if the server is slow." to run [make player execute command "/lag admin verif"]
- else:
- format slot 14 of player with red clay named "&eServer verification" with lore "&7state : &cInnactif||&r||&7If you enable this option, a verification||&7will make all &c5&7 minutes and you||&7indicate if the server is slow." to run [make player execute command "/lag admin verif"]
- format slot 17 of player with book named "&rInformation" with lore "&7TPS : &a%{_tps}%||&7Ping : &a%{ping.%player%}%" to be unstealable
- format slot 18 of player with paper named "&eTPSCheck :" with lore "&7Created by : &aBlasko (akion)||&7Version : &a{@version}" to be unstealable
- format slot 26 of player with arrow named "&rFermer" to close
- if argument 2 is "logs": #Submenu displaying the options for logs
- if argument 3 is not set:
- set {ping.%player%} to player's ping
- set {_tps} to tps
- open chest with 1 rows named "&c>> &lOption Skript&c <<" to player
- wait 2 tick
- format slot 0 of player with crafting table named "&6>> &lHelp&6 <<" with lore "&7Set the log settings||&7from this menu." to be unstealable
- format slot 1 of player with paper named "&eTPSCheck :" with lore "&7Created by : &aBlasko (akion)||&7Version : &a{@version}" to be unstealable
- if {lag.logs.player} is true:
- format slot 3 of player with light green clay named "&eLogs : players" with lore "&7state : &aActive||&r||&7Creating logs containing||&7information &cplayers&7 all||&7the &c5 &7minutes." to run [make player execute command "/lag admin logs player"]
- else:
- format slot 3 of player with red clay named "&eLogs : players" with lore "&7state : &cInnactif||&r||&7Creating logs containing||&7information &cplayers&7 all||&7the &c5 &7minutes." to run [make player execute command "/lag admin logs player"]
- if {lag.logs.server} is true:
- format slot 5 of player with light green clay named "&eLogs : Server" with lore "&7state : &aActive||&r||&7Creating logs containing||&7information &cserver&7 all||&7the &c5 &7minutes." to run [make player execute command "/lag admin logs server"]
- else:
- format slot 5 of player with red clay named "&eLogs : Server" with lore "&7state : &cInnactif||&r||&7Creating logs containing||&7information &cserver&7 all||&7the &c5 &7minutes." to run [make player execute command "/lag admin logs server"]
- format slot 7 of player with book named "&rInformations" with lore "&7TPS : &a%{_tps}%||&7Ping : &a%{ping.%player%}%||&r||&8Click to refresh..." to run [make player execute command "/lag admin logs"]
- format slot 8 of player with arrow named "&rback" to run [make player execute command "/lag admin"]
- if argument 3 is "player":
- if {lag.logs.player} is false:
- set {lag.logs.player} to true
- message "&7[&cLag&7] &a➤ Logs players &aactivated&7"
- play raw sound "random.orb" at player with pitch 1 volume 10
- make player execute command "/lag admin logs"
- stop
- if {lag.logs.player} is true:
- set {lag.logs.player} to false
- message "&7[&cLag&7] &a➤ Logs players &cdisabled&7"
- play raw sound "random.orb" at player with pitch 1 volume 10
- make player execute command "/lag admin logs"
- stop
- if argument 3 is "server":
- if {lag.logs.server} is false:
- set {lag.logs.server} to true
- message "&7[&cLag&7] &a➤ Logs server &aactivated&7"
- play raw sound "random.orb" at player with pitch 1 volume 10
- make player execute command "/lag admin logs"
- stop
- if {lag.logs.server} is true:
- set {lag.logs.server} to false
- message "&7[&cLag&7] &a➤ Logs server &cdisabled&7"
- play raw sound "random.orb" at player with pitch 1 volume 10
- make player execute command "/lag admin logs"
- stop
- else:
- message "Debug: error"
- if argument 2 is "verif":
- if {lag.verif} is false:
- set {lag.verif} to true
- message "&7[&cLag&7] &a➤ Server verification &aactivated&7"
- play raw sound "random.orb" at player with pitch 1 volume 10
- make player execute command "/lag admin"
- stop
- if {lag.verif} is true:
- set {lag.verif} to false
- message "&7[&cLag&7] &a➤ Server verification &cdisabled&7"
- play raw sound "random.orb" at player with pitch 1 volume 10
- make player execute command "/lag admin"
- stop
- else:
- message "&4➤ &cYou do not have permission."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement