# veadotube

## Getting Started

veadotube is a PNGtuber app that swaps between still images of your character as you talk. Connecting it lets your commands change the avatar state, and lets a state change run a command. To connect the service:

- Open veadotube and turn on the WebSocket server in its program settings
- Head to the Services page inside Mix It Up
- Select Connect under the veadotube section

Mix It Up finds your running copy of veadotube on its own, so there is nothing to type in. veadotube's address changes every time it starts, which is why Mix It Up reads it for you. If more than one copy is running, each is tried in turn rather than only the most recently started one. Once connected, the service shows which instance it landed on and at what address, and the log records every address that was tried and why each one was passed over.

The Address field is optional and only exists for setups where veadotube runs on a different computer. If you need it, use the address veadotube shows next to "serving at", such as `127.0.0.1:2424`. Otherwise leave the box empty so Mix It Up can find veadotube itself.

An address typed without a port, or one using `localhost` as the host, is corrected rather than failed on. veadotube's own settings show a greyed out "localhost" hint directly above the real "serving at" line, so copying the wrong row is easy to do. An address that cannot be read at all is reported back to you instead of quietly falling back to automatic detection. Clearing the field turns automatic detection back on.

**NOTE**: Copies of veadotube older than version 2.1 cannot toggle avatar states or control push-to-talk. Update veadotube if those options do nothing.

To interact with veadotube, you would add a veadotube Action to your command.

## Actions

veadotube actions allow you to control your avatar from within your commands. This action supports the following options:

- **Set Avatar State:** Switches your avatar to the selected state
- **Push Avatar State:** Temporarily switches to the selected state, on top of the current one
- **Pop Avatar State:** Removes the selected pushed state, with veadotube returning to whatever is underneath in its state stack
- **Toggle Avatar State:** Turns the selected state on, or reverts to what was underneath it if it is already showing
- **Set Random Avatar State:** Switches your avatar to a randomly picked state, never the one already showing
- **Set Push-To-Talk:** Turns veadotube's push-to-talk gate On or Off, or Toggles it

For the push-to-talk options to work, "use websocket" must be turned on under push-to-talk in veadotube's microphone settings. Remove any push-to-talk keyboard shortcut as well, because a shortcut overrides anything Mix It Up sends.

The avatar states shown in the action editor are read from veadotube while it is connected. Renaming a state in veadotube does not notify Mix It Up, so use the refresh button in the action editor to reload the list after making changes.

## Events

The veadotube service also provides Events that run when something happens inside veadotube itself:

- **Avatar State Changed:** Runs when the active avatar state changes. Provides the following additional Special Identifiers:
  - $veadotubestateid = The ID of the state that is now showing (EX: surprised)
  - $veadotubestatename = The name of the state that is now showing (EX: surprised)
  - $veadotubepreviousstateid = The ID of the state that was showing before it (EX: idle)
  - $veadotubepreviousstatename = The name of the state that was showing before it (EX: idle)
- **Push-To-Talk Changed:** Runs when the push-to-talk gate turns on or off. Provides the following additional Special Identifier:
  - $veadotubepushtotalk = Whether push-to-talk is now active (EX: True)

Changes made by your own veadotube actions do not retrigger these events, so a command run by an event will not set off a loop.

The Avatar State Changed event does not fire for the state veadotube was already showing when Mix It Up connects or reconnects. Subscribing replies with the current state, and that reply is treated as the baseline rather than as a change, so the event only runs on a change made after that point. A change back to the state that was already showing is likewise not raised.
