Pipe Input: Difference between revisions

From Dolphin Emulator Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 1: Line 1:
Since {{Revision|4.0-8065}}, Dolphin supports automated input using unix named pipes. This can be used to write [https://github.com/spxtr/p3 bots], for example, or to automate tedious in-game tasks.
Since {{Revision|4.0-8065}}, Dolphin supports automated input using unix named pipes. This can be used to write [https://github.com/spxtr/p3 bots], for example, or to automate tedious in-game tasks.


This features only works on unix systems for now, and needs some setup to work:
This features only works on UNIX systems for now, and needs some setup to work:


==== Creating the fifo ====
==== Creating the FIFO ====
First, locate your dolphin-emu user folder (usually in ~/.dolphin-emu or ~/.config/dolphin-emu), then run:
First, locate your dolphin-emu user folder (usually in <code>~/.dolphin-emu</code> or <code>~/.config/dolphin-emu</code>), then run:


  mkfifo pipe1
  mkfifo pipe1


==== Controller config ====
==== Controller Config ====


Then you can either perform the task of selecting the pipe input into the controller config dropdown and then sending the
Then you can either perform the task of selecting the pipe input into the controller config dropdown and then sending the

Revision as of 01:06, 21 January 2016

Since 4.0-8065, Dolphin supports automated input using unix named pipes. This can be used to write bots, for example, or to automate tedious in-game tasks.

This features only works on UNIX systems for now, and needs some setup to work:

Creating the FIFO

First, locate your dolphin-emu user folder (usually in ~/.dolphin-emu or ~/.config/dolphin-emu), then run:

mkfifo pipe1

Controller Config

Then you can either perform the task of selecting the pipe input into the controller config dropdown and then sending the button push/release events manually into the configuration dialog (very tedious), or copy the following config section into the Config/GCPadNew.ini file in the user folder.

[GCPad1]
Device = Pipe/0/pipe1
Buttons/A = `Button A`
Buttons/B = `Button B`
Buttons/X = `Button X`
Buttons/Y = `Button Y`
Buttons/Z = `Button Z`
Buttons/Start = `Button START`
D-Pad/Up = `Button D_UP`
D-Pad/Down = `Button D_DOWN`
D-Pad/Left = `Button D_LEFT`
D-Pad/Right = `Button D_RIGHT`
Triggers/L = `Button L`
Triggers/R = `Button R`
Main Stick/Up = `Axis MAIN Y -`
Main Stick/Down =  `Axis MAIN Y +`
Main Stick/Left = `Axis MAIN X -`
Main Stick/Right = `Axis MAIN X +`
C-Stick/Up = `Axis C Y -`
C-Stick/Down =  `Axis C Y +`
C-Stick/Left = `Axis C X -`
C-Stick/Right = `Axis C X +`

Interacting

You can interact with the fifo using standard command-line tools such as echo.

Doing a button push:

echo 'PRESS A' > ~/my-dolphin-directory/pipe1

Doing a button release:

echo 'RELEASE A' > ~/my-dolphin-directory/pipe1

Moving a stick (where stick_name is C or MAIN and X and Y values between 0 and 1):

echo 'SET stick_name X Y' > ~/my-dolphin-directory/pipe1