Skip to main content

Control Game

Key input

User keystrokes can be simulated through Gamium Client. KeyBy allows you to specify the key input method.

You can use it as below.

await gamium.sendKey(KeyBy.unityKeycode('Space'));
await gamium.sendKey(KeyBy.unityKeyboard('Space'));

ActionChain

When manipulating the game through the Gamium Client, if you want to perform multiple actions continuously, you can use the Action Chain to perform the action at the most accurate time.

You can add multiple actions to ActionChain. When you call the performance() of ActionChain, the added actions are performed sequentially.

You can combine several actions as shown below.

Usage

await gamium
.actions()
.move({ x: screen.width / 2, y: screen.height / 2 })
.click({ x: screen.width / 2, y: screen.height / 2 })
.perform();

await gamium
.actions()
.sendKeys([KeyBy.unityKeycode('W'), KeyBy.unityKeycode('A')])
.sendKeys([KeyBy.unityKeycode('Space')])
.perform();