-
Notifications
You must be signed in to change notification settings - Fork 26
6. Simple Automation
The starrail
package supports two automation features to assist with the gameplay of Honkai: Star Rail.
This feature enables users to record a sequence of keyboard and mouse actions and replay them within the game. It is specifically optimized for Honkai: Star Rail, ensuring that all actions are only recorded and executed when the game is in focus, thereby preventing unintentional interactions with other applications.
To start, enter the following to bring up the help panel for automation:
> starrail automation
Example Command Description
-------------------------- ----------------------------------------------------
starrail automation record Create and record a new automation sequence (macros)
starrail automation show List all recorded automation sequences
starrail automation run Run a recorded automation sequence
starrail automation remove Delete a recorded automated sequence
starrail automation clear Delete all recorded automation sequences
Note
Steps for Custom Automation
- Record a custom automation
- Verify recorded automation
- Run the custom automation
To record a new custom automation (keyboard + mouse sequence) in Honkai: Star Rail, follow these steps:
-
STEP 1: Launch the game Honkai: Star Rail.
- It is highly recommended to put the game into the following "phone menu" screen before starting the recording. You will need to return to this screen when you start running the automation, so be sure to remember the screen you started from.
- STEP 2: To start the recording once the game is launched and running, run:
> starrail automation record
You will be prompted to enter a sequence name. Enter a name that describes the purpose of the automation so you can remember what it is for.
[StarRail] New sequence name:
Once you input the automation name, the recording is ready to start.
[StarRail] Ready to record.
- To start: Focus on the game and the recording will automatically start.
- To stop: Click 'Stop Recording' on the top-left corner of the screen.
Focus on the game to begin recording automatically. A pop-up window on the top left corner of the screen will display the recorded key and mouse clicks, as well as the total number of actions recorded.
Important
Important Recording Notes
-
Only actions inputted directly into Honkai: Star Rail will be recorded. Keyboard and mouse performed in other applications during the recording process will not be captured. Therefore, it is safe to click on other applications without those actions being recorded.
-
Currently, only the following keyboard + mouse actions are supported:
-
Mouse
- Left and right click
- Scroll up and down
- Click and drag NOT supported
-
Keyboard:
- Numbers (0-9)
- Letter (a-z)
- Special keys
-
- STEP 3: When you have finished recording the automation sequence, click the blue "Stop Recording" button on the pop-up window.
[StarRail] Recording complete. Saved as '<sequence_name>' (ID x).
- To view: automation show
- To run: automation run
Once you get to this point, the recording will have been successfully saved and ready to be re-run.
To verify that the recording has been saved successfully, you may list out all the automation sequences recorded by running:
> starrail automation show
ID Sequence Name Date Created Runtime Actions Count
---- --------------- ------------------- -------------- ---------------
1 test 2024-08-xx 13:xx:xx 59 seconds 36
2 rewards 2024-08-xx 13:xx:xx 26.2 seconds 5
3 healing-set 2024-08-xx 14:xx:xx 397.24 seconds 22
...
To run the custom recorded automation, follow these steps:
- STEP 1: Launch the game Honkai: Star Rail and navigate to the same screen where you recorded the automation sequence.
- STEP 2: To start the automation, run:
> starrail automation run
You will be prompted to enter the ID of the automation sequence you would like to run and confirm the run:
ID Sequence Name Date Created Runtime Actions Count
---- --------------- ------------------- -------------- ---------------
1 test 2024-08-xx 13:xx:xx 59 seconds 36
2 rewards 2024-08-xx 13:xx:xx 26.2 seconds 5
3 healing-set 2024-08-xx 14:xx:xx 397.24 seconds 22
[StarRail] Which sequence would you like to run? (ID 1-3) <input_here>
Then, the automation will be ready to start. Focus on the game for the automation to start automatically.
[StarRail] Automation run ready start.
- To start: Focus on the game and the automation will automatically start.
Important
Important Automation Notes
- During the automation run, it is highly recommended to avoid using the keyboard/mouse. User input may deviate the program from its original automation sequence.
- To stop the automation while it's running, bring up the terminal and use CTRL+C to terminate the automation.
To delete an automation sequence, run:
> starrail automation remove
Then follow the prompted steps to remove the automation.
This feature assists with repetitive mouse clicking. This is ESPECIALLY USEFUL when farming stages and you need to click the "Start Again" button over and over again. Simply start the uniform clicks by running the following and then place the mouse over the "Start Again" button to deplete the available stamina.
To use this feature, run:
> starrail click
For example, to control the mouse to click:
- Once every 5 seconds and
- Hold for 2 seconds each click
> starrail click --interval 5 --randomize 1 --hold 2