skriptMC/main.sk

382 lines
15 KiB
Text
Raw Permalink Normal View History

2021-06-28 21:50:46 +02:00
on load:
ScriptList("add", script)
on unload:
ScriptList("remove", script)
2021-11-14 03:13:58 +01:00
# macro for easy reload of scripts
command skr [<text>]:
2021-03-09 14:50:45 +01:00
executable by: players, console
2021-06-27 18:58:43 +02:00
description: Reload de skripts.
2021-03-05 23:56:39 +01:00
trigger:
2021-06-26 03:01:51 +02:00
if arg-1 is set:
execute player command "sk reload %arg-1%"
else if arg-1 isn't set:
execute player command "sk reload scripts"
2021-03-05 23:51:47 +01:00
2021-11-14 03:13:58 +01:00
# autocompletion for scripts
on tab complete for "skr":
2021-06-28 21:50:46 +02:00
set tab completions for position 1 to the first element of {scripts::*}
loop {scripts::*}:
add loop-value to tab completions
2021-11-14 03:13:58 +01:00
# broadcast limited by a cooldown
command broadcast [<text>]:
2021-03-09 14:50:45 +01:00
executable by: players, console
2021-06-18 23:53:40 +02:00
aliases: bc
2021-06-27 18:58:43 +02:00
description: Fais une annonce à tout le monde. (30s de cooldown)
2021-11-14 03:13:58 +01:00
cooldown: 30 seconds
2021-03-05 23:56:39 +01:00
cooldown message: &4Tu dois attendre &l%remaining time% &4pour refaire cette commande !
trigger:
if player is op:
2021-06-19 00:09:36 +02:00
if arg-1 is set:
2021-06-28 13:02:44 +02:00
broadcast "&a&lBREAKING NEWS &7» &6%colored arg-1%"
send all players title "&a&lBREAKING NEWS" with subtitle "&6%colored arg-1%" for 5 seconds
2021-03-05 23:56:39 +01:00
else:
send "&4Vous n'avez pas spécifier de texte."
else:
2021-06-28 00:34:33 +02:00
cancel command cooldown
send option("errorMessage")
2021-03-05 23:51:47 +01:00
2021-11-14 03:13:58 +01:00
# retrieves a player's head
command skull [<offline player>]:
2021-03-09 14:50:45 +01:00
executable by: players
2021-03-09 14:16:20 +01:00
aliases: head, tete
2021-06-27 18:58:43 +02:00
description: Te drop une tête d'un joueur.
2021-03-05 23:56:39 +01:00
trigger:
if player is op:
set {_player} to player
2021-06-19 00:09:36 +02:00
if arg-1 is set:
set {_player} to arg-1
give {_player}'s skull to player
send "&7Vous avez reçu la tête de : &6%{_player}%"
2021-03-05 23:56:39 +01:00
else:
send option("errorMessage")
2021-03-05 23:51:47 +01:00
2021-11-14 03:13:58 +01:00
# delete chat history
command clearchat:
2021-03-09 14:50:45 +01:00
executable by: players, console
2021-03-09 14:16:20 +01:00
aliases: cc
2021-06-27 18:58:43 +02:00
description: Efface l'historique du chat dans ton monde. (1mn de cooldown)
2021-03-05 23:56:39 +01:00
cooldown: 1 minute
cooldown message: &4Tu dois attendre &l%remaining time% &4pour refaire cette commande !
trigger:
if player is op:
2021-06-29 22:09:02 +02:00
set {_player} to userOrNick(player)
loop 98 times:
2021-06-30 21:58:41 +02:00
broadcast " " in all worlds
broadcast "&cLe Chat a été clear par &e%{_player}%&c." in all worlds
broadcast " " in all worlds
2021-03-05 23:56:39 +01:00
else:
2021-06-28 00:34:33 +02:00
cancel command cooldown
send option("errorMessage")
2021-03-05 23:51:47 +01:00
2021-11-14 03:13:58 +01:00
# remove the rain in the server
on weather change to rain or thunder:
2021-06-26 22:49:04 +02:00
cancel event
2021-03-05 23:51:47 +01:00
2021-11-14 03:13:58 +01:00
# renames the item in the player's hand
command rename <text>:
2021-03-05 23:56:39 +01:00
executable by: players
2021-06-27 18:58:43 +02:00
description: Renomme l'item que tu as dans ta main.
2021-03-05 23:56:39 +01:00
trigger:
if player is op:
if player's tool is air:
send "&4Tu dois avoir un item dans la main pour le renommer."
else:
2021-06-28 13:02:44 +02:00
set {_name} to colored arg-1
2021-03-05 23:56:39 +01:00
replace all "&" with "§" in {_name}
2021-03-09 14:43:59 +01:00
send "&eL'item &r%player's tool%&e est renommé en ""&r%{_name}%&e""."
2021-06-29 21:07:16 +02:00
set name of the player's tool to "§r%{_name}%"
2021-03-05 23:56:39 +01:00
else:
send option("errorMessage")
2021-03-09 15:17:16 +01:00
2021-11-14 03:13:58 +01:00
# afk announcement
command afk:
2021-03-09 15:17:16 +01:00
executable by: players
2021-06-27 18:58:43 +02:00
description: Annonce que tu vas afk.
2021-03-09 15:17:16 +01:00
trigger:
2021-06-29 22:09:02 +02:00
set {_player} to userOrNick(player)
2021-06-30 21:58:41 +02:00
broadcast "&a%{_player}%&c est désormais afk !" in all worlds
2021-06-18 19:11:55 +02:00
2021-11-14 03:13:58 +01:00
# puts a player in creative
command gmc [<player>]:
2021-06-18 19:11:55 +02:00
executable by: players
2021-06-27 18:58:43 +02:00
description: Change le mode de jeu d'un joueur en créatif.
2021-06-18 19:11:55 +02:00
trigger:
if player is op:
set {_player} to player
if arg-1 is set:
set {_player} to arg-1
2021-06-26 22:21:00 +02:00
if gamemode of {_player} is creative:
send "&4Ce joueur est déjà en créatif."
stop
set gamemode of {_player} to creative
2021-06-29 22:09:02 +02:00
send "&7%player%&7 a changé ton mode de jeu en créatif." to {_player}
2021-06-27 23:56:26 +02:00
sendToOperators({_player}, "&7&o%player%&7&o a changé le mode de jeu de %{_player}%&7&o en créatif.")
2021-06-18 19:11:55 +02:00
else:
send option("errorMessage")
2021-06-18 19:11:55 +02:00
2021-11-14 03:13:58 +01:00
# puts a player as a spectator
command gms [<player>]:
2021-06-18 19:11:55 +02:00
executable by: players
2021-06-27 18:58:43 +02:00
description: Change ton mode de jeu d'un joueur en spectateur
2021-06-18 19:11:55 +02:00
trigger:
if player is op:
set {_player} to player
if arg-1 is set:
set {_player} to arg-1
2021-06-26 22:21:00 +02:00
if gamemode of {_player} is spectator:
send "&4Ce joueur est déjà en spectateur."
stop
set gamemode of {_player} to spectator
2021-06-29 22:09:02 +02:00
send "&7%player%&7 a changé ton mode de jeu en spectateur." to {_player}
2021-06-27 23:56:26 +02:00
sendToOperators({_player}, "&7&o%player%&7&o a changé le mode de jeu de %{_player}%&7&o en spectateur.")
2021-06-18 19:11:55 +02:00
else:
send option("errorMessage")
2021-11-14 03:13:58 +01:00
# teleports a player to the highest point with a block under his feet
command top:
2021-06-26 03:14:02 +02:00
executable by: players
2021-06-27 18:58:43 +02:00
description: Te téléporte sur le bloc le plus haut.
2021-06-26 03:14:02 +02:00
trigger:
if player is op:
teleport player to location of highest block at location
2021-06-29 22:09:02 +02:00
send "&aTu as été téléporté !"
2021-06-26 03:14:02 +02:00
else:
send option("errorMessage")
2021-06-26 03:14:02 +02:00
2021-11-14 03:13:58 +01:00
# kills all entities except exceptions (player, armor bearer, arrow,
# picture, frame, boat, villager and entity with a name)
command killall:
executable by: players
2021-06-27 18:58:43 +02:00
description: Tue toutes les entités du monde sauf joueur, porte-armure, flèche, tableau, cadre, bateau, villageois et entité avec un nom.
trigger:
if player is op:
set {_count} to 0
loop twice:
loop all entities:
if loop-entity is player:
continue
if loop-entity is armor stand:
continue
if loop-entity is arrows:
continue
if loop-entity is painting:
continue
if loop-entity is item frame:
continue
if loop-entity is boat:
continue
if loop-entity is villager:
continue
if loop-entity's name is set:
continue
kill loop-entity
add 1 to {_count}
send "Tu as tué %{_count}% entités."
2021-06-29 22:09:02 +02:00
set {_player} to userOrNick(player)
sendToOperators(player, "&7%{_player}%&7 as tué %{_count}%&7 entités.")
else:
send option("errorMessage")
2021-11-14 03:13:58 +01:00
# filled food bar of a player
command feed [<player>]:
executable by: players
2021-06-27 18:58:43 +02:00
description: Remplie la barre de nourriture d'un joueur.
trigger:
if player is op:
set {_player} to player
set {_playerNAME} to player
if arg-1 is set:
set {_player} to arg-1
if player is {_player}:
set {_playerNAME} to "toi-même"
else:
send "Tu as nourris %{_player}%."
feed {_player}
send "Tu as été nourris. (par %{_playerNAME}%)" to {_player}
else:
send option("errorMessage")
2021-06-27 01:08:08 +02:00
2021-11-14 03:13:58 +01:00
# send message when player first join the server
on first join:
set join message to "&aC'est la première fois que l'on te vois &r%player%, &abienvenue !"
2021-11-14 03:13:58 +01:00
# message when joining server and change his motd if he not disabled the functionality
on join:
2021-07-02 02:59:38 +02:00
set {_player} to userOrNick(player)
set join message to "%{_player}% &aa rejoint le serveur !"
if {playerIP.%ip of player%} is not false:
set {playerIP.%ip of player%} to player
2021-11-14 03:13:58 +01:00
# message when leaving the serveur and removing his possible correspondent
on quit:
2021-07-02 02:59:38 +02:00
set {_player} to userOrNick(player)
set quit message to "%{_player}% &ca quitté le serveur !" # joueur quitte le serveur
delete {dmReply.%uuid of player%} # suppression de la réponse
2021-11-14 03:13:58 +01:00
# information on stored ip and ability to disable the functionality
command ip [<text>]:
executable by: players
description: Information concernant ton IP et ce que collecte le serveur.
trigger:
if arg-1 is "save":
if {playerIP.%ip of player%} is false:
set {playerIP.%ip of player%} to player
send "&aRéactivation de l'enrengistrement de ton IP."
else:
set {playerIP.%ip of player%} to false
send "&cDésactivation de l'enrengistrement de ton IP."
stop
else:
send "&3Le serveur collecte &cton adresse IP&3 et le lie à ton &cpseudo Minecraft&3."
send ""
send "&3Pourquoi l'adresse IP ? &cPour te donner un motd personnalisé&3."
send ""
2021-06-28 21:14:14 +02:00
send formatted "<tooltip:&3Clique pour lancer /ip save.><cmd:/ip save>&3Que faire pour ne plus lié mon adresse IP avec mon pseudo (ou inversement) ? &c/ip save"
send ""
set {_inDB} to "oui"
set {_inDB} to "non" if {playerIP.%ip of player%} is false
send "&3Ton IP : &c%ip of player%&3 | Compte lié à l'IP : &c%{_inDB}%&3."
2021-11-14 03:13:58 +01:00
# (sometimes custom) motd
on server list ping:
2021-06-28 01:58:05 +02:00
if {playerIP.%ip%} is set:
if {playerIP.%ip%} is not false:
set {_motd} to "&e&k||| &cSalut &a%{playerIP.%ip%}%&c, reconnecte-toi ! &e&k|||"
if {_motd} is not set:
set {_srvName} to option("serverName")
set {_motd} to "&e&k||| &c%{_srvName}% &e&k|||"
set motd to {_motd}
2021-06-28 01:58:05 +02:00
set max players count to (number of all players + 1)
if max players count > {_playerCount}:
set max players count to (number of all players + 1)
2021-11-14 03:13:58 +01:00
# show the nearest front block if functionality is enabled
# custom tab
2021-06-30 21:58:41 +02:00
every second:
loop all players:
2021-06-28 12:39:32 +02:00
# affiche le block proche de toi
if {blockNear.%uuid of loop-player%} is true:
2021-06-28 01:58:05 +02:00
loop all blocks in radius 3 of loop-player:
if loop-block is target block of loop-player:
set action bar of loop-player to "&a%target block of loop-player%"
2021-11-14 03:13:58 +01:00
2021-06-28 12:39:32 +02:00
# tab
set {_serverName} to option("serverName")
2021-06-28 21:07:08 +02:00
set {_numberOfConnectedPlayers} to number of all players
set {_pluriel} to pluriel({_numberOfConnectedPlayers})
2021-11-14 03:15:44 +01:00
set tab header to "&a%{_serverName}%" and footer to "&e%{_numberOfConnectedPlayers}% joueur%{_pluriel}% connecté%{_pluriel}%%newline%&9%ping of loop-player% ms de latence" for loop-player
2021-06-29 22:09:02 +02:00
set {_player} to userOrNick(loop-player)
2021-06-28 12:39:32 +02:00
set tab list name of loop-player to {_player}
2021-11-14 03:13:58 +01:00
# command to activate or deactivate the display of the block near you
command quelbloc:
executable by: players
2021-06-27 18:58:43 +02:00
description: T'affiches le bloc en face de toi. (switch off/on)
trigger:
if {blockNear.%uuid of player%} is set:
delete {blockNear.%uuid of player%}
send "&cTu ne verras désormais plus le nom du bloc proche de toi."
else:
set {blockNear.%uuid of player%} to true
send "&aTu verras désormais le nom du bloc proche de toi."
2021-06-27 20:58:55 +02:00
2021-11-14 03:13:58 +01:00
# places the item in the player's hand on his head
command casque:
2021-06-28 00:50:42 +02:00
executable by: players
aliases: hat
description: Équipe l'objet dans ta main principale sur ta tête.
trigger:
if player is op:
if helmet of player is not air:
set {_item} to helmet of player
2021-06-28 01:09:57 +02:00
if tool of player is air:
if {_item} is set:
2021-06-28 01:14:22 +02:00
send "&cItem retiré !"
2021-06-28 01:09:57 +02:00
else:
send "&4Tu n'as rien dans tes mains."
stop
2021-06-28 00:50:42 +02:00
set helmet of player to tool of player
remove tool of player from inventory of player
add {_item} to inventory of player
2021-06-28 01:09:57 +02:00
if helmet of player is not air:
send "&aItem équippé !"
2021-06-28 00:50:42 +02:00
else:
send option("errorMessage")
2021-11-14 03:13:58 +01:00
# clear the player's inventory except equipment
command clear [<player>]:
executable by: players
description: Clear l'inventaire d'un joueur mais pas l'équipement.
trigger:
if player is op:
set {_player} to player
set {_arg1} to arg-1
if player is arg-1:
delete {_arg1}
if arg-1 is set:
set {_player} to arg-1
set {_helmet} to helmet of {_player}
set {_chestplate} to chestplate of {_player}
set {_leggings} to leggings of {_player}
set {_boots} to boots of {_player}
clear {_player}'s inventory
set helmet of {_player} to {_helmet}
set chestplate of {_player} to {_chestplate}
set leggings of {_player} to {_leggings}
set boots of {_player} to {_boots}
if {_arg1} is set:
2021-06-29 22:09:02 +02:00
set {_player} to userOrNick(arg-1)
send "&aTu as clear l'inventaire de %{_player}%&a."
set {_player} to userOrNick(player)
send "&aTon inventaire a été clear par %{_player}%&a." to arg-1
else:
send "&aTu as clear ton inventaire."
else:
send option("errorMessage")
2021-11-14 03:13:58 +01:00
# clear all player inventory including equipment
command clearall [<player>]:
executable by: players
aliases: fullclear
description: Clear tout l'inventaire d'un joueur.
trigger:
if player is op:
set {_player} to player
set {_arg1} to arg-1
if player is arg-1:
delete {_arg1}
if arg-1 is set:
set {_player} to arg-1
clear {_player}'s inventory
if {_arg1} is set:
2021-06-29 22:09:02 +02:00
set {_player} to userOrNick(arg-1)
send "&aTu as clear l'inventaire de %{_player}%&a."
set {_player} to userOrNick(player)
send "&aTon inventaire a été clear par %{_player}%&a." to arg-1
else:
send "&aTu as clear ton inventaire."
else:
send option("errorMessage")
2021-06-29 22:09:02 +02:00
2021-11-14 03:13:58 +01:00
# info on color coding in minecraft
command couleur:
2021-06-29 22:09:02 +02:00
executable by: players
aliases: couleurs, codecouleur, codecouleurs
description: Informations sur le code des couleurs.
trigger:
send "&lMettre & ou § au début du code pour faire une couleur"
send ""
send "4 ➡ &4Rouge foncé&r d ➡ &dViolet"
send "c ➡ &cRouge&r 5 ➡ &5Violet foncé"
send "6 ➡ &6Or&r f ➡ &fBlanc"
send "e ➡ &eJaune&r 7 ➡ &7Gris"
send "2 ➡ &2Vert foncé&r 8 ➡ &8Gris foncé"
send "a ➡ &aVert&r 0 ➡ &0Noir"
send "3 ➡ &3Bleu marine&r l ➡ &lGras"
send "1 ➡ &1Bleu foncé&r o ➡ &oItalique"
send "9 ➡ &9Bleu&r n ➡ &nSouligné"
2021-06-29 22:09:02 +02:00
send "k ➡ Glitché (exemple : &ka0\|&r) m ➡ &mBarré"
send "b ➡ &bBleu ciel&r r ➡ &rRéinitialise la couleur et style"