HyperScript 1.7.10
Version 1.7.10
Big change
Check your scripts before updating to 1.7.10
fireandschedulenow start a statement, so a function of either name must be renamed.on event "<name>":is a new kind of event line.- Text that contains
&#followed by six hex digits, or<gradient:...>, is now a colour.
Gradients and a second way to write hex colours, events that scripts fire for each other, delayed calls that survive a restart, tables in lists, and a website with settings, a public server count, an inbox for issues and a better playground.
Changed (check existing scripts)
fireandschedulenow start a statement, so a function of either name must be renamed.on event "<name>":is a new kind of event line.- Text that contains
&#followed by six hex digits, or<gradient:...>, is now a colour.
Added
Colours
- Gradients:
<gradient:#ff5555:#5555ff>text</gradient>, with as many colours as you like. A format code inside, such as&l, applies along the gradient. &#ff5555as a second way to write a hex colour.<#ff5555>already worked and was never in the documentation; both are documented now.- They work wherever text is coloured: chat, titles, sidebars, the tab list, item names, holograms.
uncoloredremoves them.
Events between scripts
fire event "<name>"runs everyon event "<name>":block in every loaded script.fire event "boss killed" with {_boss}, {_reward}hands local variables over under the same names. Inside the block,playeris the player of the trigger that fired it.- An event that sets itself off is stopped after sixteen rounds, with an error.
Calls that survive a restart
schedule <function>(...) in <duration>isrun ... inwritten down: the call still happens after the server restarts, and one that came due while it was off runs soon after it starts.as <name>lets a laterscheduleunder the same name replace it, andcancel schedule <name>call it off.- The values given to the function are worked out when the line runs and saved with the call. If the player who caused it is online when it is due, the function runs as that player.
Tables in lists
- A local table can be appended to a list and saved:
append _home to {%player%.homes}. Looping gives each one back as a table ({_home.name}). The list keeps its own copy. - Tables are now saved to disk as tables. Before, a table in a saved variable did not survive being written out.
Website
- Settings in
.env, besideapp.py. The export writes.env.examplewith every setting explained, and a first.envif there is none; it never overwrites yours.SHOW_PUBLIC_SERVER_AMOUNT,SHOW_PUBLIC_PLAYER_AMOUNT,ANALYTICS_ENABLED,ISSUES_ENABLED,ISSUES_PER_DAY,ISSUES_MAX_FILES,DISCORD_WEBHOOK_URL,PLAYGROUND_ENABLED,COMPRESS_PAGES. - A public count on the home page: "Live on N servers with M players", from the usage numbers. Each half can be switched off in
.env; with no server online nothing is shown.GET /api/statsgives the same two numbers. - An inbox for issues, at
/inbox: the issues people sent, behind the analytics code. Each can be marked done, reopened or deleted. WithDISCORD_WEBHOOK_URLset, a line is posted to Discord when one arrives (title, name and id only). - A page for every ready-made script (
scripts/kits.html) with its code on it, listed in the sitemap in place of the old addresses. - Playground: line numbers beside the box, and more than the first mistake. The plugin stops at the first; the checker looks on and lists one for each command, event or function that has any, each a link to its line.
Faster
- Coloured text. Text without any hex colour takes a shorter path than before, and text with hex colours or gradients is worked out once and remembered.
- Holograms. Changing one line of a hologram used to take it down and put it up again; now the line is renamed where it stands, and writing the text it already has does nothing at all. This is what a hologram updated from a timer does every few seconds.
- Holograms and worlds read their files once instead of every time one is used.
- The website sends pages compressed. The Docs page and the search index are several times smaller on the wire.
These are places where work was plainly being repeated. Nothing was measured on a busy server.