{"id":13759793,"url":"https://github.com/komefai/PS4Macro","last_synced_at":"2025-05-10T10:30:22.640Z","repository":{"id":40625888,"uuid":"101907701","full_name":"komefai/PS4Macro","owner":"komefai","description":"Automation utility for PS4 Remote Play written in C#","archived":false,"fork":false,"pushed_at":"2018-09-09T16:44:25.000Z","size":521,"stargazers_count":378,"open_issues_count":96,"forks_count":89,"subscribers_count":46,"default_branch":"master","last_synced_at":"2024-11-16T16:37:25.065Z","etag":null,"topics":["automation","bot","dualshock","macro","ps4","remoteplay"],"latest_commit_sha":null,"homepage":"http://blog.komefai.com","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/komefai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-30T17:06:05.000Z","updated_at":"2024-10-19T11:47:55.000Z","dependencies_parsed_at":"2022-07-11T02:51:19.681Z","dependency_job_id":null,"html_url":"https://github.com/komefai/PS4Macro","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komefai%2FPS4Macro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komefai%2FPS4Macro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komefai%2FPS4Macro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komefai%2FPS4Macro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/komefai","download_url":"https://codeload.github.com/komefai/PS4Macro/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253400820,"owners_count":21902553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","bot","dualshock","macro","ps4","remoteplay"],"created_at":"2024-08-03T13:00:59.215Z","updated_at":"2025-05-10T10:30:22.348Z","avatar_url":"https://github.com/komefai.png","language":"C#","funding_links":["http://paypal.me/Komefai"],"categories":["C#"],"sub_categories":[],"readme":"# PS4 Macro\r\n\r\n[![Twitter](https://img.shields.io/twitter/url/https/twitter.com/fold_left.svg?style=social\u0026label=Follow%20Me)](https://twitter.com/itskomefai)\r\n[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](http://paypal.me/Komefai)\r\n\r\nAutomation utility for PS4 Remote Play written in C# using [PS4RemotePlayInterceptor](https://github.com/komefai/PS4RemotePlayInterceptor).\r\n\r\n🔔 **Download latest version [here](https://github.com/komefai/PS4Macro/releases)!**\r\n\r\n#### Screenshot\r\n\r\n![Screenshot](https://raw.githubusercontent.com/komefai/PS4Macro/master/_resources/Screenshot_0_5_2.png)\r\n\r\n## Usage\r\n\r\n⚠️ To use WITHOUT a controller plugged in, see `EmulateController` in [Settings](https://github.com/komefai/PS4Macro#settings) section below.\r\n\r\n##### Easy Way (shortcut)\r\n\r\nPress the touch button on your controller (touchpad) to start recording and press it again to stop.\r\n\r\n\u003e NOTE: If you're using the touch button in the macro then disable it by going to Playback-\u003eRecord On Touch\r\n\r\n##### Manual Way\r\n\r\nTo record, click on `RECORD` button (Ctrl+R) to arm recording then press `PLAY` to start recording controls. The red text on the bottom right indicates the number of frames recorded. You can stop recording by clicking on `RECORD` button (Ctrl+R) again. The macro will then play the controls in a loop.\r\n\r\n## Settings\r\n\r\nYou can create `settings.xml` using a text editor and place it in the same folder as `PS4Macro.exe` to override default settings.\r\n\r\n| Setting | Description | Default\r\n| --- | --- | --- |\r\n| AutoInject | Automatically poll for PS4 Remote Play and inject whenever possible | false |\r\n| BypassInjection | Bypass the injection for debugging purposes | false |\r\n| EmulateController | Run with controller emulation (use without a controller) | false |\r\n| ShowConsole | Open debugging console on launch | false |\r\n| StartupFile | Absolute or relative path to the file to load on launch (can be xml or dll) | null |\r\n\r\n##### Example settings.xml\r\n\r\n```xml\r\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\r\n\u003cSettings\u003e\r\n  \u003cAutoInject\u003etrue\u003c/AutoInject\u003e\r\n  \u003cBypassInjection\u003efalse\u003c/BypassInjection\u003e\r\n  \u003cEmulateController\u003etrue\u003c/EmulateController\u003e\r\n  \u003cShowConsole\u003etrue\u003c/ShowConsole\u003e\r\n  \u003cStartupFile\u003eMyMacro.xml\u003c/StartupFile\u003e\r\n\u003c/Settings\u003e\r\n```\r\n\r\n## Command Line Arguments\r\n\r\nAs of version 0.5.0, you can pass command line arguments to PS4Macro.exe and override the values in settings.xml. This also allows you to create multiple shortcuts to PS4Macro.exe and have each of them override the settings when switching between games (recommended for advanced users).\r\n\r\n#### Arguments\r\n\r\n| Argument | Description | Default\r\n| --- | --- | --- |\r\n| SettingsFile | Absolute or relative path to the settings file (will take priority) | null |\r\n\r\n#### Examples\r\n\r\n##### Override settings using arguments\r\n\r\n```bash\r\nC:\\\u003e PS4Macro.exe --AutoInject --EmulateController --ShowConsole=false --StartupFile=\"C:\\macro.xml\"\r\n```\r\n\r\n##### Override default settings file (highest priority)\r\n\r\n```bash\r\nC:\\\u003e PS4Macro.exe --SettingsFile=\"C:\\custom-settings.xml\"\r\n```\r\n\r\n##### Using Windows shortcut\r\n\r\nRight-click on `PS4Macro.exe` and click on `Create shortcut` to create a new shortcut. Right-click on the newly created shortcut and select `Properties` and append your command line arguments after the existing text in the `Target` field.\r\n\r\n![Command Line Shortcut](https://raw.githubusercontent.com/komefai/PS4Macro/master/_resources/CmdShortcut.png)\r\n\r\n## Remapper\r\n\r\nRemapper allows you to use your keyboard to control PS4 games with customizable key bindings. To use Remapper, go to Tools-\u003eRemapper and focus on PS4 Remote Play to control the game. Simply close the window to return to marco or script mode.\r\n\r\nTo map a key to a button or a macro, edit the **Key** cell and enter your desire key. You can find the key from the **Member name** column in [this table](https://msdn.microsoft.com/en-us/library/system.windows.forms.keys(v=vs.110).aspx) (eg. `Delete`, `NumPad4`, `PageDown`). Use key `None` to completely disable the key.\r\n\r\nTo add a recorded macro, click on `...` to browse and select an xml macro file.\r\n\r\n![Remapper](https://raw.githubusercontent.com/komefai/PS4Macro/master/_resources/Remapper.png)\r\n\r\n## Scripting\r\n\r\nC# scripting support has been introduced in version 0.3.0 and later. This allows us to create custom behaviors beyond repeating macros with an easy-to-use API. The API also includes wrapped convenience functions such as pressing buttons, timing, and taking a screenshot from PS4 Remote Play. \r\n\r\nSee the [scripting video tutorial](https://youtu.be/daCb97rbimA) to get started or see [the wiki](https://github.com/komefai/PS4Macro/wiki) for full documentation, examples, and other information.\r\n\r\nNOTE: The script have to include a reference to `PS4MacroAPI.dll` to interface with PS4Macro. At the moment the scripts has to be compiled into a DLL file to be able to open with PS4 Macro.\r\n\r\n##### Basic Example Script\r\n\r\nThis example script will press DPad up and wait one second, follow by pressing square. The loop repeats every 800ms.\r\n\r\n```csharp\r\nusing PS4MacroAPI;\r\n\r\npublic class Script : ScriptBase\r\n{\r\n    /* Constructor */\r\n    public Script()\r\n    {\r\n        Config.Name = \"Example Script\";\r\n        Config.LoopDelay = 800;\r\n    }\r\n\r\n    // Called when the user pressed play\r\n    public override void Start()\r\n    {\r\n        base.Start();\r\n    }\r\n\r\n    // Called every interval set by LoopDelay\r\n    public override void Update()\r\n    {\r\n        Press(new DualShockState() { DPad_Up = true });\r\n        Sleep(1000);\r\n        Press(new DualShockState() { Square = true });\r\n    }\r\n}\r\n```\r\n\r\n#### List of Scripts\r\n\r\n- [Keyboard Remapping Utility](https://github.com/komefai/PS4Macro.Remote)\r\n- [Marvel Heroes Omega Bot](https://github.com/komefai/PS4Macro.MarvelHeroesOmega)\r\n- [PES2018 Bot (Simulator Mode)](https://github.com/leguims/PS4Macro.PES2018Lite) by [leguims](https://github.com/leguims)\r\n\r\n---\r\n\r\n## Troubleshoot\r\n\r\n##### Macro not playing/recording\r\n\r\n=\u003e Disable AutoInject in settings.xml since some machines does not support AutoInject.\r\n\r\n##### EmulateController does not work\r\n\r\n=\u003e Make sure you unplug every DualShock 4 controllers from your computer (otherwise the real controller will take priority over the emulated one). Start PS4 Remote Play, follow by PS4 Macro and wait for this screen. If you see the text `Press the OPTIONS button on the controller to start.` then it means that the emulated controller is working correctly. You can then press the Start button.\r\n\r\n![Emulate Controller Troubleshoot](https://raw.githubusercontent.com/komefai/PS4Macro/master/_resources/EmulateControllerTroubleshoot.png)\r\n\r\n##### Visual Studio Build Error\r\n\r\n=\u003e Reinstall NuGet Package.\r\n\r\n```\r\nUpdate-Package –reinstall PS4RemotePlayInterceptor\r\n```\r\n\r\n## To-Do List\r\n\r\n- Improve scripting API docs\r\n- Playback timeline UI\r\n- Macro editor tool\r\n- Mouse support for Remapper\r\n- ...\r\n\r\n## Resources\r\n\r\n- [Making Of Video](https://youtu.be/txI9AOEAk58)\r\n- [Scripting Tutorial Video](https://youtu.be/daCb97rbimA)\r\n- [Prototype Demo Video](https://youtu.be/QjTZsPR-BcI)\r\n\r\n## Credits\r\n\r\n- [EasyHook](https://easyhook.github.io/)\r\n- [Jays2Kings/DS4Windows](https://github.com/Jays2Kings/DS4Windows)\r\n- [jforshee/ImageHashing](https://github.com/jforshee/ImageHashing)\r\n- [Mono.Options](https://www.nuget.org/packages/Mono.Options/)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkomefai%2FPS4Macro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkomefai%2FPS4Macro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkomefai%2FPS4Macro/lists"}