HyperScript 1.5.7
Added
Writing scripts
options:names a script's settings once, at the top of the file, to be used anywhere in it as{@name}: a price, a waiting time, a chat prefix, a permission. Changing a script no longer means reading its code.on load:runs a block each time a script is loaded: the place to set defaults and create teams.switchwithcaseanddefault, for commands with several subcommands.breakandcontinueinside loops.- Tab completion for arguments.
command /kit <default|pro|master>:offers those three words when Tab is pressed, and<player>offers the players who are online.
Values
- Math functions:
min(),max(),abs(),round(),floor(),ceil(),sqrt(), androunded up/rounded down. duration(seconds)turns a number into readable time: "9 minutes 30 seconds".distance between <a> and <b>for two locations.- Lists:
items 1 to 5 of <list>,index of <value> in <list>, andkeys of {warp}, which lists the names under a table so a script can loop over what it has stored.
Players and chat
- Teams:
add player to team "red", a colour, prefix and suffix per team, friendly fire on or off,team of player,players of team "red". A team's colour changes the name above a player's head. - Moderation:
kick <who> because <text>,ban <who> for 7 days because <text>,unban, the conditionis banned, andon player login:withrefuse login because <text>to turn someone away before they are in the game. - Clickable chat:
send "&a[Home]" with click command "/home" with hover "&7Go home", plusclick suggestionandclick url.
Items and inventories
- Enchantments and flags:
enchanted with sharpness 5, fire aspect 2,unbreakable,glowing. They are kept when an item is stored in a variable. - Wearing and holding:
set helmet of player to ..., and the same forchestplate,leggings,boots,toolandoffhand;inventory slot 3 of player;clear inventory of player. Each can be read as well as set. - GUI slots from a loop. The block under
open guiis now ordinary code, soslotlines can come out of afor eachor sit behind anif, and a slot can be a whole item (for a glowing button, say).
Updates
- Update check. When the server starts, HyperScript asks its website which version is the newest. If a newer one exists it says nothing in the console; operators are told when they join, and
/hyperscript statusshows it. If the website cannot be reached, the log saysError: couldn't fetch newest version on startup. Nothing is downloaded. Switch it off withupdate-check: falseinconfig.yml.
Documentation website
/api/latestversionanswers with the newest version that has a jar, for example{"version": "1.5.7"}. This is what the plugin's update check asks.- Three more scripts on the Scripts page:
Teams.hs(coloured teams with a team chat),Warnings.hs(warn players, ban after three) andAnnouncements.hs(rotating messages, managed in game).Kits.hsandHomes.hswere rewritten aroundoptions:so that their settings sit at the top, and/kit <name>was added beside the/kitsmenu. - Badges on scripts. A
# Requires: 1.5.7line in a script's notes shows the plugin version it needs, and# Tags: kits, guishows tags that filter the page when clicked. - Script examples are coloured on every page.