{"id":20679169,"url":"https://github.com/tylearymf/automaticgamepad","last_synced_at":"2025-06-27T01:32:11.022Z","repository":{"id":115060115,"uuid":"471731744","full_name":"tylearymf/AutomaticGamepad","owner":"tylearymf","description":"Write automated scripts for Xbox or PlayStation console games","archived":false,"fork":false,"pushed_at":"2022-09-06T07:18:27.000Z","size":15598,"stargazers_count":17,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-20T00:40:02.827Z","etag":null,"topics":["automatic","elden-ring","eldenring","gamepad","playstation","ps5","xbox"],"latest_commit_sha":null,"homepage":"","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/tylearymf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-19T15:14:19.000Z","updated_at":"2025-02-10T13:56:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"e2301c7d-90f2-423d-98a7-dbcf70ea22be","html_url":"https://github.com/tylearymf/AutomaticGamepad","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/tylearymf/AutomaticGamepad","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylearymf%2FAutomaticGamepad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylearymf%2FAutomaticGamepad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylearymf%2FAutomaticGamepad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylearymf%2FAutomaticGamepad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tylearymf","download_url":"https://codeload.github.com/tylearymf/AutomaticGamepad/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylearymf%2FAutomaticGamepad/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262172359,"owners_count":23269991,"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":["automatic","elden-ring","eldenring","gamepad","playstation","ps5","xbox"],"created_at":"2024-11-16T21:24:42.651Z","updated_at":"2025-06-27T01:32:10.954Z","avatar_url":"https://github.com/tylearymf.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AutomaticGamepad\n\n[中文文档](https://github.com/tylearymf/AutomaticGamepad/blob/main/README_CN.md)\n\n# About\n\n* Write automated scripts for console games\n\n| Supported Devices:video_game:  |     Xbox One X     |   Xbox Series X    | PlayStation 4 |   PlayStation 5    |\n| ------------------------------ | :----------------: | :----------------: | :-----------: | :----------------: |\n| **Test Result**:arrow_forward: | :white_check_mark: | :white_check_mark: |  :question:   | :white_check_mark: |\n\n## Prerequisites\n\n1. You need a PC, an Xbox (or PS5, PS4)\n2. The idea is to stream an Xbox (or PS5) on a PC over a local area network, and then use the software to send virtual gamepad signals to a streaming window on the PC  \n\n# Usage\n\n1. Install the virtual gamepad driver **ViGEmBusSetup.msi** in the Drivers directory   \n2. Run Xbox.exe (or PS Remote Play.exe) to stream your Xbox (or PS5).  \n3. Configure **config.ini** and set the **GamepadType** parameter\n   1.  Xbox：GamepadType=0\n   2.  PlayStation：GamepadType=1\n4. Run AutomaticGamepad.exe\n5. Select the script you want to run, confirm that the window binding is successful, set the number of times to run, and finally click Start\n\n\u003cimg src=\".\\Images\\xbox_en.png\" alt=\"Xbox Virtual Controller\" /\u003e\n\n\u003cimg src=\".\\Images\\playstation_en.png\" alt=\"Playstation Virtual Controller\" /\u003e\n\n---\n\n\n\n# Script functions\n\n1. The scripting language is JavaScript\n2. The script file suffix is .ag\n3. Place the script file in the same directory as the current program, and click Refresh in the program to view it\n\n## sleep\n\n```c#\n// Put the program to sleep for a while\nvoid sleep(double milliseconds)\n```\n\n* milliseconds：sleep time\n\n## setdelay\n\n```c#\n// The delay after a method is called. For example, call button(), dpad()\nvoid setdelay(double delay)\n```\n\n* delay：delay time（milliseconds）\n\n## button\n\n```c#\n// Press button\n// For example, press LB button, or L1 button\nvoid button(string name, double duration = 200)\n```\n\n* name：[Button Key Name](#button_key_name)\n* duration：Duration of the press. The default value is 200 ms\n\n## dpad\n\n```c#\n// Press the DPAD button\n// For example, press the up button of the DPad\nvoid dpad(string name, double duration = 200)\n```\n\n* name：[DPad Key Name](#dpad_key_name)\n* duration：Duration of the press. The default value is 200 ms\n\n## trigger\n\n```c#\n// Press the trigger\n// For example, press LT or RT, L1 or R1\nvoid trigger(string name, double val, double duration = 200)\n```\n\n* name：[Trigger Key Name](#trigger_key_name)\n* val：Trigger press value, range is [0, 1], full press is 1\n* duration：Duration of the press. The default value is 200 ms\n\n## axis\n\n```c#\n// Push the single axis of the joystick\n// For example, push the X-axis or Y-axis of the left joystick, or push the X-axis or Y-axis of the right joystick\nvoid axis(string name, double val, double duration = 200)\n```\n\n* name：[Axis Key Name](#axis_key_name)\n* val：The joystick push value, the range is [-1, 1], the lower left is -1, and the upper right is 1\n* duration：Duration of the press. The default value is 200 ms\n\n## axis2\n\n```c#\n// Push the two axes of the joystick\nvoid axis2(string name1, string name2, double val1, double val2, double duration = 200)\n```\n\n* name1：[Axis Key Name](#axis_key_name)\n* name2：[Axis Key Name](#axis_key_name)\n* val1：The joystick push value, the range is [-1, 1], the lower left is -1, and the upper right is 1\n* val2：The joystick push value, the range is [-1, 1], the lower left is -1, and the upper right is 1\n* duration：Duration of the press. The default value is 200 ms\n\n## buttonstate\n\n```c#\n// Press or release the button\nvoid buttonstate(string name, bool state)\n```\n\n* name：[Button Key Name](#button_key_name)\n* state:：press is true, release is false\n\n## dpadstate\n\n```c#\n// Press or release the dpad button\nvoid dpadstate(string name, bool state)\n```\n\n* name：[DPad Key Name](#dpad_key_name)\n* state:：press is true, release is false\n\n## triggerstate\n\n```c#\n// Press or release the trigger\nvoid triggerstate(string name, double val)\n```\n\n* name：[Trigger Key Name](#trigger_key_name)\n* val：Trigger press value, range is [0, 1], full press is 1\n\n## axisstate\n\n```c#\n// Push the single axis of the joystick\nvoid axisstate(string name, double val)\n```\n\n* name：[Axis Key Name](#axis_key_name)\n* val：The joystick push value, the range is [-1, 1], the lower left is -1, and the upper right is 1\n\n## axis2state\n\n```c#\n// Push the two axes of the joystick\nvoid axis2state(string name1, string name2, double val1, double val2)\n```\n\n* name1：[Axis Key Name](#axis_key_name)\n* name2：[Axis Key Name](#axis_key_name)\n* val1：The joystick push value, the range is [-1, 1], the lower left is -1, and the upper right is 1\n* val2：The joystick push value, the range is [-1, 1], the lower left is -1, and the upper right is 1\n\n# Custom key name\n\n* Xbox：[XboxGamepad.cs](https://github.com/tylearymf/AutomaticGamepad/blob/main/Xbox/XboxGamepad.cs)\n* PlayStation：[PlaystationGamepad.cs](https://github.com/tylearymf/AutomaticGamepad/blob/main/PlayStation/PlaystationGamepad.cs)\n\n# \u003cb name='button_key_name'\u003eButton Key Name\u003c/b\u003e\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003cth colspan=\"2\" align=\"center\"\u003eXbox\u003c/th\u003e\n        \u003cth colspan=\"2\" align=\"center\"\u003ePlayStation\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd align=\"center\"\u003eA Button\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"a\"\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e△ Button\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e”b1“\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd align=\"center\"\u003eB Button\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"b\"\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e○ Button\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"b2\"\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd align=\"center\"\u003eX Button\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"x\"\u003c/td\u003e\n        \u003ctd align=\"center\"\u003eX Button\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"b3\"\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd align=\"center\"\u003eY Button\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"y\"\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e□ Button\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"b4\"\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd align=\"center\"\u003eLeft Bumper\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"lb\"\u003c/td\u003e\n        \u003ctd align=\"center\"\u003eL1 Button\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"l1\"\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd align=\"center\"\u003eRight Bumper\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"rb\"\u003c/td\u003e\n        \u003ctd align=\"center\"\u003eR1 Button\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"r1\"\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd align=\"center\"\u003eLeft Stick Button\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"lsb\"\u003c/td\u003e\n        \u003ctd align=\"center\"\u003eLeft Stick Button\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"l3\"\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd align=\"center\"\u003eRight Stick Button\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"rsb\"\u003c/td\u003e\n        \u003ctd align=\"center\"\u003eRight Stick Button\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"r3\"\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd align=\"center\"\u003eMenu Button\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"menu\"\u003c/td\u003e\n        \u003ctd align=\"center\"\u003eShare Button\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"share\"\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd align=\"center\"\u003eView Button\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"view\"\u003c/td\u003e\n        \u003ctd align=\"center\"\u003eOption Button\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"option\"\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd align=\"center\"\u003eXBOX Button\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"home\"\u003c/td\u003e\n        \u003ctd align=\"center\"\u003ePS Button\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"home\"\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd align=\"center\"\u003e\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\u003c/td\u003e\n        \u003ctd align=\"center\"\u003eTouchpad Button\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"touchpad\"\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n# \u003cb name=\"dpad_key_name\"\u003eDPad Key Name\u003c/b\u003e\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003cth colspan=\"2\" align=\"center\"\u003eXbox \u0026 PlayStation\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd align=\"center\"\u003eUp key\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"up\"\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd align=\"center\"\u003eDown key\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"down\"\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd align=\"center\"\u003eLeft Key\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"left\"\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd align=\"center\"\u003eRight Key\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"right\"\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n# \u003cb name=\"trigger_key_name\"\u003eTrigger Key Name\u003c/b\u003e\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003cth colspan=\"2\" align=\"center\"\u003eXbox\u003c/th\u003e\n        \u003cth colspan=\"2\" align=\"center\"\u003ePlayStation\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd align=\"center\"\u003eLeft Trigger\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"lt\"\u003c/td\u003e\n        \u003ctd align=\"center\"\u003eL2 Key\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"l2\"\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd align=\"center\"\u003eRight Trigger\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"rt\"\u003c/td\u003e\n        \u003ctd align=\"center\"\u003eR2 Key\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"r2\"\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n# \u003cb name=\"axis_key_name\"\u003eAxis Key Name\u003c/b\u003e\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003cth colspan=\"2\" align=\"center\"\u003eXbox \u0026 PlayStation\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd align=\"center\"\u003eX-axis of left joystick\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"lsx\"\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd align=\"center\"\u003eY-axis of left joystick\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"lsy\"\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd align=\"center\"\u003eX-axis of right joystick\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"rsx\"\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd align=\"center\"\u003eY-axis of left joystick\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\"rsy\"\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n# Example\n\n```javascript\n// For example (XBOX)\n// 1. Go to the ’Palace Approach Ledge Road‘ Site of Grace\n// 2. Please two-hand your equipped 'Sacred Sword Relic' weapon\n// 3. Finally, please follow the ‘Usage’ steps\n\n// Go to the Site of Grace\nbutton(\"view\")\nbutton(\"y\")\nbutton(\"a\")\nbutton(\"a\")\n\n// Wait for the map to finish loading\nsleep(5500)\n\n// Move to the front left\naxis2(\"lsx\", \"lsy\", -0.31, 1, 5200)\n\n// Cast weapons skill\ntrigger(\"lt\", 1)\n\n// wait for the monsters to die\nsleep(5000)\n\n```\n\n\u003cimg src=\".\\Images\\example.gif\" alt=\"example.gif\" /\u003e\n\n# Reference \n\n\u003e [ViGEmBus](https://github.com/ViGEm/ViGEmBus)\n\u003e [ViGEm.NET](https://github.com/tylearymf/ViGEm.NET)\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftylearymf%2Fautomaticgamepad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftylearymf%2Fautomaticgamepad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftylearymf%2Fautomaticgamepad/lists"}