HyperScript 1.7.23
Characters and trading without another plugin, the database open to scripts, variables several servers share, and better tools for finding out what a script is doing.
Added
Characters
create npc "Guide" at <location>makes a character that stands still, cannot be hurt, and runson npc click "guide":when a player clicks it.as <entity>makes it another creature,delete npctakes it away, andnpc "guide"is the creature itself formake ... sayand the like. Characters are remembered across restarts. They cannot look like players; that still takes Citizens and HyperCitizens.
Trading
open trades "Blacksmith":opens the window villagers trade in, with a line for each offer under it:5 emerald for 1 iron sword, or8 emerald and 1 stick for 1 diamond sword.
Questions
ask player "Name your pet" with anvil into _nameasks in an anvil's text box instead of chat, which works from inside a menu. Needs a Paper server; elsewhere it asks in chat.
The database
run sql "..."andsql rows of "..."ask the database the variables are kept in, withwith <value>, <value>for the question marks. For servers whose storage issqliteormysql.- Shared variables. With
storage.shared-variables: true, a variable whose name starts withshared.is the same on every server that uses the database, a couple of seconds after it changes on one.
Limits
limit: 5 per secondon a command or event lets a burst through and drops the rest, for each player. For chat, clicks and other things a player can set off many times a second.
Finding out what a script does
/hyperscript debug <player>now also shows what each line did: what a variable became, and which way anifwent./hyperscript timings <script>times every line of one script for thirty seconds and lists the slowest./hyperscript docs <word>searches the documentation from inside the game.