HyperScript 1.7.1
Version 1.7.1
Big change
Check your scripts before updating to 1.7.1
A few more words now mean something.
increase,decrease,toggle,swap,default,respawn,showandhidestart a statement. A function with one of those names can no longer be called on a line of its own.- Inside a value,
if ... else ...now chooses between two values, andwithout,paddedandsorted bycontinue a value. Text is not affected, only bare words. type of <item>andamount of <item>are expressions;clamp(...)andrandom(a, b)are built-in functions, so a script's own function of that name is no longer the one called.- A line that ends with a backslash
\is joined to the next line. - A command with
disabled: trueis not added to the server.
A release of many small things: shorter ways to write common lines, subcommands, tab completion, region rules, two admin tools, seven more ready-made scripts, and a light and dark button on the website.
Changed (check existing scripts)
A few more words now mean something.
increase,decrease,toggle,swap,default,respawn,showandhidestart a statement. A function with one of those names can no longer be called on a line of its own.- Inside a value,
if ... else ...now chooses between two values, andwithout,paddedandsorted bycontinue a value. Text is not affected, only bare words. type of <item>andamount of <item>are expressions;clamp(...)andrandom(a, b)are built-in functions, so a script's own function of that name is no longer the one called.- A line that ends with a backslash
\is joined to the next line. - A command with
disabled: trueis not added to the server.
Added
Shorter ways to write things
if <condition>: <statement>on one line, e.g.if arg.1 is not set: stop.else unless <condition>:alongsideelse if.<a> if <condition> else <b>picks one of two values:"on" if {flag} else "off".increase {x} by 1/decrease {x} by 1,toggle {flag},swap {a} and {b},default {motd} to "Welcome"(sets it only if it has no value).- A long line can be split with a backslash at the end of each part.
clamp(n, least, most)andrandom(a, b).
Lists and text
<list> without <value>,<list> sorted by {<name>}(player names by each one's own variable),map each <list> to <expression>.<text> padded to <n>andpadded left to <n>for lining up columns.type of <item>(its material) andamount of <item>.
Waiting
run <function>(...) in <duration> as <name>gives a delayed run a name, andcancel run <name>calls it off. Starting another run under the same name replaces the first.
Players
respawn <who>,clear title of <who>,hide <who> from <who>/show <who> to <who>,show <who> a book titled <text> with pages <text>, <text>.tab name of <who>(settable),free slots of <who>,ping of <who>.- Conditions
has space for <item>/does not have space for <item>,is bedrock(through Floodgate) andis dead.
World
spawn firework at <location>withcolored,shapedandwith power.play effect <name> at <location>.- Signs:
line <n> of sign at <location>, readable and settable. - Containers:
items in chest at <location>,add <item> to chest at <location>,clear chest at <location>. gamerule <name> of world <name>,difficulty of world <name>,pvp of world <name>,spawn of world <name>.- Region rules:
set pvp of region "spawn" to falseandset build of region "spawn" to false. HyperScript enforces them itself;hyperscript.region.bypass(operators by default) may still build.players in region <name>lists who is inside.
Events
on shield block:,on anvil use:,on villager trade:.
Commands
- Subcommands:
subcommand <name> <arguments>:inside a command, each with its own permission, description, checked arguments and trigger. Tab offers the ones a player may use. - Tab completion from a script:
tab complete: <list>for the first argument,tab complete 2: <list>for the second, worked out when Tab is pressed. disabled: truekeeps a command in the file without adding it.
Admin tools
/hs variables <name>shows a saved variable or everything under a name;/hs variables <name> set <value>and/hs variables <name> deletechange it./hs timingslists which scripts have taken the most time;/hs timings resetstarts again.- "Did you mean": an unknown event, statement or function name suggests the nearest known one.
Ready-made scripts (on the website's Scripts page, each # Requires: 1.7.1)
Tpa.hs:/tpa,/tpaccept,/tpdenywith clickable answers and requests that run out.DailyRewards.hs:/dailywith a streak that pays more.Shop.hs: a paged menu shop,/selland/sellall.Crates.hs: a crate block opened with a tagged key, weighted prizes, a spin and a firework.CombatLog.hs: fighting players cannot use chosen commands, and logging out kills them.Afk.hs: marks players who stand still, in chat and in the tab list;/afk.Vote.hs:/votewith links,/voterewardfor a vote listener to run,/votetop.Announcements.hsnow makes a message written astext | addressa clickable link.
Website
- A light and dark button in the header. Without a choice the site follows the system setting; the choice is remembered in the browser.
- Every Docs entry has a
linkbutton that copies the address of that entry. - Every script has a page of its own,
scripts.html?script=<name>, with aLinkbutton to copy its address; the script's name on the Scripts page leads there.
Not included
Asked for or listed, and left out of this release:
- Toasts (the pop-up in the corner of the screen).
- Events for mounting and dismounting an entity (
vehicle enter/vehicle exitcover carts and boats). client version of <player>.- A way to change how long a title fades in and out after it is sent;
clear title ofis the only new title statement. give ... or drop: useif player has space for <item>:anddrop <item> at.