HyperScript
Docs

← All of the Docs HyperVelocity

Proxy events HyperVelocity

effectsend event <name> to server <name>HyperVelocity

Run the on receive event blocks for that name on another server

send event "alert" with variable "Text", arg.2 to server arg.1
effectsend event <name> to all serversHyperVelocity

The same, on every other server

send event "ban" with variable "Target", arg.1 with variable "Reason", arg.2 to all servers
effectwith variable <name>, <value>HyperVelocity

Attach a value; write it once per value, before to

send event "alert" with variable "Text", arg.2 to server arg.1
eventon receive event <name>:HyperVelocity

The block that runs when the event arrives

on receive event "ban":
    set {_p} to {_Target} parsed as offlineplayer
    ban {_p} because {_Reason}
    log "%{_p}% was banned from %{_sender_server}%"
Guide and examples

One server can make something happen on another. The sender names an event and may attach values; the receiver has a block for it.

On the sending server:

command /netban <player> <reason>:
    permission: "staff.ban"
    trigger:
        send event "ban" with variable "Target", arg.1 with variable "Reason", arg.2 to all servers
        ban arg.1 because arg.2

command /alert <server> <text>:
    permission: op
    trigger:
        send event "alert" with variable "Text", arg.2 to server arg.1

On every receiving server:

on receive event "ban":
    set {_p} to {_Target} parsed as offlineplayer
    ban {_p} because {_Reason}
    log "%{_p}% was banned from %{_sender_server}%"
SyntaxEffect
send event <name> to server <name>Run the on receive event blocks for that name on another server
send event <name> to all serversThe same, on every other server
with variable <name>, <value>Attach a value; write it once per value, before to
on receive event <name>:The block that runs when the event arrives
  • Each attached value is a local variable in the receiving block, under the name it was sent with: with variable "Target", arg.1 is read as {_Target}. Names ignore case.
  • {_sender_server} is always there too: the name of the server the event came from.
  • on receive event: without a name runs for every event that arrives.
  • The block runs with no player, like a console command, so send with no target goes to the console. Use the attached values to say who it is about.
  • An event is not saved or retried. If the other server cannot receive it at that moment (see below), it is lost.
  • on recieve event is accepted as well, for those of us who spell it that way.