> ## Documentation Index
> Fetch the complete documentation index at: https://docs.erlc.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# erlc.dev Studio Quickstart: Build Your First Automation

> Learn how to link your ERLC server, connect a Discord bot, and build your first automation with erlc.dev Studio in under 10 minutes.

This guide walks you through everything you need to go from a blank account to a running automation. By the end, you'll have a live workflow that detects when a player joins your ERLC server and automatically sends a message to a Discord channel. The whole process takes less than ten minutes.

<Steps>
  ### Create Your erlc.dev Account

  Visit [erlc.dev](https://erlc.dev) and sign up for a free account. You can register with your Discord account for the fastest setup — this also pre-authorises the Discord connection you'll need in a later step.

  <Tip>
    Using "Sign in with Discord" is strongly recommended. It speeds up the Discord bot connection step and ensures your account is linked to the right Discord identity from the start.
  </Tip>

  Once signed in, you'll land on your **Dashboard** — the home for all your servers and automations.

  ### Link Your ERLC Server

  Before Studio can listen for in-game events, it needs to know which ERLC server to watch.

  1. From the Dashboard, click **Add Server**.
  2. Enter your ERLC **Server Key**. You can find this in the ERLC in-game settings panel under *API & Integrations*.
  3. Give your server a display name and click **Save**.

  Studio will verify the key and show a green *Connected* indicator next to your server name.

  <Warning>
    Keep your Server Key private. Anyone with this key can read live data from your ERLC server. Never share it publicly or commit it to a public repository.
  </Warning>

  ### Connect Your Discord Bot

  Studio needs a Discord bot token to send messages and respond to commands on your behalf.

  1. Open the [Discord Developer Portal](https://discord.com/developers/applications) and create a new application.
  2. Navigate to the **Bot** tab and click **Reset Token** to generate a token. Copy it immediately — Discord will not show it again.
  3. Under **Privileged Gateway Intents**, enable **Server Members Intent** and **Message Content Intent**, then save.
  4. Back in erlc.dev Studio, go to **Settings → Discord Bot** and paste your token, then click **Connect**.
  5. Use the **OAuth2 invite link** Studio generates to add the bot to your Discord server.

  <Note>
    The bot must have the **Send Messages**, **Use Slash Commands**, and **Read Message History** permissions in the channels where your automations will run.
  </Note>

  ### Open the Studio Workspace

  With your server and bot connected, you're ready to build.

  1. From the Dashboard, click your server name to open the server detail page.
  2. Click **Open Studio**. The visual block editor opens in a new tab.
  3. You'll see an empty canvas (the *workspace*) with a block palette on the left side.

  The palette organises blocks into categories: **Events**, **Actions**, **Values**, **Variables**, **Logic**, and more. You'll only use a few of these for your first automation.

  ### Build Your First Automation

  You'll build a simple automation: **When a player joins → send a message to Discord**.

  **Step 1 — Add the event trigger**

  From the **Events** category in the palette, drag an `erlc_when_event` block onto the canvas. This block is the starting point of every in-game event automation.

  Click the dropdown on the block and select **`player_joined`** as the `EVENT_TYPE`. The block now listens for the moment any player joins your ERLC server.

  **Step 2 — Add the send message action**

  From the **Actions** category, drag an `erlc_bot_send_message` block and snap it to the bottom connection of the `erlc_when_event` block.

  Configure the block:

  * **Channel ID**: Paste the Discord channel ID where you want the message to appear. (Right-click a channel in Discord → *Copy Channel ID* — you may need Developer Mode enabled in Discord settings.)
  * **Message**: Click the message input and connect an `erlc_text_value` block from the **Values** category. Type your message, for example: `A player just joined the server!`

  <Tip>
    To include the joining player's name dynamically, add an `erlc_event_value` block alongside your text and set its field to **`player_name`**. You can concatenate values using a text join block from the **Text** category.
  </Tip>

  Your finished automation looks like this in the underlying block format:

  ```json theme={null}
  {
    "format": "erlc-studio-blocks",
    "version": 1,
    "workspace": {
      "blocks": {
        "blocks": [
          {
            "type": "erlc_when_event",
            "fields": {
              "EVENT_TYPE": "player_joined"
            },
            "next": {
              "block": {
                "type": "erlc_bot_send_message",
                "inputs": {
                  "CHANNEL_ID": {
                    "block": {
                      "type": "erlc_text_value",
                      "fields": { "TEXT": "YOUR_CHANNEL_ID" }
                    }
                  },
                  "MESSAGE": {
                    "block": {
                      "type": "erlc_text_value",
                      "fields": { "TEXT": "A player just joined the server!" }
                    }
                  }
                }
              }
            }
          }
        ]
      }
    }
  }
  ```

  <Info>
    Every automation follows this pattern: one **event block** at the top, with **action blocks** chained through `next.block` connections. Value blocks (like `erlc_text_value` and `erlc_event_value`) plug into named **inputs** on action blocks to supply dynamic data.
  </Info>

  **Step 3 — Save your automation**

  Click **Save** in the top-right corner of the workspace. Give your automation a name like *"Welcome Message"* and confirm. Studio stores the automation and arms it immediately.

  ### Test It With Test Run

  You don't need a real player to join in order to verify your automation works. Studio includes a built-in test trigger.

  1. In the Events palette, drag an `erlc_when_test_run` block onto a clear area of the canvas — separate from your main automation stack.
  2. Attach the same `erlc_bot_send_message` action block chain to this trigger (or duplicate your existing stack).
  3. Click the **▶ Run Test** button that appears on the `erlc_when_test_run` block.

  Studio fires the automation immediately and you should see the message appear in your Discord channel within a few seconds.

  <Note>
    The `erlc_when_test_run` trigger only fires when you manually click **Run Test** inside the editor. It never executes in production, so it's safe to leave on the canvas during development.
  </Note>

  Once the test message arrives in Discord, your automation is working correctly. Remove or disable the `erlc_when_test_run` stack and your live `erlc_when_event` automation will handle real player joins automatically.
</Steps>

## What's Next?

Now that your first automation is live, here are some directions to explore:

<CardGroup cols={2}>
  <Card title="Core Concepts" icon="book-open" href="/core-concepts">
    Understand event blocks, action blocks, value blocks, variables, and pages — the full mental model behind Studio.
  </Card>

  <Card title="Block Catalog" icon="grid-2" href="/studio/blocks-overview">
    Browse every available block type, its inputs, and what it does.
  </Card>

  <Card title="Slash Commands" icon="terminal" href="/guides/slash-command-bot">
    Let your Discord members trigger automations by typing a command.
  </Card>

  <Card title="Persistent Variables" icon="database" href="/logic/database">
    Store data between automation runs to track player stats and server state.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.