# 2. Streaming & Input

The bot needs to **see** the game and **send commands**. You set both up in **Settings → Streaming & Input**, which walks you through a short wizard.

> **TL;DR** — If you followed the [VM Setup](https://pixelbot-docs.gitbook.io/pixelbot/configuration/virtualmachine), the bot already sees the game. You only have to pick how you want it to send input.

***

## Quick concepts

| Term                 | What it means                                                                    |
| -------------------- | -------------------------------------------------------------------------------- |
| **VM connection**    | How the bot sees your game.                                                      |
| **Streaming client** | The app on your PC that shows the VM screen — Moonlight or Parsec. Optional.     |
| **Input method**     | How the bot sends your keypresses and mouse moves. Two options, explained below. |
| **Pairing**          | A one-time linking step. Only needed for the background input method.            |

***

## Pick your scenario

Step 2 of the wizard asks *"How do you play on the VM?"*. Pick the card that matches your setup:

| Scenario                    | How you see the VM                      | Pairing needed?                               |
| --------------------------- | --------------------------------------- | --------------------------------------------- |
| 🎮 **Moonlight + Sunshine** | Moonlight window on your PC             | Only if you pick the recommended input method |
| 🖥️ **Parsec**              | Parsec window on your PC                | No                                            |
| 💻 **Directly on this PC**  | The game runs on the same PC as the bot | No                                            |

The wizard picks the right input method for you — you don't have to think about it.

***

## Scenario 1 — Moonlight + Sunshine *(default)*

You watch the VM through Moonlight. You have **two** ways to send input:

### Option A — Focused-window input

* The bot types into the Moonlight window on your PC.
* **The Moonlight window must stay in focus.** If you click on something else, the bot stops working until you focus it again.
* No pairing needed.
* Good for a quick start.

### Option B — Background input *(recommended)*

* The bot keeps working even when Moonlight is minimized or hidden behind other windows.
* **You can use your PC for other things while the bot runs.**
* Needs a one-time pairing (below).
* Needs **Sunshine** inside the VM — see the [Sunshine Setup](https://pixelbot-docs.gitbook.io/pixelbot/configuration/sunshine) page if you don't have it yet.

### Pairing walk-through (only for Option B)

When you pick the recommended option, step 4 of the wizard appears:

1. Make sure the VM is connected in step 1.
2. Click the link that opens the **Sunshine Web UI** in your browser.
3. Log in there and note your username and password.
4. Type the same username and password into the wizard.
5. The wizard shows a **PIN** (you can change it if you want).
6. Click **Pair**. The wizard does the rest.
7. When the status turns green, click **Test connection** to confirm everything works.

> 💡 Pairing is one-time. After that, the bot reconnects on its own.

### Moonlight picture quality

If the video looks bad, open Moonlight's settings (gear icon) and use these values:

| Setting      | Value        |
| ------------ | ------------ |
| Resolution   | 1920 × 1080  |
| FPS          | 60           |
| Video Codec  | H.265 (HEVC) |
| Bitrate      | 50 Mbps      |
| Window Mode  | Fullscreen   |
| V-Sync       | OFF          |
| Frame Pacing | OFF          |

> **Important**: The Moonlight resolution must be **1920 × 1080** — the bot expects that size.

***

## Scenario 2 — Parsec

You watch the VM through Parsec. The bot sends input to the focused Parsec window.

**How to set it up**

1. Install Parsec inside the VM and sign in.
2. Install Parsec on your PC and connect to the VM.
3. In the wizard, pick **Parsec**.
4. Done. No pairing needed. Keep the Parsec window in focus while the bot runs.

> ⚠️ Parsec often looks sharper than Moonlight at low bitrate. Downside: you can't minimize the Parsec window while the bot is running.

***

## Scenario 3 — Directly on this PC

The game runs on the same PC as the bot (no streaming).

> ⚠️ **Only for private servers.** On the official server the game must always run inside a VM and the bot on your host PC — otherwise the anticheat will see the bot. Use Scenario 1 or 2 if you play on official.

**How to set it up**

1. In the wizard, pick **Directly on this PC**.
2. Done. Keep the game window in focus while the bot runs.

***

## Status at a glance

The top of the wizard shows small status tags. Depending on your scenario, some may not appear:

| Tag               | Meaning                                                                       |
| ----------------- | ----------------------------------------------------------------------------- |
| **VM connected**  | The bot is seeing the game.                                                   |
| **Paired**        | You completed the one-time pairing. (Only in Moonlight + recommended input.)  |
| **Stream active** | The bot has an active input session. (Only in Moonlight + recommended input.) |

In Parsec and "Directly on this PC", you'll only see **VM connected**.

***

## Troubleshooting

| Problem                                                          | What to do                                                                                                                   |
| ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| "No VMs found" in step 1                                         | Open Hyper-V Manager and start your VM, then click the refresh icon.                                                         |
| The wizard is blocked at step 4                                  | Connect the VM first (step 1).                                                                                               |
| Pairing says the credentials are wrong                           | Re-check the username/password in the Sunshine Web UI and type them exactly in the wizard.                                   |
| "Paired" but never turns to "Stream active"                      | Click **Test connection**. If it still fails, open the Sunshine Web UI and confirm there's a **Desktop** application listed. |
| Input doesn't reach the game (Moonlight focused-window / Parsec) | Click on the Moonlight or Parsec window once before starting the bot.                                                        |
| Laggy stream                                                     | Use a wired connection, not Wi-Fi. Raise the bitrate in Moonlight if your network allows it.                                 |
| Black Moonlight screen for a few seconds                         | Normal right after connecting — wait 5-10 seconds.                                                                           |

***

## Need Help?

Join our [Discord](https://discord.gg/3pMUfYXjra) for support.
