Skip to content
Redwire Docs
v1.0.0.0
Redwireclient.com
Docs /MODULES /Scripts

7. Scripts

Scripts let you automate the game by connecting blocks together on a canvas. There is no code to type. You drag out the things you want to happen, wire them up in order, and press Start.

For the full list of blocks, see the Script Block Reference.


7.1 The idea in one picture

A script is a chain. Something starts it, then each block runs in turn:

┌──────────────────┐   ┌─────────────┐   ┌──────────────────┐   ┌────────────┐
│ On Script Start  ├──▶│ Send Message├──▶│ Delay            ├──▶│ Jump       │
│      (Event)     │   │  "hello"    │   │  2 seconds       │   │            │
└──────────────────┘   └─────────────┘   └──────────────────┘   └────────────┘

The arrows are flow wires. They decide the order things happen in. A block does its job, then passes control along its outgoing wire to the next one.

7.2 The four kinds of block

Each has its own colour, and you pick them from the coloured buttons on the canvas.

KindColourWhat it isExample
EventsOrangeWhere a script begins. An event has an outgoing wire but no incoming one — nothing runs it, it fires by itself when the thing it watches happens.On Script Start, OnChat, OnDeath
ActionsRedSomething that happens. Has an incoming wire and an outgoing one.Send Message, Jump, Click Slot
ConditionalsBlueA question. If / Else blocks have two outgoing wires, True and False, and the script follows whichever matches. Wait For blocks have one, and simply pause until their condition is met.Is Sneaking, Wait For Packet
VariablesPurpleA value — the player’s health, the item in a slot, a number you typed. These have no flow of their own; they feed values into other blocks’ fields.Health, Position, Set

Every script needs at least one Event block, because nothing else can start it. A canvas full of Actions with no Event will run and do nothing.

7.3 The two kinds of wire

Flow wires (thick, between the arrow-shaped ports) decide what happens next.

Data wires (thin, from a Variable’s round output to a field’s round input) decide what value a field uses. Instead of typing 20 into a field, you can wire the Health variable into it, and the field will use whatever your health is at that moment.

When you wire a Variable into a field, Redwire fills the field in with a placeholder like {Health} so you can see at a glance where the value comes from.

7.4 Managing scripts

The left-hand panel lists your scripts.

ControlWhat it does
New ScriptCreates one. Type a name and confirm. It arrives with three starter blocks — see §7.6
Search scripts…Filters the list
Click a scriptOpens it in the editor
⋮ menuRename and Delete for that script
Open FolderOpens the folder your scripts are saved in, in your file manager
KeybindThe key that starts and stops this script — see below
Start / StopRuns the script, or stops it

Scripts are saved as .redscript files in <Redwire folder>/Scripts/. They are plain text, so you can copy one to a friend by sending them the file — drop it in the folder and it appears in the list.

Giving a script a key

The box immediately left of Start is that script’s own keybind. It works exactly like a Client Tool’s:

  1. Click the box. It shows ... and is waiting.
  2. Press the key you want — or click a mouse button, those bind too.
  3. Backspace clears the binding. Esc cancels and leaves it as it was.

The key toggles: press it once to start the script, press it again to stop it. It works in game, with no screen open, and it does the same thing the Start button does.

Renaming a script carries its key across. Deleting one drops its key.

Keys are not stored inside the .redscript file. They live in Redwire/scriptkeys.redwire, so a script you send to someone else does not arrive silently claiming one of their keys — and a script they send you does not claim one of yours.

Nothing stops you binding two scripts to the same key; both will toggle together. See Keybinds for how Redwire’s three separate sets of keys fit together.

7.5 Building a script

Placing a block

  1. Click one of the four coloured category buttons on the canvas.
  2. Pick a sub-category (Player, Network, GUI, …).
  3. Pick the block.
  4. It appears on the canvas.

Moving around

ActionHow
Pan the canvasClick and drag on empty space
Move a blockDrag it by its title bar
Select a blockClick it
Delete a blockRight-click it, or select it and press Delete / Backspace

Connecting blocks

  1. Click an output port on the right of a block.
  2. Click an input port on the left of another block.

A wire is drawn. Redwire only lets you connect compatible ports — you cannot wire a flow output into a data input.

To cancel a wire mid-draw, right-click, or click anywhere that is not a valid input.

To delete a wire, click on the wire itself.

Filling in a block’s fields

Each block has its own fields, drawn on the block. They use the standard controls described in Using the Interface — text boxes, number boxes, dropdowns, multi-selects and sliders.

Fields marked * are required: the block will not work without them. Fields marked (optional) can be left empty, and leaving them empty usually means “any”. Break Block with no Block ID breaks whatever you are looking at; give it a Block ID and it only breaks that.

Saving

ShortcutAction
Save button, or Ctrl + SSaves the script
Undo button, or Ctrl + ZUndoes the last edit
Redo button, or Ctrl + YRedoes it

If you try to leave a script with unsaved changes, a pop-up asks first: Save, Discard or Go Back.

7.6 Running a script

Press Start on the script in the list.

While a script is running:

  • The editor is read-only. You cannot move blocks, change fields, wire, delete or undo. The panel tells you: “Stop script to start editing.” This prevents you editing a graph out from under the thing walking through it.
  • Press Stop to end it and unlock the editor.

Scripts also stop when you quit the game.

Scripts keep running when you disconnect

Leaving a server does not stop a script. That is deliberate: a script cannot react to you disconnecting if disconnecting kills it first, and a script that reconnects on its own has to survive the gap in between.

Blocks that need a player — jumping, clicking slots, looking at things — quietly do nothing while there is no world. Blocks that do not need one keep working: Connect to Server, Delay, Repeat, End Script, and Redwire’s own actions like Toggle Interceptor.

So a script can sit on the main menu, wait, join a server, and carry on.

You get no notifications in the main menu. Redwire’s messages are drawn in chat, the action bar or as a title, and all three need a player. A script started from the menu runs silently — the Start / Stop state on the Scripts page is your only indication that it is going.

The two blocks every new script starts with

A new script is created with three blocks already on the canvas:

On Script Start ──▶ (your script goes here)

OnDisconnect ──▶ End Script

The second pair is what makes an ordinary script end when you leave the server, which is what most people expect. Delete those two blocks if you want a script that outlives the connection — one that reconnects for you, for instance.

How execution actually proceeds

Each Event block in your script starts its own cursor — a marker walking the flow wires. Each game tick, every cursor advances as far as it can, until it hits:

  • a block that waits (Delay, a Wait For, an action that takes time),
  • the end of its chain,
  • or its budget of steps for that tick.

If one output fans out to several blocks, all of them run — each branch gets its own cursor and they proceed side by side. This is how you do two things at once.

Repeat loops the blocks connected to it, a set number of times or forever. End Script stops the whole run, every cursor at once.

7.7 Three scripts to start with

1. Say hello when the script starts

On Script Start ──▶ Send Message ("Hello!")

Two blocks. Press Start, and your player says “Hello!” in chat.

2. Anti-idle

On Script Start ──▶ Repeat (infinite)
                      └──▶ Jump ──▶ Delay (30 seconds)

Jumps every thirty seconds, forever, until you press Stop.

3. React to chat

OnChat ("diamond") ──▶ Send Message ("where?")

The OnChat event has a filter field. Fill it in and the event only fires for messages containing that text.

7.8 Running scripts on your other clients

If you use Remote Control, the host can start and stop any of its scripts on every connected client at once. The script is sent along with the command, so the other clients do not need their own copy of it.